When using gitversion (the latest, v6.*) in a github action, is the SemVer supposed to increase by 1 at the end each commit? I thought it was from what I was reading, but I never see it happen. for example, here's the gitversion output for a branch (left out some of the values):
{
"BranchName": "ActionsFeaturesBranchTestV2",
"BuildMetaData": 3,
"CommitsSinceVersionSource": 3,
"FullSemVer": "1.0.0-ActionsFeaturesBranchTestV2.1+3",
"PreReleaseLabel": "ActionsFeaturesBranchTestV2",
"PreReleaseNumber": 1,
"SemVer": "1.0.0-ActionsFeaturesBranchTestV2.1",
"WeightedPreReleaseNumber": 1
}
The SemVer has the .1 at the end. When I do another commit (or rather push, the action only runs on a push), I expected the .1 to go to .2 but it never happens. The BuildMetaData and CommitsSinceVersionSource increment fine. Here's after another commit/push:
{
"BranchName": "ActionsFeaturesBranchTestV2",
"BuildMetaData": 4,
"CommitsSinceVersionSource": 4,
"FullSemVer": "1.0.0-ActionsFeaturesBranchTestV2.1+4",
"PreReleaseLabel": "ActionsFeaturesBranchTestV2",
"PreReleaseNumber": 1,
"SemVer": "1.0.0-ActionsFeaturesBranchTestV2.1",
"WeightedPreReleaseNumber": 1
}
I believe my branch falls under the "unknown" section of the gitversion.yml config. The default config per gitversion's website for this is:
unknown:
mode: ManualDeployment
label: '{BranchName}'
increment: Inherit
prevent-increment:
when-current-commit-tagged: false
track-merge-message: false
regex: (?<BranchName>.+)
source-branches:
- main
- release
- feature
- pull-request
is-source-branch-for: []
is-main-branch: false
Is there a certain setting I have to use? Or am I misunderstanding what that .1 is used for? The reason I need that number is that each push needs to produce a unique build version for a nuget package. I know I could just combine a few of the outputs to get what I want, but I'd like to understand why isn't working as is.