|
| 1 | +name: Build Native Libraries |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_call: |
| 5 | + |
| 6 | +jobs: |
| 7 | + build-native-macos: |
| 8 | + runs-on: macos-latest |
| 9 | + steps: |
| 10 | + - name: Checkout code |
| 11 | + uses: actions/checkout@v4 |
| 12 | + |
| 13 | + - name: Set up JDK |
| 14 | + uses: actions/setup-java@v4 |
| 15 | + with: |
| 16 | + java-version: '17' |
| 17 | + distribution: 'temurin' |
| 18 | + |
| 19 | + - name: Build macOS native libraries |
| 20 | + working-directory: src/native/macos |
| 21 | + run: bash build.sh |
| 22 | + env: |
| 23 | + NATIVE_LIBS_OUTPUT_DIR: ${{ github.workspace }}/build/nativeLibs |
| 24 | + |
| 25 | + - name: Verify macOS natives |
| 26 | + run: | |
| 27 | + test -f build/nativeLibs/darwin-aarch64/libMacTray.dylib |
| 28 | + test -f build/nativeLibs/darwin-x86-64/libMacTray.dylib |
| 29 | + ls -la build/nativeLibs/darwin-aarch64/ |
| 30 | + ls -la build/nativeLibs/darwin-x86-64/ |
| 31 | +
|
| 32 | + - name: Upload macOS ARM64 library |
| 33 | + uses: actions/upload-artifact@v4 |
| 34 | + with: |
| 35 | + name: native-darwin-aarch64 |
| 36 | + path: build/nativeLibs/darwin-aarch64/libMacTray.dylib |
| 37 | + retention-days: 1 |
| 38 | + |
| 39 | + - name: Upload macOS x86_64 library |
| 40 | + uses: actions/upload-artifact@v4 |
| 41 | + with: |
| 42 | + name: native-darwin-x86-64 |
| 43 | + path: build/nativeLibs/darwin-x86-64/libMacTray.dylib |
| 44 | + retention-days: 1 |
| 45 | + |
| 46 | + build-native-linux: |
| 47 | + runs-on: ${{ matrix.os }} |
| 48 | + strategy: |
| 49 | + matrix: |
| 50 | + include: |
| 51 | + - os: ubuntu-latest |
| 52 | + arch: x86-64 |
| 53 | + - os: ubuntu-24.04-arm |
| 54 | + arch: aarch64 |
| 55 | + steps: |
| 56 | + - name: Checkout code |
| 57 | + uses: actions/checkout@v4 |
| 58 | + |
| 59 | + - name: Set up JDK |
| 60 | + uses: actions/setup-java@v4 |
| 61 | + with: |
| 62 | + java-version: '17' |
| 63 | + distribution: 'temurin' |
| 64 | + |
| 65 | + - name: Install dependencies |
| 66 | + run: | |
| 67 | + sudo apt-get update |
| 68 | + sudo apt-get install -y libsystemd-dev |
| 69 | +
|
| 70 | + - name: Build Linux native library |
| 71 | + working-directory: src/native/linux |
| 72 | + run: bash build.sh |
| 73 | + env: |
| 74 | + NATIVE_LIBS_OUTPUT_DIR: ${{ github.workspace }}/build/nativeLibs |
| 75 | + |
| 76 | + - name: Verify Linux natives |
| 77 | + run: | |
| 78 | + test -f build/nativeLibs/linux-${{ matrix.arch }}/libLinuxTray.so |
| 79 | + ls -la build/nativeLibs/linux-${{ matrix.arch }}/ |
| 80 | +
|
| 81 | + - name: Upload Linux library |
| 82 | + uses: actions/upload-artifact@v4 |
| 83 | + with: |
| 84 | + name: native-linux-${{ matrix.arch }} |
| 85 | + path: build/nativeLibs/linux-${{ matrix.arch }}/libLinuxTray.so |
| 86 | + retention-days: 1 |
| 87 | + |
| 88 | + build-native-windows: |
| 89 | + runs-on: windows-latest |
| 90 | + steps: |
| 91 | + - name: Checkout code |
| 92 | + uses: actions/checkout@v4 |
| 93 | + |
| 94 | + - name: Set up JDK |
| 95 | + uses: actions/setup-java@v4 |
| 96 | + with: |
| 97 | + java-version: '17' |
| 98 | + distribution: 'temurin' |
| 99 | + |
| 100 | + - name: Build Windows native libraries |
| 101 | + working-directory: src/native/windows |
| 102 | + run: cmd /c build.bat |
| 103 | + env: |
| 104 | + NATIVE_LIBS_OUTPUT_DIR: ${{ github.workspace }}/build/nativeLibs |
| 105 | + |
| 106 | + - name: Verify Windows natives |
| 107 | + shell: bash |
| 108 | + run: | |
| 109 | + test -f build/nativeLibs/win32-x86-64/WinTray.dll |
| 110 | + test -f build/nativeLibs/win32-arm64/WinTray.dll |
| 111 | + ls -la build/nativeLibs/win32-x86-64/ |
| 112 | + ls -la build/nativeLibs/win32-arm64/ |
| 113 | +
|
| 114 | + - name: Upload Windows x64 library |
| 115 | + uses: actions/upload-artifact@v4 |
| 116 | + with: |
| 117 | + name: native-win32-x86-64 |
| 118 | + path: build/nativeLibs/win32-x86-64/WinTray.dll |
| 119 | + retention-days: 1 |
| 120 | + |
| 121 | + - name: Upload Windows ARM64 library |
| 122 | + uses: actions/upload-artifact@v4 |
| 123 | + with: |
| 124 | + name: native-win32-arm64 |
| 125 | + path: build/nativeLibs/win32-arm64/WinTray.dll |
| 126 | + retention-days: 1 |
0 commit comments