Commit 0f94614
committed
Fail publish workflow when release tag and VERSION file disagree
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.1 parent b699ba6 commit 0f94614
1 file changed
Lines changed: 16 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
16 | 32 | | |
17 | 33 | | |
18 | 34 | | |
| |||
0 commit comments