1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
name: Build Executables
on:
push:
branches:
- '**'
pull_request: {}
workflow_dispatch:
jobs:
build:
if: contains(github.event.head_commit.message, 'jarvis, run github actions') || github.event_name == 'workflow_dispatch'
name: Build for ${{ matrix.os_name }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: windows-latest
os_name: windows-x64
target: x86_64-pc-windows-msvc
ext: .exe
- os: ubuntu-latest
os_name: linux-x64
target: x86_64-unknown-linux-gnu
ext: ""
- os: macos-latest
os_name: macos-arm64
target: aarch64-apple-darwin
ext: ""
steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
with:
gradle-version: 'wrapper'
- name: give gradle permissions
if: matrix.os != 'windows-latest'
run: chmod +x gradlew
- name: build shadowJar
run: ./gradlew shadowJar
- name: install libudev-dev (Linux)
if: matrix.os == 'ubuntu-latest'
run: sudo apt-get update && sudo apt-get install -y libudev-dev
- name: install assimp-utils (Linux)
if: matrix.os == 'ubuntu-latest'
run: sudo apt-get install -y assimp-utils
- name: install mold linker (Linux)
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get install -y mold
clang --version || sudo apt-get install -y clang
- name: install assimp (macOS)
if: matrix.os == 'macos-latest'
run: brew install assimp
- name: install mold linker (macOS)
if: matrix.os == 'macos-latest'
run: brew install mold
- name: Setup Scoop (Windows)
if: matrix.os == 'windows-latest'
uses: MinoruSekine/setup-scoop@v4.0.2
- name: install mold linker (Windows)
if: matrix.os == 'windows-latest'
run: scoop install mold
- name: install rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- name: build eucalyptus packages
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: cargo build --release --package eucalyptus-core --package eucalyptus-editor --package magna-carta --target ${{ matrix.target }}
- name: prepare the artifact
run: |
mkdir -p dist/libs
cp target/${{ matrix.target }}/release/eucalyptus-editor${{ matrix.ext }} dist/
cp target/${{ matrix.target }}/release/magna-carta${{ matrix.ext }} dist/
if [ "${{ matrix.os }}" = "windows-latest" ]; then
cp target/${{ matrix.target }}/release/eucalyptus_core.dll dist/ 2>/dev/null || true
cp target/${{ matrix.target }}/release/eucalyptus_core.dll.lib dist/ 2>/dev/null || true
elif [ "${{ matrix.os }}" = "ubuntu-latest" ]; then
cp target/${{ matrix.target }}/release/libeucalyptus_core.so dist/ 2>/dev/null || true
elif [ "${{ matrix.os }}" = "macos-latest" ]; then
cp target/${{ matrix.target }}/release/libeucalyptus_core.dylib dist/ 2>/dev/null || true
fi
shell: bash
- name: upload
uses: actions/upload-artifact@v4
with:
name: executables-${{ matrix.os_name }}
path: dist/