Skip to content

build(release): publish tagged releases and embed the source revision… - #10

Merged
lg2m merged 1 commit into
mainfrom
build/release-workflow
Sep 10, 2026
Merged

lg2m merged 1 commit into
mainfrom
build/release-workflow

Conversation

@lg2m

@lg2m lg2m commented Sep 10, 2026

Copy link
Copy Markdown
Collaborator

… 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.

… 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.
@lg2m
lg2m merged commit 6cd12fb into main Sep 10, 2026
3 checks passed
@lg2m
lg2m deleted the build/release-workflow branch September 10, 2026 00:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant