|
| 1 | +name: Release bindings |
| 2 | + |
| 3 | +on: |
| 4 | + pull_request: |
| 5 | + release: |
| 6 | + types: [published] |
| 7 | + workflow_dispatch: |
| 8 | + inputs: |
| 9 | + tag_name: |
| 10 | + description: Existing release tag to attach artifacts to, for example v0.9.1 |
| 11 | + required: true |
| 12 | + type: string |
| 13 | + |
| 14 | +concurrency: |
| 15 | + group: ${{ github.workflow }}-${{ github.ref }} |
| 16 | + cancel-in-progress: ${{ github.event_name == 'pull_request' }} |
| 17 | + |
| 18 | +env: |
| 19 | + CARGO_TERM_COLOR: always |
| 20 | + |
| 21 | +jobs: |
| 22 | + build: |
| 23 | + name: build-${{ matrix.target }} |
| 24 | + runs-on: ${{ matrix.os }} |
| 25 | + strategy: |
| 26 | + fail-fast: false |
| 27 | + matrix: |
| 28 | + include: |
| 29 | + - os: ubuntu-latest |
| 30 | + target: x86_64-unknown-linux-gnu |
| 31 | + archive: libere_verifier_c.linux-amd64.tar.gz |
| 32 | + - os: ubuntu-latest |
| 33 | + target: aarch64-unknown-linux-gnu |
| 34 | + archive: libere_verifier_c.linux-arm64.tar.gz |
| 35 | + - os: macos-latest |
| 36 | + target: x86_64-apple-darwin |
| 37 | + archive: libere_verifier_c.darwin-amd64.tar.gz |
| 38 | + - os: macos-latest |
| 39 | + target: aarch64-apple-darwin |
| 40 | + archive: libere_verifier_c.darwin-arm64.tar.gz |
| 41 | + steps: |
| 42 | + - name: Checkout repository |
| 43 | + uses: actions/checkout@v6 |
| 44 | + |
| 45 | + - name: Install Rust toolchain |
| 46 | + uses: dtolnay/rust-toolchain@master |
| 47 | + with: |
| 48 | + toolchain: nightly-2026-05-01 |
| 49 | + |
| 50 | + - name: Cache dependencies |
| 51 | + uses: Swatinem/rust-cache@v2 |
| 52 | + |
| 53 | + - name: Install zig |
| 54 | + uses: mlugg/setup-zig@v2 |
| 55 | + with: |
| 56 | + version: 0.16.0 |
| 57 | + |
| 58 | + - name: Install cargo-zigbuild |
| 59 | + uses: taiki-e/install-action@v2 |
| 60 | + with: |
| 61 | + tool: cargo-zigbuild |
| 62 | + |
| 63 | + - name: Build and package |
| 64 | + run: bash bindings/scripts/build.sh "${{ matrix.target }}" "${{ matrix.archive }}" |
| 65 | + |
| 66 | + - name: Upload artifact |
| 67 | + uses: actions/upload-artifact@v4 |
| 68 | + with: |
| 69 | + name: ${{ matrix.target }} |
| 70 | + path: ${{ matrix.archive }} |
| 71 | + if-no-files-found: error |
| 72 | + |
| 73 | + upload: |
| 74 | + name: upload-release-assets |
| 75 | + needs: build |
| 76 | + if: ${{ github.event_name == 'release' || github.event_name == 'workflow_dispatch' }} |
| 77 | + runs-on: ubuntu-latest |
| 78 | + permissions: |
| 79 | + contents: write |
| 80 | + steps: |
| 81 | + - name: Download artifacts |
| 82 | + uses: actions/download-artifact@v4 |
| 83 | + with: |
| 84 | + path: artifacts |
| 85 | + |
| 86 | + - name: Attach artifacts to release |
| 87 | + uses: softprops/action-gh-release@v2 |
| 88 | + with: |
| 89 | + tag_name: ${{ github.event_name == 'workflow_dispatch' && inputs.tag_name || github.event.release.tag_name }} |
| 90 | + files: artifacts/**/* |
0 commit comments