Fail publish workflow when release tag and VERSION disagree#150
Merged
Conversation
It is too easy to push a vX.Y.Z tag and cut a release without first bumping the VERSION file. When that happens hatchling reads the stale VERSION, produces a wheel/sdist for the previous version, and the publish step tries to upload artifacts whose filenames disagree with the release the workflow was triggered by. Add a first-step guard in the build job that strips the optional v prefix off the tag and compares against cat VERSION. On mismatch it prints a workflow annotation, dumps both values, explains the usual cause, and exits non-zero before any build or upload happens.
Owner
Author
|
Considering those RPM build failures as 'release-cleanup churn'. Expect those will clean up correctly after this release is stable again. |
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.
Summary
VERSION) shows the publish flow has no guard against the most common release-time finger-slip.vprefix off the tag and compare againstcat VERSION. Fail loudly with an annotation, both values, and the standard fix recipe if they disagree.v2.1.1tag +VERSION=2.1.0→ mismatch, exit 1v2.1.0tag +VERSION=2.1.0→ ok, proceedsWhy this is the right layer
python -m build, so no wrong-versioned artifact is ever produced or uploaded.::error::annotation surfaces the failure cleanly in the GitHub Actions UI.Test plan