0

When using cake, I can set which semver part I want updated:

var settings = new MinVerSettings();
settings.AutoIncrement = MinVerAutoIncrement.Major;
var minver = MinVer(settings);

That example is for minver, but the same would apply for nerdbank or gitversion.

How can I do the equivalent with nuke? The docs cover the basics only.

I use this: [MinVer] private readonly MinVer _minVer;, but am unsure what to do next.

(If you have a working sample for any of gitversion/nerdbank/minver that's fine, I'll adapt it for my needs, as it seems the basic mechanism is identical.)

lonix
  • 14,255
  • 23
  • 85
  • 176

1 Answers1

1

This will work regardless of what else you are using (e.g. Cake, Nuke, etc.):

dotnet add package SimpleExec
using static SimpleExec.Command;

var (minver, _) = await ReadAsync("minver", "--autoincrement major");
Adam Ralph
  • 29,453
  • 4
  • 60
  • 67