-
Notifications
You must be signed in to change notification settings - Fork 8
NuGetPush Task
The NuGetPush
task publishes a NuGet package (files with .nupkg
extensions) to a NuGet repository using the nuget.exe push
command. By default, it publishes all *.nupkg files in the output directory.
You must supply a Uri
property and an ApiKeyID
property, which should be the URI to the NuGet repository to publish to and the ID of the API key to use, respectively. API keys must be added in your build.ps1
script using Whiskey's Add-WhiskeyApiKey
function.
The task will fail the build if a package with the current version already exists.
Because nuget.exe gives no indication if publishing failed or succeeded, the task checks for the newly published package after publishing. Some repositories take awhile to show available packages, so to skip this behavior, use the SkipUploadedCheck
property.
- Path: the path to the .nupkg files to publish. By default, all .nupkg files in the output directory are published.
- Symbols: whether or not to publish symbols package. If this is
true
, the task only publishes files that match the*.symbols.nupkg
wildcard. - Uri (mandatory): the URI to the NuGet repository to publish to. This is passes as-is to the
nuget.exe push -source
parameter. When publishing to nuget.org, use the valuehttps://nuget.org/api/v2/package
. - ApiKeyID (mandatory): the ID of the API key to use. Add API keys to your build.ps1 with the
Add-WhiskeyApiKey
function. TheApiKeyID
property and theAdd-WhiskeyApiKey
function'sID
parameter must match. - Version: the version of nuget.exe to use to publish. The default is to use the latest version of NuGet.
- SkipUploadedCheck: set to
true
to not check if the package is immediately available after publishing. The default value isfalse
, which means the build will fail if the just-uploaded package isn't available.
Build:
- NuGetPush:
Uri: https://nuget.org/api/v2/package
ApiKeyID: nuget.org
SkipUploadedCheck: true
Demonstrates how to publish to nuget.org. All *.nupkg files in the output directory are published.
Build:
- NuGetPush:
Uri: https://proget.example.com/nuget/NuGet/
ApiKeyID: ProGet
Path: $(WHISKEY_OUTPUT_DIRECTORY)\nuget\Whiskey*.nupkg
Demonstrates how to publish specific packages to an internal ProGet feed named "NuGet". In this example, only files in a nuget
directory in the output directory that match the wildcard Whiskey*.nupkg
are published.
Build:
- NuGetPush:
Uri: https://nuget.org/api/v2/package
ApiKeyID: nuget.org
Version: 4.1.0
Demonstrates how to use a specific version of NuGet. In this case, Whiskey will use version 4.1.0.
Build:
- NuGetPush:
Uri: https://proget.example.com/nuget/NuGet/
ApiKeyID: ProGet
Symbols: true
Demonstrates how to public symbol packages. In this case, only package whose filenames match wildcard *.symbols.nupkg
are published.
- Common Task Properties
- AppVeyorWaitForBuildJob
- CopyFile
- Delete
- DotNet
- Exec
- File
- GetPowerShellModule
- GitHubRelease
- InstallNodeJs
- LoadTask
- Log
- MergeFile
- MSBuild
- NuGetPack
- NuGetPush
- NuGetRestore
- NUnit2
- NUnit3
- Parallel
- Pester
- Pipeline
- PowerShell
- ProGetUniversalPackage
- PublishBitbucketServerTag
- PublishBuildMasterPackage
- PublishNodeModule
- PublishPowerShellModule
- PublishProGetAsset
- PublishProGetUniversalPackage
- SetVariable
- SetVariableFromPowerShellDataFile
- SetVariableFromXml
- TaskDefaults
- Version
- Zip