TeamCity 2017.1 Help

NuGet Publish

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 two 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 (since TeamCity 2017.1)

This page describes the NuGet Publish runner options:

Option

Description

NuGet.exe

Select a NuGet version to use from the drop-down list (you need to have NuGet installed) , or specify a custom path to NuGet.exe.

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, e.g. nuget.org. Leave blank to let NuGet decide what package repository to use.

To use the TeamCity internal NuGet server, specify %\teamcity.nuget.feed.server% for guest-visible package source or %\teamcity.nuget.feed.auth.server% to use TeamCity authenticated package source.

Replacing existing package version in TeamCity internal feed

When publishing a package with the same version that already exists on the TeamCity internal NuGet server, the package will be rejected. (The package version may stay the same when building a solution with a lot of projects, and only one project has changed.) To force TeamCity server to replace the existing NuGet package with the new version, append your server url with the ?replace=true parameter, e.g. %\teamcity.nuget.feed.server%?replace=true

Command line parameters

Enter additional parameters to use when calling the nuget push command.

Last modified: 20 April 2023