I use azure pipelines and I have questions about push the library to nuggets. What's correctly way? In build pipelines pack library a push to nugget with prerelease number and prepare with the pack library as an artifact for release pipeline? So I can run the release pipeline with push command to negate as release version?
What do you think? Thank you :)
You could use NuGetCommand@2 - NuGet v2 task in Azure build pipeline to pack and publish the package to the build artifact. Then using the build artifact in your release pipeline to use.
But if you would like to reuse the package in the organization or project, you could publish the package as the azure artifact feed then use it in build and release pipeline. You could use command line to publish the feeds like this Publish and restore NuGet packages from the command line (NuGet.exe) Or through azure pipeline to publish the feed to the artifact: Publish NuGet packages with Azure Pipelines (YAML/Classic)
And if it is public feeds, you could publish the package to NuGet.org, then yo could also use it in your organization/project.
If you want to publish the nuget package to Azure devops artifact, you could use the second release to publish into the feeds using Semantic Versioning.
Or you could manually add tag here by choosing 'prerelease' or 'release' after click 'promote'.
If the prerelease succeeds and you would like it to be the release one, just choose 'release'.
If the prerelease succeeds and you would like to add some details in the release one, just release with different version name.