Reputation: 23
I'm pretty new on all AZURE devops.
I did just the minimal install on my VS solution, nuget Gitversiontask in my solution, push to Azure Git pipeline and it worked with the development branch.
I created ( GitFLOW) a feature named dostuff. Made some changes on classes, then commit & push... Version feature/my-app 6.1.0-dostuff0001came out ...Nuget pack and push... all fine.
Then did an another commit, pipeline start but at Nuget Push to artifacts ...ERROR 409 (Conflict - The feed already contains 'my-app 6.1.0-dostuff0001).
- task: NuGetCommand@2
displayName: 'restore WinFormExtC.sln'
inputs:
restoreSolution: WinFormExtC/ActiveFramework.WinFormExtC.sln
feedsToUse: config
nugetConfigPath: NuGet/NuGet.Config
steps:
- task: VSBuild@1
displayName: 'Build solution WinFormExtC'
inputs:
solution: WinFormExtC/ActiveFramework.WinFormExtC.sln
platform: '$(BuildPlatform)'
configuration: '$(BuildConfiguration)'
steps:
- task: NuGetCommand@2
displayName: 'NuGet pack WinFormExtC'
inputs:
command: pack
packagesToPack: WinFormExtC/Package.nuspec
versioningScheme: byEnvVar
versionEnvVar: GitVersion.NuGetVersion
includeSymbols: true
Your build pipeline references an undefined variable named ‘Parameters.searchPatternPush’. Create or edit the build pipeline for this YAML file, define the variable on the Variables tab. See https://go.microsoft.com/fwlink/?linkid=865972
steps:
- task: NuGetCommand@2
displayName: 'NuGet push'
inputs:
command: push
packagesToPush: '$(Parameters.searchPatternPush)'
publishVstsFeed: '505cb4b9-0633-4d83-b4b6-1e5fc7ad020f'
Question: How can I get the my-app 6.1.0-dostuff0001 increase or change when I queue the pipeline in Azure devops and the build task increment the version of feature branch?
Please remember that I'm new to all this Build, yml, config etc. concept.
Upvotes: 1
Views: 594
Reputation: 30412
Why is my version not incrementing?
GitVersion calculates the semantic version, this will only change once per release. Read more at version increments
So, to make it incremental we can set and use a config file : GitVersion.yml. Below GitVersion.yml for your reference, it works for me when trigger from master branch.
mode: Mainline
tag-prefix: '[vV]'
commit-message-incrementing: MergeMessageOnly
branches:
feature:
regex: feature?[/-]
source-branches: ['develop']
release:
increment: Minor
regex: release?[/-]
develop:
is-mainline: true
increment: Patch
regex: develop$
master:
regex: master$
More GitVersion related info please reference the following blogs:
Upvotes: 1