Skip to content

Stamp your assemblies, packages and more with a unique version generated from a single, simple version.json file and include git commit IDs for non-official builds.

License

Notifications You must be signed in to change notification settings

dotnet/Nerdbank.GitVersioning

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Nerdbank.GitVersioning

🏭 Build NuGet package NuGet downloads NPM package Join the chat at https://gitter.im/AArnott/Nerdbank.GitVersioning

Stamp your assemblies, packages and more with a unique version generated from a single, simple version.json file and include git commit IDs for non-official builds.

Features

  • Ensure unique versions generated for every git commit that conform to semantic versioning.
  • Optional CLI tool calculates versions and backtracks from a computed version to its source git commit.
  • MSBuild and NPM integration to automatically stamp various packaging and executables with the computed version. MSBuild integration includes ThisAssembly class generation that provides your code with runtime access to all kinds of version information, strong name keys, etc.
  • Gives you control over the base version number, placement for the git 'height' incrementing integer, and the prerelease label identifiers via a version.json file.
  • Update cloud build names with version number for easy correlation.
  • Cross platform. Runs everywhere .NET runs.

Overview

This package adds precise, semver-compatible git commit information to every assembly, VSIX, NuGet and NPM package, and more. It implicitly supports all cloud build services and CI server software because it simply uses git itself and integrates naturally in MSBuild, gulp and other build scripts.

What sets this package apart from other git-based versioning projects is:

  1. Prioritize absolute build reproducibility. Every single commit can be built and produce a unique version.
  2. No dependency on tags. Tags can be added to existing commits at any time. Clones may not fetch tags. No dependency on tags means better build reproducibility.
  3. No dependency on branch names. Branches come and go, and a commit may belong to any number of branches. Regardless of the branch HEAD may be attached to, the build should be identical.
  4. The computed version information is based on an author-defined major.minor version and an optional unstable tag, plus a shortened git commit ID.
  5. This project is supported by the .NET Foundation.

Check out our getting started documentation.

Code of Conduct

This project has adopted the code of conduct defined by the Contributor Covenant to clarify expected behavior in our community. For more information see the .NET Foundation Code of Conduct.