Skip to content

Commit 9abbaea

Browse files
committed
Compile native libs in the CI
update .gitignore and remove compiled binaries
1 parent 0850533 commit 9abbaea

File tree

7 files changed

+50
-2
lines changed

7 files changed

+50
-2
lines changed

.github/workflows/publish-on-maven.yml

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,58 @@ on:
55
tags:
66
- '**'
77

8+
env:
9+
NATIVE_LIBS_DIR: ${{ github.workspace }}/build/nativeLibs
10+
811
jobs:
12+
build-native:
13+
runs-on: ${{ matrix.os }}
14+
strategy:
15+
matrix:
16+
include:
17+
- os: ubuntu-latest
18+
command: bash linuxlib/build.sh
19+
- os: macos-latest
20+
command: bash maclib/build.sh
21+
- os: windows-latest
22+
command: cmd /c winlib/build.bat
23+
24+
steps:
25+
- uses: actions/checkout@v4
26+
with:
27+
submodules: recursive
28+
29+
- name: Build native binary
30+
run: ${{ matrix.command }}
31+
env:
32+
NATIVE_LIBS_OUTPUT_DIR: ${{ env.NATIVE_LIBS_DIR }}
33+
34+
- name: Upload native binaries
35+
uses: actions/upload-artifact@v4
36+
with:
37+
name: nativeLibs-${{ matrix.os }}
38+
path: ${{ env.NATIVE_LIBS_DIR }}/**
39+
940
publish:
41+
needs: [ "build-native" ]
1042
runs-on: macos-latest
1143

1244
steps:
1345
- name: Checkout code
1446
uses: actions/checkout@v3
1547

48+
- name: Download all native binaries
49+
uses: actions/download-artifact@v4
50+
with:
51+
name: nativeLibs-*
52+
path: ${{ env.NATIVE_LIBS_DIR }}
53+
merge-multiple: true
54+
55+
- name: Copy native libs into src/commonMain/resources/
56+
run: |
57+
mkdir -p src/commonMain/resources/
58+
cp -r ${{ env.NATIVE_LIBS_DIR }}/* src/commonMain/resources/
59+
1660
- name: Set up JDK
1761
uses: actions/setup-java@v3
1862
with:
@@ -27,4 +71,3 @@ jobs:
2771
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.SIGNINGINMEMORYKEY }}
2872
ORG_GRADLE_PROJECT_signingInMemoryKeyId: ${{ secrets.SIGNINGKEYID }}
2973
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.SIGNINGPASSWORD }}
30-

.gitignore

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,9 @@ bin/
4848
tray_position.properties
4949

5050
linuxlib/build-x86-64
51-
linuxlibdbus/build-x86-64
51+
linuxlibdbus/build-x86-64
52+
53+
# don't commit compiled native binaries
54+
src/commonMain/resources/**/*.so
55+
src/commonMain/resources/**/*.dll
56+
src/commonMain/resources/**/*.dylib
-127 KB
Binary file not shown.
-102 KB
Binary file not shown.
-4.64 MB
Binary file not shown.
-17.5 KB
Binary file not shown.
-18 KB
Binary file not shown.

0 commit comments

Comments
 (0)