Publish stable versions from main and drop GeneratePackageOnBuild#4
Merged
Conversation
Pass -p:PublicRelease=true in the Release workflow build and pack steps so merges to main publish stable versions (e.g. 7.0.3) instead of the -g<commit> prerelease suffix Nerdbank.GitVersioning emits when it does not treat the build as a public release. The previous publish produced 7.0.2-g7efc542658, which NuGet classified as prerelease. Also remove the redundant GeneratePackageOnBuild from the five packable projects: packaging is performed explicitly by the Release workflow pack step, and GeneratePackageOnBuild additionally emitted stray Debug-config packages during ordinary builds.
Each packable project now ships a short package README (PackageReadmeFile + packed README.md), so the packages render documentation on NuGet.org and the "package is missing a readme" pack warning is resolved.
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.
Problem
The packages published on the last merge to
maincame out as7.0.2-g7efc542658— NuGet flags any-suffixversion as prerelease. That-g<commit>suffix is Nerdbank.GitVersioning's marker for a build it did not treat as a public release. Theversion.jsonconfig (publicReleaseRefs: [^refs/heads/main$]) is correct and the run was apushtomain, but nbgv's automatic public-release inference did not engage for the GitHub Actions publish.Fix
Make it deterministic: pass
-p:PublicRelease=truein the Release workflow's Build and Pack steps (the workflow only runs onmain/ manual dispatch). The next merge tomainwill publish a clean stable version (e.g.7.0.3). Verified locally:dotnet pack -p:PublicRelease=trueproduces clean7.0.2packages with no suffix.Also
Removed the redundant
GeneratePackageOnBuildfrom the five packable projects. Packaging is done explicitly by the Releasepackstep, andGeneratePackageOnBuildwas additionally emitting stray Debug-config packages during ordinary builds (visible in the last Release log asbin/x64/Debug/Z21.*.nupkg).Note
The already-published
7.0.2-g…prereleases can't be overwritten on NuGet; unlist them if desired.