name: Release on: push: tags: - 'v*' # NOT the release-candidate tags. Every push to `qa` stamps a # v-rc 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@v7 - 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 # release job does NOT `needs:` this job. The tag decision was already gated by # CI (ci.yml on dev, then a green qa.yml on the same commit). # # Cargo.lock is now committed (issue #15), but --locked is still omitted: on # the runner the libfreemkv dep resolves from crates.io, not the local path # patch, which --locked can't reconcile. Its # libfreemkv dep resolves from crates.io (the dev .cargo/config.toml patch is # gitignored and absent on the runner), so libfreemkv must already be published # at this version — release-orchestrate.yml enforces that ordering before tagging. test: needs: verify runs-on: ubuntu-latest steps: - uses: actions/checkout@v7 - id: msrv shell: bash run: echo "v=$(grep -m1 '^rust-version' Cargo.toml | sed -E 's/.*\"([^\"]+)\".*/\1/')" >> "$GITHUB_OUTPUT" - uses: dtolnay/rust-toolchain@master with: toolchain: ${{ steps.msrv.outputs.v }} - uses: Swatinem/rust-cache@v2 - run: cargo test # NOTE: there is no crates.io publish — keysources is `publish = false` and # git-tag-only. Consumers git-tag-pin it via a committed [patch.crates-io], so # the git tag itself is the release artifact. CI here only verifies the # version/tag match, runs tests (tripwire), and cuts the GitHub Release. release: # Only needs `verify`; the GitHub Release is cut as soon as the version # check passes, in parallel with the test tripwire. needs: verify runs-on: ubuntu-latest steps: - uses: actions/checkout@v7 - name: Create GitHub Release uses: softprops/action-gh-release@v3 with: generate_release_notes: true