let say i have defined few variables in my yaml:
major: 0
minor: 0
patch: $[counter(variables['minor'], 0)] #this will reset when we bump minor
myVersion: '$(major).$(minor).$(patch)-$(Build.BuildId)'
I have few doubts about it's working. I know the value of patch would increment for every build.
But, if i push my changes with the last value of patch as 7, and i create a new branch will the value of patch start from 8 or again 0?
what i want?
- value of patch to only increment when i merge my changes to main. (or let's say i have a boolean variable defined in UI. if i set it to true it should increment the patch)
- Also, if for the above question, the value of patch starts from 0 from every new branch, then how do i make sure it doesn't?
For example: 0.0.2-XXXX
i have branch A, i ran 20 builds but when i merge my changes to main. the version should be 0.0.3-XXXX, and not 0.0.22.XXXX