Skip to main content
Version: Next

Nerdbank.GitVersioning Package

ModularPipelines.NerdbankGitVersioning provides strongly typed access to the nbgv CLI.

Installation

dotnet add package ModularPipelines.NerdbankGitVersioning
dotnet tool install --global nbgv

The nbgv executable must be available on PATH when the pipeline runs.

Read version information

using ModularPipelines.NerdbankGitVersioning.Options;

var result = await context.Tools.Nbgv.GetVersionAsync(
new NbgvGetVersionOptions
{
Project = "src/MyProject",
Format = "json",
},
cancellationToken: cancellationToken);

Set cloud build variables

var result = await context.Tools.Nbgv.CloudAsync(
new NbgvCloudOptions
{
CommonVars = true,
Define = ["Channel=stable"],
},
cancellationToken: cancellationToken);

See the generated nbgv CLI reference for every supported command and option.