-
-
Notifications
You must be signed in to change notification settings - Fork 0
80 lines (79 loc) · 2.44 KB
/
commit.yml
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
name: Build Natives
on:
push:
branches:
- natives
jobs:
build-natives:
strategy:
fail-fast: false
matrix:
os: [linux, macos, windows]
arch: [i386, x86_64, aarch64, arm]
build_type: [Release]
include:
- os: linux
runner: ubuntu-latest
libname: libopensesamenative.so
java_home: "$JAVA_HOME_17_X64"
- os: macos
runner: macos-latest
libname: libopensesamenative.dylib
java_home: "$JAVA_HOME_17_arm64"
- os: windows
runner: windows-latest
libname: opensesamenative.dll
java_home: "$JAVA_HOME_17_X64"
- os: linux
arch: i386
compiler_package: g++-i686-linux-gnu
- os: linux
arch: aarch64
compiler_package: g++-aarch64-linux-gnu
- os: linux
arch: arm
compiler_package: g++-arm-linux-gnueabi
exclude:
- os: macos
arch: i386
- os: macos
arch: arm
- os: windows
arch: arm
runs-on: ${{ matrix.runner }}
steps:
- uses: actions/checkout@v4
- name: Setup GCC
if: ${{ matrix.compiler_package }}
run: sudo apt install -y ${{ matrix.compiler_package }}
- name: Configure CMake
run: >
cmake -B cmakebuild
-DCMAKE_TOOLCHAIN_FILE=toolchains/${{ matrix.os }}-${{ matrix.arch }}.cmake
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
-DJAVA_HOME=${{ matrix.java_home }}
-S ${{ github.workspace }}
- name: Build
run: cmake --build cmakebuild --config ${{ matrix.build_type }}
- if: ${{ matrix.os != 'windows' }}
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.os }}-${{ matrix.arch }}
path: cmakebuild/${{ matrix.libname }}
- if: ${{ matrix.os == 'windows' }}
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.os }}-${{ matrix.arch }}
path: cmakebuild/${{ matrix.build_type }}/${{ matrix.libname }}
publish:
permissions:
contents: read
packages: write
runs-on: ubuntu-latest
needs: [build-natives]
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
- run: ./gradlew publish -Pcommit_sha=${{ github.sha }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}