As part of our move to Azure DevOps (from BitBucket and our own hosted Jenkins), we needed to host some internally used NuGet packages (packaged up third-party commercial libraries).
To do so, we created a new Project in Azure DevOps. As this project is going to be used for all our common libraries, we’ll also host the NuGet feed under Artifacts of this project as well. Note: you need to you have Artifacts extension enabled in Azure DevOps.
Now that we’ve created the Feed, for each distinct library, we’ll also create a new repository under that project – see end of this post.
The NuGet packages are defined using nuspec files, hence the packagesToPack using src/*.nuspec.
[FEEDNAME] needs to be replaced with the feed name for the NuGet feed we created at the start.
We are not defining the version the generated NuGet packages. For our packages, the version is manually defined in the nuspec file.
Now all you should need to do is commit a change to a repository, and watch Azure DevOps build then publish your NuGet packages.
From now on, you can use the same dropdown to to switch the repositories.