Class NugetOperations
- Namespace
- Ando.Operations
- Assembly
- ando.dll
Provides NuGet package operations for build scripts. Methods register steps in the workflow rather than executing immediately.
public class NugetOperations : OperationsBase
- Inheritance
-
NugetOperations
- Inherited Members
Constructors
NugetOperations(StepRegistry, IBuildLogger, Func<ICommandExecutor>)
public NugetOperations(StepRegistry registry, IBuildLogger logger, Func<ICommandExecutor> executorFactory)
Parameters
registryStepRegistryloggerIBuildLoggerexecutorFactoryFunc<ICommandExecutor>
Methods
EnsureAuthenticated()
Ensures NuGet API key is available for publishing. If NUGET_API_KEY environment variable is not set, prompts the user interactively. Call this before Push operations.
public void EnsureAuthenticated()
Pack(ProjectRef, Action<NugetPackOptions>?)
Registers a 'dotnet pack' step to create a NuGet package.
public void Pack(ProjectRef project, Action<NugetPackOptions>? configure = null)
Parameters
projectProjectRefThe project to pack.
configureAction<NugetPackOptions>Optional configuration for pack options.
Push(ProjectRef, Action<NugetPushOptions>?)
Registers a 'dotnet nuget push' step to publish packages for a project. Looks for *.nupkg files in the project's output directory. Call EnsureAuthenticated() first to set up the API key.
public void Push(ProjectRef project, Action<NugetPushOptions>? configure = null)
Parameters
projectProjectRefThe project whose packages to push.
configureAction<NugetPushOptions>Optional configuration for push options.
Push(string, Action<NugetPushOptions>?)
Registers a 'dotnet nuget push' step to publish a NuGet package. Call EnsureAuthenticated() first to set up the API key.
public void Push(string packagePath, Action<NugetPushOptions>? configure = null)
Parameters
packagePathstringPath to the .nupkg file or glob pattern (e.g., *.nupkg).
configureAction<NugetPushOptions>Optional configuration for push options.