The NuGet Publish build runner is intended to publish (push) your NuGet packages to a given feed (custom or default).
When using TeamCity as a NuGet server, there are three ways to publish packages to the feed:
as build artifacts of the NuGet Pack build step using the Publish created packages to build artifacts checkbox - in this case you do not need the NuGet Publish build step
via the NuGet Publish build step
via the ##teamcity[publishNuGetPackage] service message, which ensures the packages are published in all configured NuGet feeds at the end of the current build step and are available in the following build steps
Supported Operating Systems: NuGet build runners are supported on build agents running Windows OS by default. Linux and macOS are supported when Mono is installed on the agent (only NuGet 3.3+ on Mono 4.4.2+ is supported).
warning
Note that TeamCity Cloud currently doesn't support automatic delivery of tools to build agents. To be able to use this runner, you need to download and install the required version of NuGet on the agent. You can do this manually (only on self-hosted agents) or via any convenient utility step at the beginning of the build (for example, Command Line). When configuring a NuGet build step, you will need to specify the path to NuGet relatively to the build checkout directory.
To view the NuGet Installer's settings in Kotlin DSL, click View as code in the sidebar.
This page describes the NuGet Publish runner options:
Option
Description
NuGet.exe
Select a NuGet version to use from the drop-down menu (you need to have NuGet installed), or specify a custom path to NuGet.exe.
note
An appropriate version of .NET Framework installed on the agent machine is required depending on the NuGet.exe version used: NuGet 2.8.6+ requires .NET 4.5+, earlier NuGet versions require .NET 4.0.
Packages
Specify a newline-separated list of NuGet package files (.nupkg) to publish to the NuGet feed. List packages individually or use wildcards.
API key
Specify the API key to access a NuGet packages feed.
To publish to the TeamCity NuGet server, specify the %teamcity.nuget.feed.api.key% parameter.
Package Source
Specify the destination NuGet packages feed URL to push packages to, for example, nuget.org. Leave blank to let NuGet decide what package repository to use.
If you work with an authenticated feed, configure the NuGet Feed Credentials build feature.
TeamCity allows you to authenticate using private NuGet feeds. Read more in NuGet.
When publishing a package with the same version that already exists in a TeamCity internal NuGet feed, the package will be rejected. To force the TeamCity server to replace the existing NuGet package with a new version, append your feed URL obtainable from the Project Settings page with the ?replace=true parameter, for example, http://<Teamcity URL>/httpAuth/app/nuget/feed/NuGet/default/v2?replace=true.
Command line parameters
Enter additional parameters to use when calling the nuget push command.