Fix tag-triggered releases: accept unprefixed tags, keep 3.2.0 reachable - #3217
Merged
Conversation
The 3.2.0 release failed its "Verify tag matches computed version" guard with "Tag '3.2.0' does not match the computed version '3.2.0-g8460293104'". Cause: publicReleaseRefSpec still carried the v2-era "^refs/tags/v\d+\.\d+". The whole v3 line tags without the "v" (3.0.0 ... 3.1.31, 3.2.0), so on a release event - where GITHUB_REF is refs/tags/3.2.0 - nbgv did not consider the build a public release and appended the "-g<commit>" suffix. This never bit us before because release.yml is new (#3213); every earlier v3 package was pushed from a main build, where the refspec did match. The stray 3.1.1-g7441909d06 on nuget.org is the same failure mode escaping under the old pipeline. Relax the refspec to "^refs/tags/v?\d+\.\d+" so both spellings are public. Because this commit adds to the commit height, drop versionHeightOffset to -3 so the release commit still computes as 3.2.0 rather than skipping to 3.2.1. versionHeightOffsetAppliesTo is already "3.2", so the height is not reset. Verified with nbgv on this commit: refs/tags/3.2.0, refs/tags/v3.2.0 and refs/heads/main all compute NuGetPackageVersion 3.2.0.
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.
The 3.2.0 release run failed its
Verify tag matches computed versionguard:Cause
version.jsonstill carried the v2-era refspec^refs/tags/v\d+\.\d+. The entire v3 line tags without thev(3.0.0…3.1.31,3.2.0), so on arelease: publishedevent — whereGITHUB_REFisrefs/tags/3.2.0— nbgv did not treat the build as a public release and appended the-g<commit>suffix. The guard then correctly refused to publish a package whose version disagreed with its release.Reproduced with nbgv against 8460293:
GITHUB_REFNuGetPackageVersionrefs/tags/3.2.03.2.0-g8460293104❌refs/tags/v3.2.03.2.0refs/heads/main3.2.0This never bit us before because
release.ymlis new (#3213); every earlier v3 package was pushed from a main build, where the refspec did match. The stray3.1.1-g7441909d06on nuget.org is the same failure mode escaping under the old MyGet pipeline.Change
^refs/tags/v?\d+\.\d+so both spellings count as a public release. The workflow guard already strips a leadingvbefore comparing, so either works end to end.versionHeightOffsetfrom-2to-3. This commit adds to the commit height, and without the compensation the release commit would compute as3.2.1and 3.2.0 would be skipped.versionHeightOffsetAppliesTois already"3.2", so the height itself is not reset.Verified with nbgv on this commit —
refs/tags/3.2.0,refs/tags/v3.2.0andrefs/heads/mainall computeNuGetPackageVersion3.2.0.Releasing after this merges
The
3.2.0tag and its GitHub release have been deleted. Tag the merge commit3.2.0and publish from there.Note that
-3is load-bearing for exactly one commit: anything that lands on main after this becomes 3.2.1, so if further commits land before the release is cut, either drop the offset again or just ship 3.2.1.