LINQ2Vodka
LINQ2Vodka

Reputation: 3036

Publishing prerelease NuGet packages with dotnet CLI in Azure DevOps

I have been playing with a pipeline but still haven't found a way to make dotnet pack in Azure DevOps create version "2021.10.22-alpha.1" (template is YYYY.MM.DD-alpha.Rev) for my library. I wasn't able to find a way to specify "alpha" at anywhere (yes, I tried everything).

Upvotes: 0

Views: 231

Answers (1)

LINQ2Vodka
LINQ2Vodka

Reputation: 3036

I've finally found it.

  1. Set "Automatic package versioning" to off so no Version is passed to MSBuild. Otherwise it'd ignore any suffixes or prefixes
  2. In "Additional build properties" set VersionSuffix=foo;VersionPrefix=$(Build.BuildNumber)
  3. Adjust BuldNumber format in the Options section of the pipeline if need

Now my package version is "2021.10.22.8-foo". It's still not ideal but I'm on the right way.

Upvotes: 1

Related Questions