Is its possible to set the version counter using an action during a stage?
Hi Christian,
You cannot update the version counter (also known as build number) via an action. The only way this can be changed during the build is via the “option reuse build number if previous build was discarded, stopped or failed while initialising” option in the configuration details.
You can, however, update the version string, $Build.Version$, via a Set Build Version action. The version string can also be based on a separate counter variable, which can be incremented using the Set Variable Action, and persisted at the end of the stage or build using the Persist Build Variables build event handler. If you do this, you will need to manage concurrency issues, either by using the “Do not persist if modified” option of the build event handler or by using Shared Resources to prevent multiple concurrent builds.
If this doesn’t help, let us know your use case and we’ll look into whether we need to make any improvements.