Merge branch 'zerosnacks-patch-1' #7
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Release | |
| permissions: {} | |
| on: | |
| push: | |
| tags: | |
| - "v*" | |
| env: | |
| CARGO_TERM_COLOR: always | |
| jobs: | |
| build: | |
| permissions: | |
| id-token: write | |
| contents: read | |
| attestations: write | |
| runs-on: ${{ matrix.os }} | |
| timeout-minutes: 30 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - os: depot-ubuntu-22.04 | |
| target: x86_64-unknown-linux-gnu | |
| platform: linux | |
| arch: amd64 | |
| - os: depot-ubuntu-22.04-arm | |
| target: aarch64-unknown-linux-gnu | |
| platform: linux | |
| arch: arm64 | |
| - os: depot-ubuntu-22.04 | |
| target: x86_64-unknown-linux-musl | |
| platform: alpine | |
| arch: amd64 | |
| - os: depot-ubuntu-22.04-arm | |
| target: aarch64-unknown-linux-musl | |
| platform: alpine | |
| arch: arm64 | |
| - os: macos-14 | |
| target: x86_64-apple-darwin | |
| platform: darwin | |
| arch: amd64 | |
| - os: macos-latest | |
| target: aarch64-apple-darwin | |
| platform: darwin | |
| arch: arm64 | |
| - os: depot-windows-latest | |
| target: x86_64-pc-windows-msvc | |
| platform: win32 | |
| arch: amd64 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| persist-credentials: false | |
| - uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: ${{ matrix.target }} | |
| - name: Install musl-tools | |
| if: contains(matrix.target, 'musl') | |
| run: sudo apt-get update && sudo apt-get install -y musl-tools | |
| - name: Install cross-compilation tools | |
| if: matrix.target == 'aarch64-unknown-linux-musl' || matrix.target == 'x86_64-unknown-linux-musl' | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y musl-tools | |
| if [ "${{ matrix.target }}" = "aarch64-unknown-linux-musl" ]; then | |
| sudo apt-get install -y gcc-aarch64-linux-gnu | |
| fi | |
| - uses: Swatinem/rust-cache@v2 | |
| with: | |
| cache-on-failure: true | |
| - name: Build | |
| run: cargo build --profile dist --target ${{ matrix.target }} | |
| - name: Prepare artifact | |
| id: artifacts | |
| shell: bash | |
| run: | | |
| if [[ "${{ matrix.platform }}" == "win32" ]]; then | |
| exe=".exe" | |
| fi | |
| bin_name="foundryup_${{ matrix.platform }}_${{ matrix.arch }}${exe}" | |
| cp target/${{ matrix.target }}/dist/foundryup${exe} "$bin_name" | |
| printf 'bin_name=%s\n' "$bin_name" >> "$GITHUB_OUTPUT" | |
| printf 'attestation_file=%s\n' "foundryup_${{ matrix.platform }}_${{ matrix.arch }}.attestation.txt" >> "$GITHUB_OUTPUT" | |
| - name: Generate attestation | |
| id: attestation | |
| uses: actions/attest-build-provenance@v3 | |
| with: | |
| subject-path: ${{ steps.artifacts.outputs.bin_name }} | |
| - name: Record attestation URL | |
| env: | |
| ATTESTATION_URL: ${{ steps.attestation.outputs.attestation-url }} | |
| ATTESTATION_FILE: ${{ steps.artifacts.outputs.attestation_file }} | |
| shell: bash | |
| run: printf '%s\n' "$ATTESTATION_URL" > "$ATTESTATION_FILE" | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| name: foundryup_${{ matrix.platform }}_${{ matrix.arch }} | |
| path: | | |
| ${{ steps.artifacts.outputs.bin_name }} | |
| ${{ steps.artifacts.outputs.attestation_file }} | |
| if-no-files-found: error | |
| release: | |
| permissions: | |
| contents: write | |
| runs-on: ubuntu-latest | |
| needs: build | |
| timeout-minutes: 30 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| persist-credentials: false | |
| - name: Download artifacts | |
| uses: actions/download-artifact@v7 | |
| with: | |
| path: artifacts | |
| merge-multiple: true | |
| - name: Create release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| files: artifacts/* | |
| generate_release_notes: true |