Local runner for GitHub autograder
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

at main 65 lines 1.9 kB view raw
1name: Release 2on: 3 workflow_dispatch: 4 5permissions: 6 contents: write 7 id-token: write 8 attestations: write 9 10jobs: 11 release: 12 name: Release 13 runs-on: ubuntu-latest 14 steps: 15 - name: Checkout Repo 16 uses: actions/checkout@v5 17 18 - name: Rust Toolchain 19 uses: dtolnay/rust-toolchain@stable 20 with: 21 toolchain: stable 22 23 - name: Get Metadata 24 id: metadata 25 run: | 26 echo "meta=$(cargo metadata --no-deps --frozen --format-version 1)" >> $GITHUB_OUTPUT 27 28 - name: Check Tag 29 id: check-tag 30 run: | 31 echo "exists=$(git ls-remote --exit-code --tags origin ${{ env.TAG }} >/dev/null 2>&1 && echo true || echo false)" >> $GITHUB_OUTPUT 32 echo "tag=${{ env.TAG }}" >> $GITHUB_OUTPUT 33 env: 34 TAG: "v${{fromJson(steps.metadata.outputs.meta).packages[0].version}}" 35 36 - name: Block if There's a Release 37 if: ${{ steps.check-tag.outputs.exists != 'false' }} 38 run: 39 echo "::error file=Cargo.toml,title=Refusing to Release::Tag ${{ 40 steps.check-tag.outputs.tag }} already exists" && exit 1 41 42 - name: Build 43 run: | 44 cargo build --locked --release 45 46 - name: Generate artifact attestation 47 uses: actions/attest-build-provenance@v2 48 with: 49 subject-path: "target/release/gh-grader-preview" 50 51 - name: Upload Binary Artifact 52 uses: actions/upload-artifact@v4 53 with: 54 name: "gh-grader-preview" 55 path: "target/release/gh-grader-preview" 56 57 - name: Create Release 58 uses: softprops/action-gh-release@v2 59 with: 60 name: GH Grader Preview ${{ steps.check-tag.outputs.tag }} 61 tag_name: ${{ steps.check-tag.outputs.tag }} 62 generate_release_notes: false 63 draft: true 64 files: | 65 target/release/gh-grader-preview