Add Nerdbank.GitVersioning for git-derived version numbers#24
Merged
Conversation
version.json (0.1.0-alpha.{height}) becomes the single source of truth for
the version. NBGV stamps every assembly at build time from version.json +
git height + commit hash, so the About page shows a real version for dev
and CI builds instead of the 1.0.0 compile-time fallback.
release.yml now derives the published version from `nbgv get-version`
(asserting a public release per publicReleaseRefSpec) instead of parsing the
tag string, and drops the redundant -p:Version on publish. versionHeightOffset
starts the alpha counter past the previously hand-tagged v0.1.0-alpha.1.
CONTRIBUTING documents the new `nbgv tag` release flow.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.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.
What
Implements the Nerdbank.GitVersioning (NBGV) carried-over item. The version string now maintains itself from git instead of falling back to the assembly's
1.0.0compile-time default — so the About page shows a real version for dev and CI builds, and releases derive their number from NBGV rather than the hand-typed tag.How it works
version.json(repo root) is the single source of truth: base0.1.0-alpha.{height}, where{height}is the git commit height.versionHeightOffset: 1starts the counter atalpha.2, past the previously hand-taggedv0.1.0-alpha.1, so there's no tag collision.Directory.Packages.props+ aPrivateAssets="all"reference inDirectory.Build.props) so every assembly is stamped. Verified the Core assembly now carriesAssemblyInformationalVersion = 0.1.0-alpha.2+<commit>— which is exactly whatSettingsViewModelreads for the About page.release.ymlnow installsnbgv, derives the version fromnbgv get-version(assertingPublicReleaseperpublicReleaseRefSpec), and drops the redundant-p:Versionon publish (NBGV stamps it). On a tagged public build,SemVer2is the clean0.1.0-alpha.Nfed to Velopack.Release ritual change (documented in CONTRIBUTING.md)
The tag trigger is unchanged, but you now mint the tag with NBGV so its name matches the computed version:
You no longer hand-pick the
-alpha.Ncounter — it tracks git height. For a stable cut, editversion.json(e.g.0.1.0-alpha.{height}→0.1.0), commit, thennbgv tag.Verification
nbgv get-versionpost-commit →0.1.0-alpha.2+f80913fbe3; Core assembly stamped accordingly (checked the generatedAssemblyInfo/ThisAssembly)..gitcase (NBGV degrades gracefully;TreatWarningsAsErrorsnot tripped).ci.ymlalready checks out withfetch-depth: 0, so CI computes height correctly.🤖 Generated with Claude Code