Skip to content

Commit

Permalink
Merge branch 'hotfix/6.0.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
matkoch committed Jan 10, 2022
2 parents 02a1058 + c06cebe commit e20ab8d
Show file tree
Hide file tree
Showing 8 changed files with 65 additions and 21 deletions.
7 changes: 6 additions & 1 deletion CHANGELOG.md
Expand Up @@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## [vNext]

## [6.0.1] / 2022-01-10
- Fixed invisible output for `SystemConsoleHostTheme`
- Fixed `GetRelativePath` for same parts in different places

## [6.0.0] / 2022-01-07
- Removed `ToolSettings.ProcessLogFile` and `ProcessLogTimestamp`
- Removed `GitHub` prefix for `GitHubActions` environment variables
Expand Down Expand Up @@ -877,7 +881,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Added CLT tasks for Git
- Fixed background color in console output

[vNext]: https://github.com/nuke-build/nuke/compare/6.0.0...HEAD
[vNext]: https://github.com/nuke-build/nuke/compare/6.0.1...HEAD
[6.0.1]: https://github.com/nuke-build/nuke/compare/6.0.0...6.0.1
[6.0.0]: https://github.com/nuke-build/nuke/compare/5.3.0...6.0.0
[5.3.0]: https://github.com/nuke-build/nuke/compare/5.2.1...5.3.0
[5.2.1]: https://github.com/nuke-build/nuke/compare/5.2.0...5.2.1
Expand Down
4 changes: 2 additions & 2 deletions appveyor.yml
Expand Up @@ -15,7 +15,7 @@
# ------------------------------------------------------------------------------

image:
- Visual Studio 2019
- Visual Studio 2022

