cursus-bin@0.9.3 #66
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 Artifacts | |
| on: | |
| release: | |
| types: [published] | |
| permissions: {} | |
| jobs: | |
| check-tag: | |
| name: Validate release tag | |
| runs-on: ubuntu-latest | |
| outputs: | |
| is_cursus_release: ${{ steps.check.outputs.is_cursus_release }} | |
| steps: | |
| - id: check | |
| name: Check tag format | |
| env: | |
| TAG_NAME: ${{ github.event.release.tag_name }} | |
| run: | | |
| if [[ "$TAG_NAME" =~ ^cursus@[0-9]+\.[0-9]+\.[0-9]+$ ]]; then | |
| echo "is_cursus_release=true" >> "$GITHUB_OUTPUT" | |
| else | |
| echo "is_cursus_release=false" >> "$GITHUB_OUTPUT" | |
| fi | |
| macos: | |
| name: Build macOS artifacts | |
| needs: check-tag | |
| if: needs.check-tag.outputs.is_cursus_release == 'true' | |
| runs-on: macos-latest | |
| permissions: | |
| contents: write | |
| id-token: write | |
| attestations: write | |
| defaults: | |
| run: | |
| shell: nix develop -c bash -e {0} | |
| steps: | |
| - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 | |
| - uses: DeterminateSystems/nix-installer-action@ef8a148080ab6020fd15196c2084a2eea5ff2d25 # v22 | |
| - uses: DeterminateSystems/magic-nix-cache-action@908b263ff629f4cc17666315b7fd3ec127c6244d # v14 | |
| with: | |
| use-flakehub: false | |
| - name: Build macOS artifacts | |
| run: cargo make release-macos | |
| - name: Upload artifacts | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| TAG_NAME: ${{ github.event.release.tag_name }} | |
| run: | | |
| # Necessary in order to fix a naming issue | |
| cp target/x86_64-apple-darwin/release/cursus ./cursus-osx-x86_64 | |
| cp target/aarch64-apple-darwin/release/cursus ./cursus-osx-aarch64 | |
| gh release upload "$TAG_NAME" \ | |
| "./cursus-osx-x86_64#cursus-osx-x86_64" \ | |
| "./cursus-osx-aarch64#cursus-osx-aarch64" | |
| - name: Attest macOS x86_64 | |
| id: attest_osx_x86_64 | |
| uses: actions/attest@59d89421af93a897026c735860bf21b6eb4f7b26 # v4.1.0 | |
| with: | |
| subject-path: ./cursus-osx-x86_64 | |
| - name: Attest macOS aarch64 | |
| id: attest_osx_aarch64 | |
| uses: actions/attest@59d89421af93a897026c735860bf21b6eb4f7b26 # v4.1.0 | |
| with: | |
| subject-path: ./cursus-osx-aarch64 | |
| - name: Upload attestation bundles | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| TAG_NAME: ${{ github.event.release.tag_name }} | |
| BUNDLE_X86_64: ${{ steps.attest_osx_x86_64.outputs.bundle-path }} | |
| BUNDLE_AARCH64: ${{ steps.attest_osx_aarch64.outputs.bundle-path }} | |
| run: | | |
| # actions/attest writes every bundle as `attestation.json`; the Release | |
| # asset name is taken from the basename, so rename each to match its | |
| # binary before upload (same naming fix as the binaries themselves). | |
| cp "$BUNDLE_X86_64" ./cursus-osx-x86_64.sigstore.json | |
| cp "$BUNDLE_AARCH64" ./cursus-osx-aarch64.sigstore.json | |
| gh release upload "$TAG_NAME" \ | |
| ./cursus-osx-x86_64.sigstore.json \ | |
| ./cursus-osx-aarch64.sigstore.json | |
| windows: | |
| name: Build Windows artifacts | |
| needs: check-tag | |
| if: needs.check-tag.outputs.is_cursus_release == 'true' | |
| runs-on: windows-latest | |
| permissions: | |
| contents: write | |
| id-token: write | |
| attestations: write | |
| env: | |
| RUSTFLAGS: "-C target-feature=+crt-static" | |
| steps: | |
| - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 | |
| - name: Install Rust nightly | |
| uses: dtolnay/rust-toolchain@3c5f7ea28cd621ae0bf5283f0e981fb97b8a7af9 # master | |
| with: | |
| toolchain: nightly | |
| targets: x86_64-pc-windows-msvc,aarch64-pc-windows-msvc | |
| - name: Build Windows artifacts | |
| run: | | |
| cargo build --release -p cursus-bin --target x86_64-pc-windows-msvc | |
| cargo build --release -p cursus-bin --target aarch64-pc-windows-msvc | |
| - name: Upload artifacts | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| TAG_NAME: ${{ github.event.release.tag_name }} | |
| shell: bash | |
| run: | | |
| # Necessary in order to fix a naming issue | |
| cp target/x86_64-pc-windows-msvc/release/cursus.exe ./cursus-windows-x86_64.exe | |
| cp target/aarch64-pc-windows-msvc/release/cursus.exe ./cursus-windows-aarch64.exe | |
| gh release upload "$TAG_NAME" \ | |
| "./cursus-windows-x86_64.exe#cursus-windows-x86_64.exe" \ | |
| "./cursus-windows-aarch64.exe#cursus-windows-aarch64.exe" | |
| - name: Attest Windows x86_64 | |
| id: attest_windows_x86_64 | |
| uses: actions/attest@59d89421af93a897026c735860bf21b6eb4f7b26 # v4.1.0 | |
| with: | |
| subject-path: ./cursus-windows-x86_64.exe | |
| - name: Attest Windows aarch64 | |
| id: attest_windows_aarch64 | |
| uses: actions/attest@59d89421af93a897026c735860bf21b6eb4f7b26 # v4.1.0 | |
| with: | |
| subject-path: ./cursus-windows-aarch64.exe | |
| - name: Upload attestation bundles | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| TAG_NAME: ${{ github.event.release.tag_name }} | |
| BUNDLE_X86_64: ${{ steps.attest_windows_x86_64.outputs.bundle-path }} | |
| BUNDLE_AARCH64: ${{ steps.attest_windows_aarch64.outputs.bundle-path }} | |
| shell: bash | |
| run: | | |
| # actions/attest writes every bundle as `attestation.json`; the Release | |
| # asset name is taken from the basename, so rename each to match its | |
| # binary before upload (same naming fix as the binaries themselves). | |
| cp "$BUNDLE_X86_64" ./cursus-windows-x86_64.exe.sigstore.json | |
| cp "$BUNDLE_AARCH64" ./cursus-windows-aarch64.exe.sigstore.json | |
| gh release upload "$TAG_NAME" \ | |
| ./cursus-windows-x86_64.exe.sigstore.json \ | |
| ./cursus-windows-aarch64.exe.sigstore.json | |
| linux: | |
| name: Build Linux artifacts | |
| needs: check-tag | |
| if: needs.check-tag.outputs.is_cursus_release == 'true' | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| id-token: write | |
| attestations: write | |
| defaults: | |
| run: | |
| shell: nix develop -c bash -e {0} | |
| steps: | |
| - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 | |
| - uses: DeterminateSystems/nix-installer-action@ef8a148080ab6020fd15196c2084a2eea5ff2d25 # v22 | |
| - uses: DeterminateSystems/magic-nix-cache-action@908b263ff629f4cc17666315b7fd3ec127c6244d # v14 | |
| with: | |
| use-flakehub: false | |
| - name: Build Linux artifacts | |
| run: cargo make release-linux | |
| - name: Upload artifacts | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| TAG_NAME: ${{ github.event.release.tag_name }} | |
| run: | | |
| cp target/x86_64-unknown-linux-musl/release/cursus ./cursus-linux-x86_64 | |
| cp target/aarch64-unknown-linux-musl/release/cursus ./cursus-linux-aarch64 | |
| cp target/riscv64gc-unknown-linux-musl/release/cursus ./cursus-linux-riscv64gc | |
| gh release upload "$TAG_NAME" \ | |
| "./cursus-linux-x86_64#cursus-linux-x86_64" \ | |
| "./cursus-linux-aarch64#cursus-linux-aarch64" \ | |
| "./cursus-linux-riscv64gc#cursus-linux-riscv64gc" | |
| - name: Attest Linux x86_64 | |
| id: attest_linux_x86_64 | |
| uses: actions/attest@59d89421af93a897026c735860bf21b6eb4f7b26 # v4.1.0 | |
| with: | |
| subject-path: ./cursus-linux-x86_64 | |
| - name: Attest Linux aarch64 | |
| id: attest_linux_aarch64 | |
| uses: actions/attest@59d89421af93a897026c735860bf21b6eb4f7b26 # v4.1.0 | |
| with: | |
| subject-path: ./cursus-linux-aarch64 | |
| - name: Attest Linux riscv64 | |
| id: attest_linux_riscv64 | |
| uses: actions/attest@59d89421af93a897026c735860bf21b6eb4f7b26 # v4.1.0 | |
| with: | |
| subject-path: ./cursus-linux-riscv64gc | |
| - name: Upload attestation bundles | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| TAG_NAME: ${{ github.event.release.tag_name }} | |
| BUNDLE_X86_64: ${{ steps.attest_linux_x86_64.outputs.bundle-path }} | |
| BUNDLE_AARCH64: ${{ steps.attest_linux_aarch64.outputs.bundle-path }} | |
| BUNDLE_RISCV64: ${{ steps.attest_linux_riscv64.outputs.bundle-path }} | |
| run: | | |
| # actions/attest writes every bundle as `attestation.json`; the Release | |
| # asset name is taken from the basename, so rename each to match its | |
| # binary before upload (same naming fix as the binaries themselves). | |
| cp "$BUNDLE_X86_64" ./cursus-linux-x86_64.sigstore.json | |
| cp "$BUNDLE_AARCH64" ./cursus-linux-aarch64.sigstore.json | |
| cp "$BUNDLE_RISCV64" ./cursus-linux-riscv64gc.sigstore.json | |
| gh release upload "$TAG_NAME" \ | |
| ./cursus-linux-x86_64.sigstore.json \ | |
| ./cursus-linux-aarch64.sigstore.json \ | |
| ./cursus-linux-riscv64gc.sigstore.json |