|
| 1 | +--- |
| 2 | + name: deploy |
| 3 | + |
| 4 | + on: |
| 5 | + push: |
| 6 | + branches: [master] |
| 7 | + pull_request: |
| 8 | + branches: [master] |
| 9 | + |
| 10 | + # Cancel old builds when pushing new commits. |
| 11 | + concurrency: |
| 12 | + group: deploy-${{ github.event.pull_request.number || github.ref }} |
| 13 | + cancel-in-progress: true |
| 14 | + |
| 15 | + jobs: |
| 16 | + linux: |
| 17 | + name: Linux |
| 18 | + strategy: |
| 19 | + matrix: |
| 20 | + arch: [aarch64, x86_64] |
| 21 | + runs-on: ${{ matrix.arch == 'aarch64' && 'ubuntu-24.04-arm' || 'ubuntu-24.04' }} |
| 22 | + steps: |
| 23 | + - name: Checkout code |
| 24 | + uses: actions/checkout@v4 |
| 25 | + - name: Cache built binaries |
| 26 | + id: cache |
| 27 | + uses: actions/cache@v4 |
| 28 | + with: |
| 29 | + path: | |
| 30 | + _build |
| 31 | + _git |
| 32 | + _install |
| 33 | + key: ${{ github.job }}-${{ matrix.arch }} |
| 34 | + - name: Install dependencies |
| 35 | + if: steps.cache.outputs.cache-hit != 'true' |
| 36 | + run: sudo apt-get update && sudo apt-get install -y --no-install-recommends |
| 37 | + yasm |
| 38 | + - name: Build binaries |
| 39 | + run: | |
| 40 | + if [ -d _install/host ]; then |
| 41 | + touch _install/host/*.stamp |
| 42 | + fi |
| 43 | + scripts/build-host -j "$(nproc)" |
| 44 | + - name: Upload artifact |
| 45 | + uses: actions/upload-artifact@v4 |
| 46 | + with: |
| 47 | + name: ${{ github.job }}-${{ matrix.arch }} |
| 48 | + path: _install/host |
| 49 | + if-no-files-found: error |
| 50 | + |
| 51 | + android: |
| 52 | + needs: [linux] |
| 53 | + name: Android |
| 54 | + strategy: |
| 55 | + matrix: |
| 56 | + abi: [arm64-v8a, armeabi-v7a, x86_64, x86] |
| 57 | + runs-on: ubuntu-24.04 |
| 58 | + steps: |
| 59 | + - name: Checkout code |
| 60 | + uses: actions/checkout@v4 |
| 61 | + - name: Download host tools |
| 62 | + uses: actions/download-artifact@v4 |
| 63 | + with: |
| 64 | + name: linux-x86_64 |
| 65 | + path: _install/host |
| 66 | + - name: Cache built binaries |
| 67 | + id: cache |
| 68 | + uses: actions/cache@v4 |
| 69 | + with: |
| 70 | + path: | |
| 71 | + _git |
| 72 | + _install |
| 73 | + key: ${{ github.job }}-${{ matrix.abi }} |
| 74 | + - name: Install dependencies |
| 75 | + if: steps.cache.outputs.cache-hit != 'true' |
| 76 | + run: sudo apt-get update && sudo apt-get install -y --no-install-recommends |
| 77 | + yasm |
| 78 | + - name: Build Android JNI |
| 79 | + run: scripts/build-android.sh ${{ matrix.abi }} -j "$(nproc)" |
| 80 | + |
| 81 | + macos: |
| 82 | + name: macOS |
| 83 | + strategy: |
| 84 | + matrix: |
| 85 | + arch: [arm64, x86_64] |
| 86 | + runs-on: ${{ matrix.arch == 'x86_64' && 'macos-13' || 'macos-14' }} |
| 87 | + steps: |
| 88 | + - name: Checkout code |
| 89 | + uses: actions/checkout@v4 |
| 90 | + - name: Cache built binaries |
| 91 | + id: cache |
| 92 | + uses: actions/cache@v4 |
| 93 | + with: |
| 94 | + path: | |
| 95 | + _build |
| 96 | + _git |
| 97 | + _install |
| 98 | + key: ${{ github.job }}-${{ matrix.arch }} |
| 99 | + - name: Install dependencies |
| 100 | + if: steps.cache.outputs.cache-hit != 'true' |
| 101 | + run: brew install autoconf automake libtool yasm |
| 102 | + - name: Build binaries |
| 103 | + run: scripts/build-host -j "$(sysctl -n hw.logicalcpu)" |
| 104 | + - name: Upload artifact |
| 105 | + uses: actions/upload-artifact@v4 |
| 106 | + with: |
| 107 | + name: ${{ github.job }}-${{ matrix.arch }} |
| 108 | + path: _install/host |
| 109 | + if-no-files-found: error |
0 commit comments