Every push to qa now tags v<version>-rc<N>, N incrementing, before the gates run. That answers "which build is on qa, and is it the one I tested?" without anyone having to remember it. The tag lands whether the run goes green or red, deliberately. A red candidate needs a name more than a green one does: "rc3 failed release-tests on windows" is a sentence you can act on, "qa is red" is not. Red on qa is the gate doing its job — the branch saying this is not production worth yet. release.yml now excludes v*-rc*. Its trigger was v*, which matches the candidate tags, so without this every push to qa would have built and PUBLISHED a GitHub release — including for the candidates that failed.
64 lines
2.3 KiB
YAML
64 lines
2.3 KiB
YAML
name: Release
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- 'v*'
|
|
# NOT the release-candidate tags. Every push to `qa` stamps a
|
|
# v<version>-rc<N> so a run can be named, and 'v*' matches those too —
|
|
# which would have this workflow build and PUBLISH a GitHub release for
|
|
# every candidate, including the red ones.
|
|
- '!v*-rc*'
|
|
|
|
permissions:
|
|
contents: write
|
|
|
|
jobs:
|
|
verify:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v5
|
|
- name: Verify Cargo.toml version matches tag
|
|
run: |
|
|
CARGO_VER="v$(grep '^version' Cargo.toml | head -1 | sed 's/.*"\(.*\)"/\1/')"
|
|
if [ "$CARGO_VER" != "${{ github.ref_name }}" ]; then
|
|
echo "::error::Cargo.toml says $CARGO_VER but tag is ${{ github.ref_name }}"
|
|
exit 1
|
|
fi
|
|
echo "Version match: $CARGO_VER"
|
|
|
|
# Tests run as a PARALLEL TRIPWIRE: they fail the run if they fail, but the
|
|
# publish/release jobs do NOT `needs:` this job. The tag decision was already
|
|
# gated by the local precommit (same Rust 1.97, same commit). Binary consumers
|
|
# (freemkv/autorip/bdemu) git-tag-pin libfreemkv and therefore start building
|
|
# the instant this tag exists — so this test job and the crates.io publish
|
|
# below must NOT sit on their critical path.
|
|
test:
|
|
needs: verify
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v5
|
|
- uses: dtolnay/rust-toolchain@1.97.0
|
|
- uses: Swatinem/rust-cache@v2
|
|
# libfreemkv is a library — Cargo.lock isn't tracked, so --locked
|
|
# would always fail (no lockfile to lock against on a fresh runner).
|
|
- run: cargo test
|
|
|
|
# NOTE: there is no crates.io publish job. libfreemkv is git-tag-only
|
|
# (`package.publish = false` — it git-deps the firmware crate freemkv-unlock,
|
|
# which never ships to crates.io). Every consumer git-tag-pins libfreemkv via
|
|
# a committed [patch.crates-io]; the git tag itself IS the release artifact.
|
|
# A `cargo publish` here fails hard on `publish = false`, so it was removed.
|
|
|
|
release:
|
|
# Only needs `verify`; the GitHub Release can be cut as soon as the version
|
|
# check passes, in parallel with test + publish.
|
|
needs: verify
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v5
|
|
- name: Create GitHub Release
|
|
uses: softprops/action-gh-release@v2
|
|
with:
|
|
generate_release_notes: true
|