I have multiple NuGet packages in the same repository. I would like to AutoVersion my packages to $Major.$Minor.$Patch-CI-$DateTimeStamp. $Major.$Minor.$Patch-CI-$rev would also work.
If I know what the original version is, it will make the NuGet package easier to understand. I can also ensure that my dev NuGet packages are a higher version than my master NuGet packages. I don't want to manually set the Major, Minor, and Patch variables because there are multiple NuGet packages in the solution.
The following attempt always has Major.Minor.Patch as 1.0.0
- task: DotNetCoreCLI@2 condition: and(succeeded(), ne(variables['Build.SourceBranch'], 'refs/heads/master')) inputs: command: 'pack' packagesToPack: $(projectsNuGet) nobuild: true versioningScheme: 'byPrereleaseNumber'
This doesn't change the version at all
- task: DotNetCoreCLI@2 displayName: DotNetCoreCLI pack !master condition: and(succeeded(), ne(variables['Build.SourceBranch'], 'refs/heads/master')) inputs: command: 'pack' packagesToPack: $(projectsNuGet) nobuild: true arguments: --version-suffix pre9999