When doing my CI on Azure DevOps with the YAML file format, I'm trying to read my csproj files to extract informations about version to create NuGet packages that will follow the csproj version.
I'm using NuGetCommand@2
for packaging (because of versioningScheme: byPrereleaseNumber
)
Is there a built-in task or a way to extract this info from csproj file as a regex and pass them to NuGetCommand@2
?
I'm fairly sure there is nothing built-in for this, but you can use any scripting language you like to parse the file and "spit out" whatever you need as a build variable and consume it later on. here's what I've been doing:
- script: echo "##vso[task.setvariable variable=dp]$(cat $(Build.Repository.LocalPath)/deployment/dp)"
- script: az group delete -n $(dp)-k8s -y --no-wait
you can obviously do any custom thing in the script step and consume the result in anyway you like to.
https://github.com/Microsoft/azure-pipelines-tasks/blob/master/docs/authoring/commands.md
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With