forked from xpple/SeedMapper
-
Notifications
You must be signed in to change notification settings - Fork 0
126 lines (121 loc) · 4.3 KB
/
build.yml
File metadata and controls
126 lines (121 loc) · 4.3 KB
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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
name: build
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
compile-cubiomes:
name: Compile Cubiomes to shared library
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: 'true'
- name: Compile shared library (ubuntu-latest)
if: matrix.os == 'ubuntu-latest'
working-directory: src/main/c/cubiomes
run: |
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build --config Release
cp build/libcubiomes.so ../../resources/libcubiomes.so
- name: Compile shared library (macos-latest)
if: matrix.os == 'macos-latest'
working-directory: src/main/c/cubiomes
run: |
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64"
cmake --build build --config Release
cp build/libcubiomes.dylib ../../resources/libcubiomes.dylib
- name: Set up MSYS2 (windows-latest)
if: matrix.os == 'windows-latest'
uses: msys2/setup-msys2@v2
with:
update: true
install: >
base-devel
mingw-w64-x86_64-toolchain
mingw-w64-x86_64-cmake
mingw-w64-x86_64-ninja
- name: Compile shared library (windows-latest)
if: matrix.os == 'windows-latest'
working-directory: src/main/c/cubiomes
shell: msys2 {0}
run: |
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build --config Release
cp build/cubiomes.dll ../../resources/cubiomes.dll
- name: Compute SHA256 hash (ubuntu-latest)
if: matrix.os == 'ubuntu-latest'
run: sha256sum src/main/resources/libcubiomes.so
- name: Compute SHA256 hash (macos-latest)
if: matrix.os == 'macos-latest'
run: shasum -a 256 src/main/resources/libcubiomes.dylib
- name: Compute SHA256 hash (windows-latest)
if: matrix.os == 'windows-latest'
run: Get-FileHash -Algorithm SHA256 src/main/resources/cubiomes.dll
- name: Capture shared library (ubuntu-latest)
if: matrix.os == 'ubuntu-latest'
uses: actions/upload-artifact@v4
with:
name: libcubiomes.so
path: src/main/resources/libcubiomes.so
- name: Capture shared library (macos-latest)
if: matrix.os == 'macos-latest'
uses: actions/upload-artifact@v4
with:
name: libcubiomes.dylib
path: src/main/resources/libcubiomes.dylib
- name: Capture shared library (windows-latest)
if: matrix.os == 'windows-latest'
uses: actions/upload-artifact@v4
with:
name: cubiomes.dll
path: src/main/resources/cubiomes.dll
build:
name: Build SeedMapper
needs: compile-cubiomes
runs-on: ubuntu-latest
env:
LLVM_HOME: /usr/lib/llvm-13
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: 'true'
- name: Capture shared library
uses: actions/download-artifact@v4
with:
merge-multiple: true
path: src/main/resources/
- name: Validate gradle wrapper
uses: gradle/actions/wrapper-validation@v4
- name: Setup JDK 23
uses: actions/setup-java@v4
with:
java-version: 23
distribution: 'temurin'
- name: Make Gradle wrapper executable
run: |
chmod +x ./gradlew
chmod +x ./jextract/gradlew
- name: Install LLVM 13
run: |
wget --no-verbose https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-x86_64-linux-gnu-ubuntu-20.04.tar.xz
tar -xf clang+llvm-13.0.0-x86_64-linux-gnu-ubuntu-20.04.tar.xz
sudo mv clang+llvm-13.0.0-x86_64-linux-gnu-ubuntu-20.04 $LLVM_HOME
- name: Compile jextract
working-directory: jextract
run: ./gradlew --stacktrace -Pjdk_home=$JAVA_HOME -Pllvm_home=$LLVM_HOME clean verify
- name: Build
run: ./gradlew build
- name: Capture build artifacts
uses: actions/upload-artifact@v4
with:
name: SeedMapper
path: build/libs/