branches:
only:
Expand Down Expand Up @@ -49,4 +49,4 @@ environment:
GitterAuthToken:
secure: Fy//YC4mL9IipkXG3OENTpC9g2qOtU32/5WU6PHw/HLty8YjvHXHsnTkk0HWJJMw
SlackWebhook:
secure: xENxLITTR28hBLEY51YWMeHhxkhg1h1tLY1zGre1/hkn8u/b12lFivnxtTPuMWjAYkoPLlkJ4v39FLYPcxGYbAxRRMcJiHjrNyPtFfK6ddo=
secure: xENxLITTR28hBLEY51YWMeHhxkhg1h1tLY1zGre1/hkmagda0rH4ZxOTbJ1bcmC3D6uhvJKLtSHqY7TK/48Nw3EbvN9wNFEt97HWYc9FE+g=
39 changes: 35 additions & 4 deletions build/Build.Announce.cs
Expand Up @@ -9,6 +9,7 @@
using Nuke.Common;
using Nuke.Common.ChangeLog;
using Nuke.Common.Git;
using Nuke.Common.Tools.Git;
using Nuke.Common.Tools.GitHub;
using Nuke.Common.Tools.Slack;
using Nuke.Common.Utilities;
Expand Down Expand Up @@ -41,6 +42,16 @@ partial class Build
.Requires(() => GitterAuthToken)
.Executes(async () =>
{
var committers = GitTasks.Git($"log {MajorMinorPatchVersion}^..{MajorMinorPatchVersion} --pretty=tformat:%an", logOutput: false);
var commitsText = $"{committers.Count} {(committers.Count == 1 ? "commit" : "commits")}";
var comparisonUrl = GitRepository.GetGitHubCompareTagsUrl($"{MajorMinorPatchVersion}^", MajorMinorPatchVersion);
var notableCommitters = committers
.Select(x => x.Text)
.GroupBy(x => x)
.OrderByDescending(x => x.Count())
.Select(x => x.Key)
.Where(x => x != "Matthias Koch").ToList();
var client = new TwitterClient(
new TwitterCredentials(
TwitterCredentials.ConsumerKey,
Expand All @@ -67,10 +78,30 @@ partial class Build
});
await SendSlackMessageAsync(_ => _
.SetText(new StringBuilder()
.AppendLine($"<!here> :mega::shipit: *NUKE {MajorMinorPatchVersion} IS OUT!!!*")
.AppendLine()
.AppendLine(ChangelogSectionNotes.Select(x => x.Replace("- ", "")).JoinNewLine()).ToString()),
.AddAttachment(_ => _
.SetFallback($"NUKE {MajorMinorPatchVersion} RELEASED!")
.SetAuthorName($"NUKE {MajorMinorPatchVersion} RELEASED!")
.SetAuthorLink($"https://nuget.org/packages/Nuke.Common/{MajorMinorPatchVersion}")
.SetColor("#00ACC1")
.SetThumbUrl(
MajorMinorPatchVersion.EndsWith(".0.0")
? "https://emojipedia-us.s3.dualstack.us-west-1.amazonaws.com/thumbs/320/apple/285/rocket_1f680.png"
: MajorMinorPatchVersion.EndsWith(".0")
? "https://emojipedia-us.s3.dualstack.us-west-1.amazonaws.com/thumbs/320/apple/285/wrapped-gift_1f381.png"
: "https://emojipedia-us.s3.dualstack.us-west-1.amazonaws.com/thumbs/320/apple/285/package_1f4e6.png")
.SetText(new StringBuilder()
.Append($"This release includes *<{comparisonUrl}|{commitsText}>*")
.AppendLine(notableCommitters.Count > 0
? $" with notable contributions from {notableCommitters.JoinCommaAnd()}. A round of applause for them! :clap:"
: ". No contributions this time. :sweat_smile:")
.AppendLine()
.AppendLine("Remember that you can call `nuke :update` to update your builds! :bulb:")
.AppendLine()
.AppendLine("*Release Notes*")
.AppendLine("```")
.AppendLine(ChangelogSectionNotes.Select(x => x.Replace("- ", "").Replace("`", string.Empty)).JoinNewLine())
.AppendLine("```").ToString())
.SetFooter("Powered by *<https://octopus.com/|Octopus Deploy>* and *<https://virtocommerce.com/|Virto Commerce>*.")),
SlackWebhook);
SendGitterMessage(new StringBuilder()
Expand Down
4 changes: 2 additions & 2 deletions build/Build.CI.AppVeyor.cs
Expand Up @@ -7,7 +7,7 @@

[AppVeyor(
suffix: null,
AppVeyorImage.VisualStudio2019,
AppVeyorImage.VisualStudio2022,
BranchesOnly = new[] { MasterBranch, $"/{ReleaseBranchPrefix}\\/*/" },
SkipTags = true,
InvokedTargets = new[] { nameof(IPack.Pack), nameof(ITest.Test), nameof(ISignPackages.SignPackages), nameof(IPublish.Publish) },
Expand Down Expand Up @@ -39,7 +39,7 @@
[AppVeyorSecret(IHazTwitterCredentials.Twitter + nameof(IHazTwitterCredentials.AccessToken), "nnv1h5nkNm4MS50soQHiYXVUf0UR+gx54imrggateey6oA+rdCdna0TaUCH1vsDwHEitHDPRdx39xjJMBzwRxA==")]
[AppVeyorSecret(IHazTwitterCredentials.Twitter + nameof(IHazTwitterCredentials.AccessTokenSecret), "OGFEkW5fHl0YJzKnTTWJ3oHhQfjMs9RWGJMjeQ2HMIG+yUwy0NQGVUY4qOCRgrXW")]
[AppVeyorSecret(nameof(GitterAuthToken), "Fy//YC4mL9IipkXG3OENTpC9g2qOtU32/5WU6PHw/HLty8YjvHXHsnTkk0HWJJMw")]
[AppVeyorSecret(nameof(SlackWebhook), "xENxLITTR28hBLEY51YWMeHhxkhg1h1tLY1zGre1/hkn8u/b12lFivnxtTPuMWjAYkoPLlkJ4v39FLYPcxGYbAxRRMcJiHjrNyPtFfK6ddo=")]
[AppVeyorSecret(nameof(SlackWebhook), "xENxLITTR28hBLEY51YWMeHhxkhg1h1tLY1zGre1/hkmagda0rH4ZxOTbJ1bcmC3D6uhvJKLtSHqY7TK/48Nw3EbvN9wNFEt97HWYc9FE+g=")]
partial class Build
{
}
25 changes: 15 additions & 10 deletions build/Build.ReleaseImage.cs
Expand Up @@ -8,6 +8,7 @@
using System.Linq;
using Nuke.Common;
using Nuke.Common.IO;
using Nuke.Common.Tooling;
using Nuke.Common.Utilities.Collections;
using Serilog;
using SixLabors.Fonts;
Expand All @@ -20,11 +21,14 @@

partial class Build
{
[LatestGitHubRelease("JetBrains/JetBrainsMono", TrimPrefix = true)]
readonly string JetBrainsMonoVersion;

string[] FontDownloadUrls =>
new[]
{
"https://github.com/googlefonts/roboto/releases/latest/download/roboto-unhinted.zip",
"https://github.com/JetBrains/JetBrainsMono/releases/download/v1.0.6/JetBrainsMono-1.0.6.zip"
$"https://github.com/JetBrains/JetBrainsMono/releases/download/v{JetBrainsMonoVersion}/JetBrainsMono-{JetBrainsMonoVersion}.zip"
};

AbsolutePath FontDirectory => TemporaryDirectory / "fonts";
Expand Down Expand Up @@ -53,7 +57,8 @@ partial class Build
var logo = Image.Load(WatermarkImageFile);
logo.Mutate(x => x.Resize((int) (logo.Width * logoScaling), (int) (logo.Height * logoScaling)));
var robotoFont = FontCollection.Families.Single(x => x.Name == "Roboto Black");
var thinFont = FontCollection.Families.Single(x => x.Name == "JetBrains Mono Thin");
var boldFont = FontCollection.Families.Single(x => x.Name == "JetBrains Mono ExtraBold");
var graphicsOptions =
new DrawingOptions
{
Expand All @@ -69,21 +74,21 @@ partial class Build
var image = new Image<Rgba64>(width: width, height: height);
image.Mutate(x => x
.BackgroundColor(Color.FromRgb(r: 25, g: 25, b: 25))
.DrawImage(
logo,
location: new Point(image.Width / 2 - logo.Width / 2, image.Height / 2 - logo.Height / 2),
opacity: 0.05f)
// .DrawImage(
// logo,
// location: new Point(image.Width / 2 - logo.Width / 2, image.Height / 2 - logo.Height / 2),
// opacity: 0.05f)
.DrawText(
text: "New Release".ToUpperInvariant(),
font: robotoFont.CreateFont(70),
font: thinFont.CreateFont(100),
color: Color.WhiteSmoke,
location: new PointF(image.Width / 2f, image.Height / 2f - 100),
location: new PointF(image.Width / 2f, image.Height / 2f - 120),
options: graphicsOptions)
.DrawText(
text: MajorMinorPatchVersion,
font: robotoFont.CreateFont(180),
font: boldFont.CreateFont(230),
color: Color.WhiteSmoke,
location: new PointF(image.Width / 2f, image.Height / 2f),
location: new PointF(image.Width / 2f, image.Height / 2f + 60),
options: graphicsOptions));
using var fileStream = new FileStream(ReleaseImageFile, FileMode.Create);
Expand Down
3 changes: 3 additions & 0 deletions source/Nuke.Common.Tests/PathConstructionTest.cs
Expand Up @@ -38,7 +38,10 @@ public void TestEquality(string path1, string path2, bool expected)
[InlineData("C:\\A\\B\\C", "C:\\A\\B", "..")]
[InlineData("C:\\A\\B\\", "C:\\A\\B\\C", "C")]
[InlineData("C:\\A\\B\\C", "C:\\A\\B\\D\\E", "..\\D\\E")]
[InlineData("C:\\A\\B\\C\\B", "C:\\A\\B\\D\\B", "..\\..\\D\\B")]
[InlineData("/bin/etc", "/bin/tmp", "../tmp")]
[InlineData("/bin/etc/bin", "/bin/tmp/bin", "../../tmp/bin")]
[InlineData("/same1/diff1/same2", "/diff1/diff2/same2", "../../../diff1/diff2/same2")]
public void TestGetRelativePath(string basePath, string destinationPath, string expected)
{
GetRelativePath(basePath, destinationPath).Should().Be(expected);
Expand Down
Expand Up @@ -115,7 +115,7 @@ private void Write(string text, SystemConsoleThemeStyle style)
() =>
{
Console.ForegroundColor = style.Foreground ?? previousForeground;
Console.ForegroundColor = style.Background ?? previousBackground;
Console.BackgroundColor = style.Background ?? previousBackground;
},
() =>
{
Expand Down
2 changes: 1 addition & 1 deletion source/Nuke.Common/IO/PathConstruction.cs
Expand Up @@ -110,7 +110,7 @@ public static string GetRelativePath(string basePath, string destinationPath, bo
var destinationParts = destinationPath.Split(new[] { separator }, StringSplitOptions.RemoveEmptyEntries);

var sameParts = baseParts.Zip(destinationParts, (a, b) => new { Base = a, Destination = b })
.Count(x => x.Base.EqualsOrdinalIgnoreCase(x.Destination));
.TakeWhile(x => x.Base.EqualsOrdinalIgnoreCase(x.Destination)).Count();
return Enumerable.Repeat("..", baseParts.Length - sameParts).ToList()
.Concat(destinationParts.Skip(sameParts).ToList()).Join(separator);
}
Expand Down

0 comments on commit e20ab8d

Please sign in to comment.