How to increment prerelease version by 1 each commit/push per branch? #4653
-
Scenario: I cannot find a way to increment the prerelease version. For example, I have the following branch based off of some release/dev branch with version 1.0.0: Branch1. I kind of had some luck changing the unknown/feature branch configs to use mode: ContinousDelivery, but that pre-release version wouldn't reset when making new branches. So if my Branch1 SemVer is 1.0.0-Branch1.2, and I make Branch2 based off of Branch1, the SemVer is 1.0.0-Branch2.3 instead of 1.0.0-Branch2.1. If that prerelease version is NOT the right way to do this please let me know. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
In scenarios like this, instead of using GitVersion's output variables directly, I recommend appending to it something like |
Beta Was this translation helpful? Give feedback.
-
Like you sayed for nuget it is important that the version is unique. This is true even if you create a new branch based on the other. Okay the pre-release version number starts with 3 but is it really a problem!? If you use the github.run_number then the number also not starting from one. Edit: You could also merge the commits from branch1 to branch2 with a squash merge which results in one commit. |
Beta Was this translation helpful? Give feedback.
In scenarios like this, instead of using GitVersion's output variables directly, I recommend appending to it something like
github.run_number
to make every produced version unique.