#Step 1 - Create your NuGet feed using MyGet
I use MyGet to publish my package for CI. The service is free as long as you don't exceed 500MB and it allows me to not pollute NuGet.org with lots of in-development packages. Plus, the 500MB limits is very high and you can configure retention rules to automatically delete old package versions.
Go to https://www.myget.org to create your first feed. Once you complete the steps, you should get this screen:
The 1 is the URL to push packages. The 2 is the key to publish packages. You'll need this information later to configure the build task.
#Step 2 - Create the VSTS build
To configure the NuGet Publisher task, you must add the MyGet endpoint. Go in the project settings, select "Services", and add a generic service endpoint with the URL of the MyGet feed (number 1 in the previous screenshot).
Add NuGet Packager task. Select an automatic versioning mode, so every build generate a unique package version.
Add NuGet Publisher task. Select the server endpoint and add the API Key.
Configure the build to run after each check-in
You can now run a build and see the package on MyGet.
#Step 3 - Configure Visual Studio to use the MyGet feed
You need to configure the NuGet client to use the MyGet feed in Visual Studio.
NuGet.configfile at the root folder of your solution.
Add the NuGet V3 feed URL
<?xml version="1.0" encoding="utf-8"?> <configuration> <packageSources> <add key="MyGet feed" value="https://www.myget.org/F/meziantou-sample/api/v3/index.json" /> </packageSources> </configuration>
Restart Visual Studio
In about 5 minutes, you can configure VSTS to deploy your NuGet packages to MyGet after every check-in 😃
Do you have a question or a suggestion about this post? Contact me!