2
votes

I am implementing a CI process on TFS. I would like to use semantic versioning and semantic versioning should be incremented automatically. Also, I would like to use descriptors like “CI”, “beta”, and “release”.

It seems GitVersion is a suitable tool for this purpose. But as far as understood, especially descriptors generated according to git branch. We don't use gitflow, we use trunk based development.

versioning nuget package GitVersion Documentation

While using only one branch. Is it still possible auto incrementing version number and putting proper descriptors such as CI, "release". If it is possible a good blog post or step by step tutorial would be very helpful.

Also, if you know an alternative tool or how to implement such a versioning on TFS. It would be helpful too.

1

1 Answers

1
votes

To version control in one branch, we can only check in the changes with meaningful comments.

To increment version number in TFS, you can create a build/release definition. Then set the build/release name format as needed. It's applied to both TFVC and Git.

For the build/release name format, you can use a combination of tokens, variables, and underscore characters to set much more useful names that are meaningful to your team.

eg:

CI_Beta_$(TeamProject)_$(BuildDefinitionName)_$(SourceBranchName)_$(Date:yyyyMMdd)$(Rev:.r)

Just add the Copy File step to save the versioned source to any server or UNC path.

Please see Build definition options for details.

enter image description here