ci: guard release tag against Cargo.toml version (+ bump to 2.1.1) - #22
Merged
Merged
Conversation
Adds a verify-version job to release.yml that gates the build: if a pushed vX.Y.Z tag does not match the [package] version in Cargo.toml, the release fails before building instead of publishing a mislabeled artifact. This is exactly the failure that shipped v2.1.1 as an internally-2.1.0 binary. Also reconciles the existing drift by bumping Cargo.toml (and Cargo.lock) from 2.1.0 to 2.1.1 to match the already-published v2.1.1 tag.
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.
What
Fixes the version-drift problem behind the v2.1.1 release.
Root cause:
release.ymltriggers on tag push and builds whatever commit the tag points at. v2.1.1 was tagged from the webui on a commit whoseCargo.tomlstill said2.1.0, so the published binary reports2.1.0from--versionand the About dialog. The draft-release safeguard caught bad binaries, not a wrong version string.Changes
verify-versionjob inrelease.ymlthat gates the build. It strips thevfrom the pushed tag and compares against the[package]version inCargo.toml. Mismatch = the release fails before building, with a clear error telling you to bump Cargo.toml. A desynced release becomes impossible to publish.Cargo.toml+Cargo.lock2.1.0 -> 2.1.1 to reconcile the current drift with the already-publishedv2.1.1tag.Verification (local, full CI gate)
cargo fmt --all -- --checkcleancargo clippy --all-targets -- -D warningscleancargo test --locked5 passedNotes
The in-app update checker (item 1 from the ticket) lands as a separate PR. An optional auto-tag-on-merge workflow (fully eliminate manual tagging) can follow if you want it.