Вы можете установить номер версии выпуска в Конвейеры выпуска -> Параметры -> Общие -> Формат имени выпуска .
The $(rev:r)
is an incrementing variable. So you could add it in the Release version.
For example: V1.2.$(rev:r)
Result:
Note: the $(rev:r)
counts from 1 (1,2,3...).
From your requirement, you are using CI and CD process and it seems that you need to count from 0. You also could try to use the $(Build.buildnumber) variable.
Here are the steps:
Step1: In Build Pipeline(CI) , set the count variable(e.g. BuildRevision :$[counter( ' ',0)]
).
Step2: Use the variable in Build number (Build Pipeline->Options ->Build number format).
Step3: Set the build artifacts as the release source. Use the $(Build.buildnumber) in release pipeline version.
Result:
In this situation, the release version could start from v1.2.0.
Update:
when I change the release version for example from V0.0 to V1.0 , how the counter restarted ?
You could try the following steps:
Create 2 variables:
1.major-minor = 0.0
2.revision = $[ counter(variables['major-minor'],0) ]
The build number: $(major-minor).$(revision)
In this case, when the major-minor
change as V1.0, the counter will reset.
введите описание изображения здесь