Skip to content

Commit

Permalink
Build: set a proper release name when drafting a new release
Browse files Browse the repository at this point in the history
  • Loading branch information
aaubry committed Mar 28, 2021
1 parent a2d6811 commit c7eab1a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
3 changes: 2 additions & 1 deletion tools/build/BuildDefinition.cs
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ public static ScaffoldedRelease ScaffoldReleaseNotes(GitVersion version, Previou
.Select(c => c.message.Select((l, i) => $"{(i == 0 ? '-' : ' ')} {l}"))
.Select(c => string.Join(" \n", c));

var releaseNotes = $"# Release {version.NuGetVersion}\n\n{string.Join("\n\n", log)}";
var releaseNotes = string.Join("\n\n", log);

WriteVerbose(releaseNotes);

Expand All @@ -236,6 +236,7 @@ public static async Task CreateGithubRelease(GitVersion version, ScaffoldedRelea
{
tag_name = $"v{version.NuGetVersion}",
target_commitish = version.Sha,
name = $"Release {version.NuGetVersion}",
body = release.ReleaseNotes,
draft = true,
prerelease = version.IsPreRelease,
Expand Down
10 changes: 9 additions & 1 deletion tools/build/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using System.Web;
using static Bullseye.Targets;
using OperatingSystem = Bullseye.Internal.OperatingSystem;

Expand All @@ -21,7 +22,7 @@ class Program
private static Palette palette = default!;
public static bool NoPrerelease { get; private set; }
private static bool verbose;

private static Host host;
private static readonly Dictionary<Type, object> state = new Dictionary<Type, object>();

private static T GetState<T>() where T : notnull
Expand Down Expand Up @@ -130,6 +131,7 @@ static int Main(string[] args)

var (options, targets) = Options.Parse(filteredArguments);
verbose = options.Verbose;
host = options.Host;

var operatingSystem =
RuntimeInformation.IsOSPlatform(OSPlatform.Windows)
Expand Down Expand Up @@ -224,6 +226,12 @@ public static void WriteWarning(string text)

public static void WriteImportant(string text)
{
switch (host)
{
case Host.GitHubActions:
Console.WriteLine($"::warning ::{text.Replace("\\n", "%0A")}");
break;
}
WriteBoxed(text, palette.Warning);
}

Expand Down

0 comments on commit c7eab1a

Please sign in to comment.