NuGetAliases.

NuGetPush(ICakeContext, FilePath, NuGetPushSettings) Method

Summary

Pushes a NuGet package to a NuGet server and publishes it.
Namespace
Cake.Common.Tools.NuGet
Containing Type
NuGetAliases

Syntax

[CakeMethodAlias]
[CakeAliasCategory("Push")]
[CakeNamespaceImport("Cake.Common.Tools.NuGet.Push")]
public static void NuGetPush(this ICakeContext context, FilePath packageFilePath, NuGetPushSettings settings)

Examples

NOTE: Starting with NuGet 3.4.2, the Source parameter is a mandatory parameter.

It is strongly recommended that you ALWAYS set the Source property within the NuGetPushSettings instance.

 // Get the path to the package.
 var package = "./nuget/SlackPRTGCommander.0.0.1.nupkg";

 // Push the package.
 NuGetPush(package, new NuGetPushSettings {
     Source = "http://example.com/nugetfeed",
     ApiKey = "4003d786-cc37-4004-bfdf-c4f3e8ef9b3a"
 });

Attributes

Type Description
CakeMethodAliasAttribute An attribute used to mark script method aliases.
CakeAliasCategoryAttribute An attribute used for documentation of alias methods/properties.
CakeNamespaceImportAttribute An attribute used to hint Cake about additional namespaces that need to be imported for an alias to work. This attribute can mark an extension method, the extension method class, or the assembly to provide a global set of imports.

Parameters

Name Type Description
context ICakeContext The context.
packageFilePath FilePath The .nupkg file path.
settings NuGetPushSettings The settings.

Return Value

Type Description
void