Table of Contents

Release version tagging

When a build is released commit must be tagged with release version tag. Release tags are identified as tags with a friendly name that matches the release tag format. This format is used to extract the released version (<major>.<minor>.<patch>).

Tip

Semantic versioning conveys meaning about underlying code and what has been modified to those who consume releases. What is "a release" needs to target on user/consumer that will benefit from knowing if the build has breaking changes, features, or only fixes.

That user may be an internal customer (such as a testing team or other teams) or external users like the devlopment community consuming open source projects. Often marketing are focused on a product MVP and use driven naming versioning.

Product naming and versioning is often best separated from software versioning.

Default release tag format

The default release tag format is:

  v<major>.<minor>.<patch>

Or, in regular expression format:

  ^v(?<version>\d+\.\d+\.\d+)"

Default release version tag friendly name example matching:

Will match With NOT match
v1.2.3
v1.2.3 with red grapes
1.2.3
release v1.2.3
release
v1.2
For example, tag friendly names that will match this default format include:
  v1.2.3
  v1.2.3 our big beautiful pink release

Configuring the release tag format

The release tag format is configurable by setting the build property Git2SemVer_ReleaseTagFormat to a regular expressing that will match tags that have the desired friendly name.

Important

This regular expression must:

  • Contain the version placeholder text %VERSION%.
  • NOT start with the reserved prefixes: ^, tag: , or .gsm.

The default release tag format equivalent to v%VERSION%. The Git2SemVer_ReleaseTagFormat build property is set the project file or in a directory build properties file like Directory.Build.props.

For example:

<PropertyGroup>
    <Git2SemVer_ReleaseTagFormat>MyRelease %VERSION%</Git2SemVer_ReleaseTagFormat>
</PropertyGroup>

Examples:

Git2SemVer_ReleaseTagFormat Will match With NOT match
%VERSION% 1.2.3
1.2.3 with red grapes
v1.2.3
release 1.2.3
release
1.2
release: %VERSION% release: 1.2.3
release: 1.2.3 with red apples
release 1.2.3
my release: 1.2.3
.*release: %VERSION% release: 1.2.3
my release: 1.2.3
green apples release: 1.2.3
release 1.2.3