Publishing to NuGet feed
#1 Continuous Delivery service for Windows
/assets/img/favicons/apple-touch-icon.png
AppVeyor
NuGet deployment provider publishes artifacts of type NuGet package to remote NuGet feed.

Provider settings

NuGet server URL (server) - NuGet feed URL, e.g. https://nugetserver.com/nuget/feed. If server is not specified package will be pushed to NuGet.org.

API key (api_key) - your API key. Use “Encrypt configuration data” page in AppVeyor (Account → Encrypt YAML) to encrypt your API key before saving it to appveyor.yml.

Symbol server URL (symbol_server) - Publishing URL for symbol server, If server is not specified symbol package will be pushed to SymbolSource.org.

Do not publish symbol packages (skip_symbols) - skip publishing of symbol packages.

Artifact(s) (artifact) - artifact name or filename to push. If not specified all artifacts of type NuGet package will be pushed. This can be a regexp such as /.*\.nupkg/ (or /.*(\.|\.s)nupkg/ to include .snupkg files).

Configuring in appveyor.yml:

Your NuGet API key should be encrypted using this tool: https://ci.appveyor.com/tools/encrypt.

GitHub Package Registry

AppVeyor NuGet deployment provider supports pushing NuGet packages to GitHub Package Registry (GPR). Read more about requirements and limitations of publishing to GPR.

Configuring publishing to GPR in appveyor.yml:

Native packages with CoApp

If you are compiling a native package (such as a C++ library) and need to use the CoApp Powershell Tools to build the NuGet packages then this can also be done, but requires a little more work.

The install script should be used to download and install the CoApp package.

Normally, the CoApp tools use an .autopkg file rather than a .nuspec file to contain the instructions for building the package. In the Appveyor environment, this has one small drawback. Since the package is built on each push to the underlying code repository, multiple builds will happen with the same version number in the .autopkg file. This causes deployment to fail, as a package cannot be uploaded with the same version number as the existing package.

To solve this, the .autopkg file can be renamed to .autopkg.template, and a placeholder used where the version number should go. The Appveyor build process can then replace this placeholder with the build number, ensuring the generated .autopkg file always has a unique, incrementing version number.

All this can be achieved in the before_deploy script, which will also use the CoApp tools to create the .nupkg files just before the attempt to deploy them:

The standard NuGet publishing process above can then be used to deploy these packages.