Repository navigation
build(release): publish tagged releases and embed the source revision… - #10
Merged
Merged
Conversation
… in --version
`cargo xtask release X.Y.Z` bumps `[workspace.package] version` (every crate
inherits it), refreshes `Cargo.lock`, commits `chore(release): vX.Y.Z`, and
creates the annotated tag. It refuses a dirty worktree, a non-increasing or
non-`MAJOR.MINOR.PATCH` version, and an existing tag; `--no-commit` stops
after the bump. Nothing is pushed.
Pushing the tag runs `.github/workflows/release.yml`: verify the tag equals
the manifest version (a hand-made tag on the wrong commit fails fast), build
`qq` natively on five runners (x86_64/aarch64 linux-musl static, aarch64 and
x86_64 macOS, x86_64 Windows), check `qq --version` prints exactly
`qq X.Y.Z (<sha> <date>)`, package with LICENSE/README and a checksum, then
publish one GitHub release with the archives, a combined SHA256SUMS, and
auto-generated notes from PR titles.
`build.rs` embeds the short SHA and commit date (`-dirty` when modified) into
`qq --version`; Cargo reruns it when HEAD moves. `QQ_GIT_SHA`/`QQ_GIT_DATE`
override the lookup for tarball builds and the workflow, and a build never
fails on revision lookup (`unknown` fallback).
Tests: `cli::tests::version_names_the_crate_version_and_the_source_revision`;
`release::tests::{parses_plain_semver_only,
bumps_only_the_workspace_package_version,
rejects_a_manifest_without_a_workspace_version, real_manifest_round_trips}`.
The full release flow was exercised in a scratch clone (dirty, bad version,
existing tag, real bump 0.1.0 -> 0.2.0 -> 0.2.1 --no-commit). A local
`x86_64-unknown-linux-musl --locked` release build produced the expected
version line.
Runbook: docs/runbooks/release.md.
This was referenced Sep 26, 2026
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
… in --version
cargo xtask release X.Y.Zbumps[workspace.package] version(every crate inherits it), refreshesCargo.lock, commitschore(release): vX.Y.Z, and creates the annotated tag. It refuses a dirty worktree, a non-increasing or non-MAJOR.MINOR.PATCHversion, and an existing tag;--no-commitstops after the bump. Nothing is pushed.Pushing the tag runs
.github/workflows/release.yml: verify the tag equals the manifest version (a hand-made tag on the wrong commit fails fast), buildqqnatively on five runners (x86_64/aarch64 linux-musl static, aarch64 and x86_64 macOS, x86_64 Windows), checkqq --versionprints exactlyqq X.Y.Z (<sha> <date>), package with LICENSE/README and a checksum, then publish one GitHub release with the archives, a combined SHA256SUMS, and auto-generated notes from PR titles.build.rsembeds the short SHA and commit date (-dirtywhen modified) intoqq --version; Cargo reruns it when HEAD moves.QQ_GIT_SHA/QQ_GIT_DATEoverride the lookup for tarball builds and the workflow, and a build never fails on revision lookup (unknownfallback).Tests:
cli::tests::version_names_the_crate_version_and_the_source_revision;release::tests::{parses_plain_semver_only, bumps_only_the_workspace_package_version, rejects_a_manifest_without_a_workspace_version, real_manifest_round_trips}. The full release flow was exercised in a scratch clone (dirty, bad version, existing tag, real bump 0.1.0 -> 0.2.0 -> 0.2.1 --no-commit). A localx86_64-unknown-linux-musl --lockedrelease build produced the expected version line.Runbook: docs/runbooks/release.md.