We are trying to use Azure DevOps to build our git branches and produce NuGet packages using the NuGet Pack command, we want to automatically build master and also any feature branches that are pre-release.
We have tried setting the build number format to:
$(BuildDefinitionName)_$(Date:yyyyMMdd).$(BuildID).$(Rev:.r)$(Build.SourceBranchName)
This gives us the error:
[error]Could not find version number data in the following environment variable: BUILD_BUILDNUMBER. The value of the variable should contain a substring with or are positive integers.
I set the build number format to 1.0.0-alpha which worked but in the Artifacts list it just shows as 1.0.0.
How can we use CI in Azure Devops to build master and all our feature branches, produce the NuGet packages and apply the branch name to the NuGet version so we can consume these packages in our test environment and test a feature branch in isolation?
$(Build.DefinitionName)
and$(Build.BuildId)
(maybe the error is because environments syntax errors)? – Shayki Abramczyk