In my release pipeline for a dotnet core project, I want to increment the assembly version automatically so I don't need to update it manually each time. This is so my Nuget version is increased every time.
At the moment I'm using the dotnet pack
command and adding the build number at the end using the "Automated Package Versioning" set to "Use Environment Variable: Build.BuildNumber". Then I set the "Option > Build Number Format" to "1.0.$(BuildID)". First, I tried setting the attribute of the .csproj file to 1.0.$(BuildID), but the pipeline did not pick that up.
The problem is that I have to edit my build pipeline every time I want to adjust my major or minor semver version. Yet with the teams, we agreed not to put build pipeline config in source control (yaml files). Is there a way we can put a part of the build pipeline in a yaml file so that we can override parts of the configuration?
For example: I could set the "Build Number Format" to "$(Major).$(Minor).$(BuildID)" and then the partial yaml could override the Major and Minor variables.
azure-pipeline.yml
. The ops department doesn't have access to our repo and wants to keep the pipeline under their control (we and them can access the pipeline online through a browser, but if we put the config in a yaml file, then the ops department can't update the pipeline). But we do want to put some values (like theMajor
andMinor
variables) in a file in our repo, so we can update them without the ops department having a say in this. Because now the ops department could overwrite our major and minor versions. – Ken Bonny