3

I'm using Azure pipelines to set a version number using GitVersion. Here is the pipeline:

    - task: gitversion/setup@0
      displayName: 'Setup GitVersion'
      inputs:
        versionSpec: '5.x'
    
    - task: gitversion/execute@0
      displayName: 'Run GitVersion'
      inputs:
        useConfigFile: true
        configFilePath: 'GitVersion.yml'

It seems to run without any problems but the patch number is never incremented. It doesn't work when I add +semver: patch to the commit message either.

It seems the FullSemVer is affected: 0.8.0+11
But I'm expecting: 0.8.11

Here is the GitVersion.yml file

next-version: 0.7.0
assembly-versioning-scheme: MajorMinorPatch
assembly-file-versioning-scheme: MajorMinorPatchTag
assembly-informational-format: '{InformationalVersion}'
mode: ContinuousDelivery
increment: Patch
continuous-delivery-fallback-tag: ci
tag-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)'
legacy-semver-padding: 4
build-metadata-padding: 4
commits-since-version-source-padding: 4
commit-message-incrementing: Enabled
commit-date-format: 'yyyy-MM-dd'
ignore:
  sha: []
merge-message-formats: {}

Thanks for any help.

2
  • Hi @KevinLu-MSFT. Apologies for the slow reply. I haven't had a chance to test it yet as a step in the same pipeline previous to this one has stopped working! (different problem) I'll update the answer as soon as I've had a go. Thanks Commented Mar 3, 2021 at 9:51
  • Thanks for your update. Feel free to let me know if it could help. Commented Mar 3, 2021 at 9:52

1 Answer 1

7

It seems the FullSemVer is affected: 0.8.0+11

When I use the ContinuousDelivery mode, I could get the same result.

You could try to use the mainline mode in yml file.

Here is my example: You could try to remove the next-version parameter

mode: mainline
tag-prefix: '[vV]'
commit-message-incrementing: Enabled
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)'
assembly-informational-format: '{Major}.{Minor}.{Patch}' 

Here is a doc about Gitversion Mainline mode.

Result:

enter image description here

The patch will auto incremente

Sign up to request clarification or add additional context in comments.

1 Comment

Cheers, looks like it was the mainline bit I had wrong

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.