release CI: parallelize test/publish/release off the critical path

Tests, crates.io publish, and the GitHub Release no longer serialize
behind each other: each job only needs the version-check (verify) gate.
Binary consumers git-tag-pin libfreemkv, so they start building the
instant the tag exists rather than waiting on the crates.io publish.
crates.io publish runs as an independent job for external consumers and
uses --no-verify (CI already compiled this commit in the test job).
This commit is contained in:
Matthew Jackson
2026-06-22 21:59:31 -07:00
parent b85744d120
commit d3c58791ff
+20 -3
View File
@@ -22,6 +22,12 @@ jobs:
fi fi
echo "Version match: $CARGO_VER" 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.86, 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: test:
needs: verify needs: verify
runs-on: ubuntu-latest runs-on: ubuntu-latest
@@ -32,19 +38,30 @@ jobs:
# would always fail (no lockfile to lock against on a fresh runner). # would always fail (no lockfile to lock against on a fresh runner).
- run: cargo test - run: cargo test
# crates.io publish is an INDEPENDENT job: it serves EXTERNAL consumers only.
# The freemkv binaries no longer depend on it (they git-tag-pin libfreemkv via
# a committed [patch.crates-io]), so this publish runs in parallel with their
# release builds rather than gating them. It only `needs: verify` (the version
# check) — NOT `test` — so publish isn't serialized behind the test suite.
publish: publish:
needs: test needs: verify
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v5 - uses: actions/checkout@v5
- uses: dtolnay/rust-toolchain@1.86.0 - uses: dtolnay/rust-toolchain@1.86.0
# --no-verify: CI already compiled this exact commit (in the `test` job
# and on every push via ci.yml). cargo publish's default re-verify does a
# full cold release build of the packaged tarball, which here is pure
# redundant work (~a cold lib build). Skip it.
- name: Publish to crates.io - name: Publish to crates.io
run: cargo publish run: cargo publish --no-verify
env: env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
release: release:
needs: test # 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 runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v5 - uses: actions/checkout@v5