-
Notifications
You must be signed in to change notification settings - Fork 663
Description
Describe the bug
Afte rfinally getting gitversion working, I am ending up with version tags that look like "SemVer": "0.0.0-0-6-preview.1" - which by all accounts is not a valid semver.
Expected Behavior
0.6-preview.1 as generated semver
Actual Behavior
0.0.0-0-6-preview.1
Possible Fix
No idea
Steps to Reproduce
The following is my gitversion:
assembly-versioning-scheme: MajorMinorPatch
assembly-file-versioning-scheme: MajorMinorPatch
mode: ContinuousDelivery
label-prefix: '[vV]'
major-version-bump-message: '+semver:\s?(breaking|major)'
minor-version-bump-message: '+semver:\s?(feature|minor)'
patch-version-bump-message: '+semver:\s?(fix|patch)'
no-bump-message: '+semver:\s?(none|skip)'
label-pre-release-weight: 60000
commit-message-incrementing: Enabled
branches:
develop:
mode: ContinuousDeployment
label: 'ci'
increment: None
prevent-increment-of-merged-branch-version: false
track-merge-target: true
regex: ^dev[/-]
source-branches: []
tracks-release-branches: true
is-release-branch: false
is-mainline: false
pre-release-weight: 0
main:
label: 'dev'
increment: Patch
prevent-increment-of-merged-branch-version: true
track-merge-target: true
regex: ^main$
source-branches:
- develop
- feature
tracks-release-branches: false
is-release-branch: false
is-mainline: true
pre-release-weight: 55000
release:
label: useBranchName
increment: None
prevent-increment-of-merged-branch-version: true
track-merge-target: false
regex: ^rel[/-]
source-branches:
- develop
- main
- support
- release
tracks-release-branches: false
is-release-branch: true
is-mainline: false
pre-release-weight: 30000
feature:
label: useBranchName
increment: Inherit
prevent-increment-of-merged-branch-version: false
track-merge-target: false
regex: ^ftr[/-]
source-branches:
- develop
- main
- release
- feature
- support
- hotfix
tracks-release-branches: false
is-release-branch: false
is-mainline: false
pre-release-weight: 30000
pull-request:
label: 'pr'
increment: Inherit
prevent-increment-of-merged-branch-version: false
label-number-pattern: '/-'
track-merge-target: false
regex: ^req[/-]
source-branches:
- develop
- main
- release
- feature
- support
- hotfix
tracks-release-branches: false
is-release-branch: false
is-mainline: false
pre-release-weight: 30000
hotfix:
label: 'fix'
increment: Patch
prevent-increment-of-merged-branch-version: false
track-merge-target: false
regex: ^fix[/-]
source-branches:
- develop
- main
- support
tracks-release-branches: false
is-release-branch: false
is-mainline: false
pre-release-weight: 30000
support:
label: 'bug'
increment: Patch
prevent-increment-of-merged-branch-version: true
track-merge-target: false
regex: ^bug[/-]
source-branches:
- main
tracks-release-branches: false
is-release-branch: false
is-mainline: true
pre-release-weight: 55000
ignore:
sha: []
commit-date-format: yyyy-MM-dd
merge-message-formats: {}
update-build-number: true
The Azure Devops looks like:
Starting: GitVersion Execute
Task : Execute GitVersion Task
Description : Easy Semantic Versioning (http://semver.org/) for projects using Git
Version : 0.10.2
Author : GitTools Contributors
Help : See the documentation for help
Agent: 'Azure Pipelines'
Command: dotnet-gitversion D:/a/1/Repository /output json /output buildserver /config D:\a\1\s\pipelines\common\gitversion.yml /verbosity Diagnostic
C:\hostedtoolcache\windows\GitVersion.Tool\6.0.0-beta.2\x64\dotnet-gitversion.exe D:/a/1/Repository /output json /output buildserver /config D:\a\1\s\pipelines\common\gitversion.yml /verbosity Diagnostic
INFO [06/23/23 18:23:08:10] Working directory: D:/a/1/Repository
INFO [06/23/23 18:23:08:11] Project root is: D:\a\1\Repository
INFO [06/23/23 18:23:08:11] DotGit directory is: D:\a\1\Repository.git
INFO [06/23/23 18:23:08:11] Branch from build environment: refs/heads/rel/0.6-preview
INFO [06/23/23 18:23:08:11] Begin: Normalizing git directory for branch 'refs/heads/rel/0.6-preview'
INFO [06/23/23 18:23:08:14] One remote found (origin -> 'https://[email protected]/nettecture/Sandbox/_git/GitVersion').
INFO [06/23/23 18:23:08:14] Skipping fetching, if GitVersion does not calculate your version as expected you might need to allow fetching or use dynamic repositories
INFO [06/23/23 18:23:08:15] Creating local branch rel/0.6-preview
INFO [06/23/23 18:23:08:19] Creating local branch from remote tracking 'refs/remotes/origin/develop'.
INFO [06/23/23 18:23:08:20] Creating local branch from remote tracking 'refs/remotes/origin/main'.
INFO [06/23/23 18:23:08:21] Creating local branch from remote tracking 'refs/remotes/origin/release/0.2'.
INFO [06/23/23 18:23:08:21] Creating local branch from remote tracking 'refs/remotes/origin/release/0.3-preview'.
INFO [06/23/23 18:23:08:21] Creating local branch from remote tracking 'refs/remotes/origin/release/0.4-preview'.
INFO [06/23/23 18:23:08:21] Creating local branch from remote tracking 'refs/remotes/origin/release/0.5-preview'.
INFO [06/23/23 18:23:08:22] HEAD points at branch 'refs/heads/rel/0.6-preview'.
INFO [06/23/23 18:23:08:22] End: Normalizing git directory for branch 'refs/heads/rel/0.6-preview' (Took: 113.41ms)
INFO [06/23/23 18:23:08:23] Begin: Loading version variables from disk cache
INFO [06/23/23 18:23:08:23] Cache file D:\a\1\Repository.git\gitversion_cache\9AC7CFCF791E396601AA1631E2668E04AB1D5279.yml not found.
INFO [06/23/23 18:23:08:23] End: Loading version variables from disk cache (Took: 0.56ms)
INFO [06/23/23 18:23:08:23] Using latest commit on specified branch
INFO [06/23/23 18:23:08:45] Running against branch: rel/0.6-preview (54e392a WIP)
INFO [06/23/23 18:23:08:45] Begin: Calculating the base versions
INFO [06/23/23 18:23:08:47] Begin: Getting tagged semantic versions. LabelPrefix: [vV] and Format: Strict
INFO [06/23/23 18:23:08:47] End: Getting tagged semantic versions. LabelPrefix: [vV] and Format: Strict (Took: 1.60ms)
INFO [06/23/23 18:23:08:48] Using current branch name to calculate version tag
INFO [06/23/23 18:23:08:50] Base version used: Fallback base version: 0.0.0 with commit count source External Source
INFO [06/23/23 18:23:08:50] End: Calculating the base versions (Took: 55.69ms)
INFO [06/23/23 18:23:08:51] Begin: Using manual deployment workflow to calculate the incremented version.
INFO [06/23/23 18:23:08:51] Begin: Getting tagged semantic versions from 'refs/heads/rel/0.6-preview'. LabelPrefix: [vV] and Format: Strict
DEBUG [06/23/23 18:23:08:51] Returning cached tagged semantic versions. LabelPrefix: [vV] and Format: Strict
INFO [06/23/23 18:23:08:51] End: Getting tagged semantic versions from 'refs/heads/rel/0.6-preview'. LabelPrefix: [vV] and Format: Strict (Took: 1.46ms)
INFO [06/23/23 18:23:08:51] 38 commits found between and 54e392a WIP
INFO [06/23/23 18:23:08:51] End: Using manual deployment workflow to calculate the incremented version. (Took: 5.07ms)
INFO [06/23/23 18:23:08:51] Begin: Creating dictionary
INFO [06/23/23 18:23:08:52] End: Creating dictionary (Took: 0.93ms)
INFO [06/23/23 18:23:08:52] Begin: Storing version variables to cache file D:\a\1\Repository.git\gitversion_cache\9AC7CFCF791E396601AA1631E2668E04AB1D5279.yml
INFO [06/23/23 18:23:08:52] End: Storing version variables to cache file D:\a\1\Repository.git\gitversion_cache\9AC7CFCF791E396601AA1631E2668E04AB1D5279.yml (Took: 0.99ms)
Executing GenerateSetVersionMessage for 'AzurePipelines'.
Executing GenerateBuildLogOutput for 'AzurePipelines'.
{
"AssemblySemFileVer": "0.0.0.0",
"AssemblySemVer": "0.0.0.0",
"BranchName": "rel/0.6-preview",
"BuildMetaData": 38,
"CommitDate": "2023-06-23",
"CommitsSinceVersionSource": 38,
"EscapedBranchName": "rel-0-6-preview",
"FullBuildMetaData": "38.Branch.rel-0.6-preview.Sha.54e392a30581905fd3d026a6aac2e2c69fd35d21",
"FullSemVer": "0.0.0-0-6-preview.1+38",
"InformationalVersion": "0.0.0-0-6-preview.1+38.Branch.rel-0.6-preview.Sha.54e392a30581905fd3d026a6aac2e2c69fd35d21",
"Major": 0,
"MajorMinorPatch": "0.0.0",
"Minor": 0,
"Patch": 0,
"PreReleaseLabel": "0-6-preview",
"PreReleaseLabelWithDash": "-0-6-preview",
"PreReleaseNumber": 1,
"PreReleaseTag": "0-6-preview.1",
"PreReleaseTagWithDash": "-0-6-preview.1",
"SemVer": "0.0.0-0-6-preview.1",
"Sha": "54e392a30581905fd3d026a6aac2e2c69fd35d21",
"ShortSha": "54e392a",
"UncommittedChanges": 0,
"VersionSourceSha": "",
"WeightedPreReleaseNumber": 30001
}
INFO [06/23/23 18:23:08:96] Done writing
Async Command Start: Update Build Number
Update build number to 0.0.0-0-6-preview.1+38 for build 757
Async Command End: Update Build Number
Finishing: GitVersion Execute
Context
Your Environment
Azure Devops. This is a dummy project for setting up gitversion.
Installed version:
Starting: GitVersion Setup
Task : Setup GitVersion Task
Description : Easy Semantic Versioning (http://semver.org/) for projects using Git
Version : 0.10.2
Author : GitTools Contributors
Help : See the documentation for help
Agent: 'Azure Pipelines'
Acquiring GitVersion.Tool version spec: 6.x
Command: dotnet tool install GitVersion.Tool --tool-path D:\a_temp --version 6.0.0-beta.2
"C:\Program Files\dotnet\dotnet.exe" tool install GitVersion.Tool --tool-path D:\a_temp --version 6.0.0-beta.2
You can invoke the tool using the following command: dotnet-gitversion
Tool 'gitversion.tool' (version '6.0.0-beta.2') was successfully installed.
Caching tool: GitVersion.Tool 6.0.0-beta.2 x64
GitVersion.Tool version: 6.0.0-beta.2 installed.
Prepending PATH environment variable with directory: C:\hostedtoolcache\windows\GitVersion.Tool\6.0.0-beta.2\x64
Finishing: GitVersion Setup