Octopus Deploy Documentation

Release versioning

Last updated

You can define how the next release number will be generated when creating a release.

Navigate to the Project tab, select the project and click Settings ➜ Release Versioning:

Release Versioning

You can use variables from the project (un-scoped or scoped only to a channel). In addition, some special variables are provided - example:


These special variables take the form:


If you are using channels, channel-specific special variables are also available:


Version components from other channels in the project can be referenced using the channel name as the index:


The channel name can also be used (generally as part of the suffix):


The version can also include Octopus semantic version mask characters i and c referring to the incremented and current values of the version, respectively. For example:


Finally, date fields can be also be used, for example:


These take the form:


Complex Expressions

The full power of the Octopus variable syntax (powered by Octostache) is available in version templates. In particular, conditional expressions can be used to model some complex scenarios.

Example: Date with incrementing revision

A relatively common versioning scheme is:


where REVISION starts at 0 each day and increments with each release. i.e. The releases on one day might be 2020.10.2.0, 2020.10.2.1, 2020.10.2.2 ... and the following day may be: 2020.10.3.0, 2020.10.3.1 etc.

This can be achieved using the following expression:

#{if Octopus.Date.Day==Octopus.Version.LastPatch}
#{if Octopus.Version.LastRevision!=0}

The expression above is equivalent to:


The difference is that the i is not replaced until the release is saved where the complex expression will show the next increment number before it is saved.

Need support? We're here to help.