|
| 1 | +# Test-only workflow for validating our release artifact build matrix and provenance |
| 2 | +# attestation without creating a GitHub Release. |
| 3 | +name: release-artifacts-test |
| 4 | + |
| 5 | +on: |
| 6 | + workflow_dispatch: |
| 7 | + |
| 8 | +jobs: |
| 9 | + build-and-attest: |
| 10 | + name: build + attest (${{ matrix.target }}) |
| 11 | + permissions: |
| 12 | + contents: read |
| 13 | + id-token: write |
| 14 | + attestations: write |
| 15 | + strategy: |
| 16 | + matrix: |
| 17 | + os: [macos-latest, ubuntu-latest] |
| 18 | + target: [aarch64-apple-darwin, x86_64-unknown-linux-gnu] |
| 19 | + exclude: |
| 20 | + - os: macos-latest |
| 21 | + target: x86_64-unknown-linux-gnu |
| 22 | + - os: ubuntu-latest |
| 23 | + target: aarch64-apple-darwin |
| 24 | + runs-on: ${{ matrix.os }} |
| 25 | + steps: |
| 26 | + - name: Checkout |
| 27 | + uses: actions/checkout@v5 |
| 28 | + with: |
| 29 | + fetch-depth: 0 |
| 30 | + persist-credentials: false |
| 31 | + |
| 32 | + - name: Install Rust |
| 33 | + run: | |
| 34 | + rustup update --no-self-update |
| 35 | + rustc --version |
| 36 | +
|
| 37 | + - name: Add target |
| 38 | + run: | |
| 39 | + rustup target add ${{ matrix.target }} |
| 40 | +
|
| 41 | + - name: Install cargo-make |
| 42 | + run: | |
| 43 | + if ! cargo make --version 2>/dev/null; then |
| 44 | + cargo install cargo-make --force |
| 45 | + fi |
| 46 | +
|
| 47 | + - name: build binaries |
| 48 | + run: | |
| 49 | + set -e |
| 50 | + ARGS="--release --target ${{ matrix.target }}" |
| 51 | + cargo make --profile production midenc ${ARGS} |
| 52 | + cargo make --profile production cargo-miden ${ARGS} |
| 53 | +
|
| 54 | + - name: prepare artifacts |
| 55 | + run: | |
| 56 | + set -e |
| 57 | + mv bin/midenc midenc-${{ matrix.target }} |
| 58 | + mv bin/cargo-miden cargo-miden-${{ matrix.target }} |
| 59 | +
|
| 60 | + - name: attest midenc |
| 61 | + uses: actions/attest-build-provenance@v3 |
| 62 | + with: |
| 63 | + subject-path: midenc-${{ matrix.target }} |
| 64 | + |
| 65 | + - name: attest cargo-miden |
| 66 | + uses: actions/attest-build-provenance@v3 |
| 67 | + with: |
| 68 | + subject-path: cargo-miden-${{ matrix.target }} |
| 69 | + |
| 70 | + - name: upload midenc |
| 71 | + uses: actions/upload-artifact@v4 |
| 72 | + with: |
| 73 | + name: midenc-${{ matrix.target }} |
| 74 | + path: midenc-${{ matrix.target }} |
| 75 | + if-no-files-found: error |
| 76 | + retention-days: 7 |
| 77 | + |
| 78 | + - name: upload cargo-miden |
| 79 | + uses: actions/upload-artifact@v4 |
| 80 | + with: |
| 81 | + name: cargo-miden-${{ matrix.target }} |
| 82 | + path: cargo-miden-${{ matrix.target }} |
| 83 | + if-no-files-found: error |
| 84 | + retention-days: 7 |
0 commit comments