Stamp your assemblies and NuGet packages with a version from a single, simple version.json file and include git commit IDs for internal builds.
dependabot[bot] on npm_and_yarn
dependabot[bot] on npm_and_yarn
Bump typescript from 4.8.2 to 4… (compare)
AArnott on main
Add tag name option Use tag name format Move tag name option to release… and 2 more (compare)
nbgv
CLI tool.
version.json
file that sets the version to 1.2.3-alpha
and your stable branch set to 1.2.2
(or whatever you most recent stable version was). When your 1.2.3 development branch becomes stable, you remove the -alpha
suffix from the version.json
file for that branch. Does that help?
v1.0
and a main
branch where I'm developing 1.1-alpha, then I may want the v1.0
branch to periodically merge into main
so that v1.1 will release with all the same fixes that v1.0 had. Nerdbank.GitVersioning works naturally with this because main
will have the most recent change to version.json
so a merge from v1.0
will not touch version.json, leaving both branches building the version they mean to.1.2.3-alpha
branch merges into a 1.2.3
branch. What becomes of the source branch at that point? Does it remain 1.2.3-alpha
or does it advance to 1.2.4
? And was the target branch 1.2.3
before and after the merge?
develop
's merge to main
that the team of devs working in develop
would have to 'slow down' and not destabilize the branch. The way I and teams around me have done it is work never slows in the primary dev branch, and stabilization happens after branching off, which gives a fine opportunity to change the version.json file. In fact this is so common we have the nbgv prepare-release
command which automates branching off for stabilization that automatically trims the -prerelease
tag on the servicing branch and advances the unstable version from 1.2.3 to 1.2.4 or whatever the policy is that you set in version.config.main
and develop
have conflicting changes for version.json, your gitattributes file could allow git merge to work without conflicts and just leave the copy in the target branch alone.AfterTargets="GetBuildVersion"
attribute, you can review and edit any of the many msbuild properties that NB.GV sets. You could consider the active branch name (BuildingRef
) property and remove the -prerelease tag from the version when the branch being built is main
.
GitVersionBaseDirectory
property (or environment variable) to specify where to look for the version.json file. So you could have two version files, in two different directories, and have a github action in your workflow set the GitVersionBaseDirectory
env var based on the branch being built to achieve what you want.path
property is documented as a root below the config file, or do I misunderstand the usage and it could be a config file? I'm not using MSBuild, I'm using the github actions workflow and I'm using dotnet publish, see https://github.com/ptr727/PlexCleaner/blob/develop/.github/workflows/BuildPublishPipeline.yml
/p:PublicRelease=true
.
-prerelease
tag, but not the minor version.GetBuildVersion
. A bunch of msbuild properties are set by that target and you can read them and rearrange them all you want.
nbgv get-commits
and nbgv get-version
commands will no longer work for you.
{
"$schema": "https://raw.githubusercontent.com/dotnet/Nerdbank.GitVersioning/master/src/NerdBank.GitVersioning/version.schema.json",
"version": "1.0",
"publicReleaseRefSpec": [
"^refs/heads/master$",
"^refs/heads/v\\d+(?:\\.\\d+)?$"
],
"cloudBuild": {
"buildNumber": {
"enabled": true
}
}
}
-beta
without your asking for it. The only place in code where beta
even appears that I could find in the repo is in the nbgv tool and is used as a default value when creating your version.json file.-beta
suffix from your version.json file? Have you committed that change? Nearly any change to version.json must be committed to take effect (note that the commit does not have to be pushed).