Azure DevOps CI/CD for Windows Desktop Apps – Part 3

Kicking off the Release Pipeline

When you configure a release pipeline (which we discuss in Part 4), we need to have a “trigger” which lets us know when we actually want to start the release pipeline. There are many ways to handle this. In my particular scenario we are going to use the #PUBLISH tag in the commit message. Unfortunately a condition on commit message is not available as trigger, so we need to find something else.


There are more parts available:
Azure DevOps CI/CD for Windows Desktop Apps – Part 1
Azure DevOps CI/CD for Windows Desktop Apps – Part 2
Azure DevOps CI/CD for Windows Desktop Apps – Part 3 (this post)
Azure DevOps CI/CD for Windows Desktop Apps – Part 4
Azure DevOps CI/CD for Windows Desktop Apps – Part 5


Use Build Tags

We can make use of “build tags”. The easiest way is to create a PowerShell Script agent task which executes a simple Write-Host command with a special syntax to create a build tag:

Extended condition to kick off the release pipeline

The “Custom condition” for the last two build tasks is:

and(succeeded(), contains(variables['Build.SourceVersionMessage'], '[win]'), contains(variables['Build.SourceVersionMessage'], '#PUBLISH'))

The last build task, is important because this PowerShell Script invokes the following command:

Write-Host "##vso[build.addbuildtag]win-publish"

This is an extremely useful feature in Azure DevOps. You can set tags or custom variables in your script which can then be used in subsequent tasks. Here’s the documentation.

So now, I’ve added a build tag with the value “win-publish” on the pipeline. This is important for the next step: Azure DevOps CI/CD for Windows Desktop Apps – Part 4 where we can now use the tag as a trigger to kick off the release pipeline. Stay tuned…

Leave a Reply