Assume we have:
- A release candidate configuration which is used to build release candidates of your software.
- A release configuration which is used to release your software.
Now we want to control build version of these two configurations so that:
- Version of builds in release candiciate configuration is composed of the release part and the candidate part, with the release part using the version to be released, and candiciate part increasing automatically for each build. For example, we are going to release 1.0, and candidate builds should use versions in form of: 1.0-rc1, 1.0-rc2, 1.0-rc3, ...
- When a release candidate build is promoted as release build, the release version should be automatically increased, and the candidate version should be reset to 1. For example, after 1.0 is released, new builds in release candidate configuration should use versions in form of: 1.1-rc1, 1.1-rc2, 1.1-rc3, ...
- Click here and press the run button to generate new release candidate builds. The rc part of the build version will be automatically increased.
- After the build finishes, switch to latest release candidate build, and click the promote button to promote a release candidate build as release build. A new release build will be generated in the release configuration.
- Return back to release candidate configuration and run it to generate a new build. The release part of the new build version will take value of next release number, and the rc part will reset to 1.
- Define three variables in variable setting of project level configuration, respectively:
This variable is used control rc part of release candidate builds.
This variable is used to control major part of the release version.
This variable is used to control minor part of the release version.
- Define next build version in general setting of release candidate configuration like below:
This tells QuickBuild to use current value of variable major, minor, and rc to construct release candidate build version, and increase the rc variable by one after usage.
- Define next build version in general setting of release configuration like below:
This tells QuickBuild to use current value of variable major and minor to construct release build version.
- Configure a step in step setting of release configuration to execute below script:
This script is executed by the master step in the demo site for simpliticy reasons, and it tells QuickBuild to reset rc variable to 1 when a new release is generated.