feat: Version the package with MinVer instead of a manual CI step - #10
Merged
henrikottesorensen merged 2 commits intoAug 12, 2026
Conversation
MinVer computes Version from the nearest git tag (v-prefixed, per Directory.Build.props) plus commit height, so packing by hand and CI publishing can no longer disagree, and the workflow's own "take the version from the tag" step is now unnecessary. verify-package.sh switches from -p:Version to -p:MinVerVersionOverride: MinVer recalculates and overwrites Version itself, so -p:Version was silently ignored and every verification run would have collided on the same package version - the exact bug that comment already warns about. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
The "Working on this repository" section still described the version living in the tag and a local-default <Version> in the csproj - true before this change, wrong after it now that MinVer computes Version from the tag on every build and the property is gone. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
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
Replaces the hand-maintained "take the version from the tag" CI step with MinVer, so the package version is always derived from the nearest git tag (and commit height above it) rather than a value that has to be kept in sync by hand.
Changes
Directory.Build.props(new): setsMinVerTagPrefixtov, matching this repo'sv2.2.0-style tags.Nota.CodeAnalysis.csproj: adds aPackageReferencetoMinVer(PrivateAssets="All", build-time only) and removes the hardcoded<Version>2.2.1</Version>..github/workflows/build-and-publish.yml: checkout now usesfetch-depth: 0(MinVer needs tag history to compute height), and the manual "take the version from the tag" step plus$VERSION_ARGplumbing is removed — MinVer setsVersionon every build automatically.Nota.CodeAnalysis.Verification/verify-package.sh: switches from-p:Versionto-p:MinVerVersionOverride. MinVer recalculatesVersionitself and would otherwise silently overwrite the-p:Versionoverride, causing every verification run to collide on the same package version — the exact caching bug the script's own comment already warns about.Verification
dotnet build/dotnet packon the solution succeed, and pack correctly derives2.2.1-alpha.0.1off the currentv2.2.0tag (would be exactly2.2.0if built directly on that tag).verify.sh,verify-encoding.sh, andverify-package.shall pass.