OverviewThis extension provides a build task that automatically increments a predefined variable by 1 each time it executes. In CI/CD environments, this task streamlines version management by automatically updating version numbers after each successful build or release. This eliminates the manual effort of propagating version information when building DLLs or other artifacts with predefined versioning schemes. PrerequisitesThis extension supports Azure DevOps Server 2019 and Azure DevOps Online. VideoA comprehensive video demonstration of this extension is available at https://l.samayas.eu/8HKbSI5zmc?P=AMP How to useAfter installing the extension, add the Build Version Updater task to a new or existing build definition or release definition. Once added, the task appears in the pipeline : Once you've added the task to your Build or Release pipeline you need to configure your individual task. Inside your task configuration you have 2 settings that are important:
VariablesThe Project Build Number Variable specifies which variable the task will increment. This variable must already exist in the pipeline and must be initialized to an integer value. Each time the task executes, it increments the specified variable by 1. Samayas Azure DevOps Server ConnectionThis Task requires a Personal Access Token (PAT) to connect to Azure DevOps Server. Creating a PAT key for Azure DevOps Server OnlineNavigate to the Azure DevOps Online portal at https://dev.azure.com/youraccount. Click the user profile icon in the upper right corner and select Security from the menu. Once your have selected Security menu you'll see a Personal Access Tokens Menu. Click on the New Token + to create a new token. A Pop-up will show up where u can create a PAT token.
Important: After the expiration you need to reupdate the token or the task won't work anymore. Or you can extent the expiration before expiry The token requires the following scopes :
Select Custom defined scopes, and if these scopes are not visible, click Show all scopes. The token value is displayed only once. Copy and securely store this value for later use. The newly created PAT appears in the token list : Creating a PAT key for Azure DevOps ServerNavigate to the on-premises Azure DevOps Server portal at https://devopsserver. Click the user profile icon in the upper right corner and select Security. Once your have selected Security menu you'll see a Personal Access Tokens Menu. Click on the Add to create a new token. A Pop-up will show up where u can create a PAT token.
Important: After the expiration you need to reupdate the token or the task won't work anymore. Or you can extent the expiration before expiry The token requires the following scopes :
Select Custom defined scopes, and if these scopes are not visible, click Show all scopes. The token value is displayed only once. Copy and securely store this value for later use. The newly created PAT appears in the token list : Creating a Service ConnectionWith the PAT created, establish a service connection. Service connections can be created through two methods :
Both methods open the Service Connections settings page. The initial view may be empty or contain existing service connections for other services. Click New service connection and select Samayas DevOps Endpoint.
Click Create to finalize the service connection. The new connection appears in the service connections list. Use Case : Building Complete Version NumbersThe incremented variable can be combined with other variables to construct complete version numbers. Example variable structure :
This composite variable can be referenced throughout the pipeline by other tasks Remarks: For Major.Minor.Build format: 1.0.{ProjectBuildNumber} produces 1.0.23.0 For Major.Minor.Build.Revision format: 1.0.0.{ProjectBuildNumber} produces 1.0.0.23 The extension provides flexibility to construct any version format—it simply maintains an incremental counter for use in version composition. Selecting Service Connection in TaskAfter creating the service connection, select it from the dropdown in the task configuration. The fully configured task appears as follows: TargetThe goal of this add-in is to manage versioning after building successfully. Version History
|