|
5 | 5 | tags: |
6 | 6 | - '**' |
7 | 7 |
|
| 8 | +env: |
| 9 | + NATIVE_LIBS_DIR: ${{ github.workspace }}/build/nativeLibs |
| 10 | + |
8 | 11 | 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 | + |
9 | 40 | publish: |
| 41 | + needs: [ "build-native" ] |
10 | 42 | runs-on: macos-latest |
11 | 43 |
|
12 | 44 | steps: |
13 | 45 | - name: Checkout code |
14 | 46 | uses: actions/checkout@v3 |
15 | 47 |
|
| 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 | +
|
16 | 60 | - name: Set up JDK |
17 | 61 | uses: actions/setup-java@v3 |
18 | 62 | with: |
|
27 | 71 | ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.SIGNINGINMEMORYKEY }} |
28 | 72 | ORG_GRADLE_PROJECT_signingInMemoryKeyId: ${{ secrets.SIGNINGKEYID }} |
29 | 73 | ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.SIGNINGPASSWORD }} |
30 | | - |
|
0 commit comments