Skip to content

Commit 134b8ed

Browse files
[build] Automatic NextVersion evaluation
1 parent 9dd7b6f commit 134b8ed

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

build/BenchmarkDotNet.Build/Program.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,9 @@ public class ReleaseTask : FrostingTask<BuildContext>, IHelpProvider
223223
new Example(Name)
224224
.WithArgument(KnownOptions.Stable)
225225
.WithArgument(KnownOptions.NextVersion, "0.1.1729")
226+
.WithArgument(KnownOptions.Push),
227+
new Example(Name)
228+
.WithArgument(KnownOptions.Stable)
226229
.WithArgument(KnownOptions.Push)
227230
}
228231
};

build/BenchmarkDotNet.Build/Runners/ReleaseRunner.cs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
using System;
22
using System.Linq;
33
using System.Text;
4-
using System.Text.RegularExpressions;
54
using System.Threading.Tasks;
65
using BenchmarkDotNet.Build.Helpers;
76
using BenchmarkDotNet.Build.Meta;
@@ -34,9 +33,15 @@ public void Run()
3433
else
3534
EnvVar.NuGetToken.SetEmpty();
3635

37-
var nextVersion = KnownOptions.NextVersion.AssertHasValue(context);
3836
var currentVersion = context.VersionHistory.CurrentVersion;
3937
var tag = "v" + currentVersion;
38+
var nextVersion = KnownOptions.NextVersion.Resolve(context);
39+
if (nextVersion == "")
40+
{
41+
var version = Version.Parse(currentVersion);
42+
nextVersion = $"{version.Major}.{version.Minor}.{version.Build + 1}";
43+
context.Information($"Evaluated NextVersion: {nextVersion}");
44+
}
4045

4146
context.GitRunner.Tag(tag);
4247

0 commit comments

Comments
 (0)