From 4ae9299d84558a872218eabbe4709954f4bdb449 Mon Sep 17 00:00:00 2001 From: Matthias Koch Date: Tue, 22 Aug 2023 00:32:47 +0200 Subject: [PATCH 01/13] chore: remove ITweetTips --- source/Nuke.Components/ITweetTips.cs | 72 ------------------- source/Nuke.Components/Nuke.Components.csproj | 4 -- 2 files changed, 76 deletions(-) delete mode 100644 source/Nuke.Components/ITweetTips.cs diff --git a/source/Nuke.Components/ITweetTips.cs b/source/Nuke.Components/ITweetTips.cs deleted file mode 100644 index ad52cd646..000000000 --- a/source/Nuke.Components/ITweetTips.cs +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright 2023 Maintainers of NUKE. -// Distributed under the MIT License. -// https://github.com/nuke-build/nuke/blob/master/LICENSE - -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using JetBrains.Annotations; -using Nuke.Common; -using Nuke.Common.IO; -using Nuke.Common.Utilities; -using Serilog; -using Tweetinvi; -using Tweetinvi.Models; -using Tweetinvi.Parameters; - -namespace Nuke.Components; - -[PublicAPI] -public interface ITweetTips : IHazTwitterCredentials -{ - AbsolutePath TweetDirectory { get; } - - Target Tweet => _ => _ - .Requires(() => ConsumerKey) - .Requires(() => ConsumerSecret) - .Requires(() => AccessToken) - .Requires(() => AccessTokenSecret) - .Executes(async () => - { - var client = new TwitterClient( - new TwitterCredentials( - ConsumerKey, - ConsumerSecret, - AccessToken, - AccessTokenSecret)); - - var tweetDirectories = TweetDirectory.GlobDirectories("*").OrderBy(x => (string) x).ToList(); - var index = (int) (DateTime.Now.Ticks / TimeSpan.FromDays(7).Ticks) % tweetDirectories.Count; - var tweetDirectory = tweetDirectories.Last(); - - var sentTweets = new List(); - var sortedTweets = tweetDirectory.GlobFiles("*.md").OrderBy(x => (string) x); - foreach (var tweetFile in sortedTweets) - { - var part = Path.GetFileNameWithoutExtension(tweetFile); - var text = tweetFile.ReadAllText(); - var media = tweetDirectory.GlobFiles($"{part}*.png", $"{part}*.jpeg", $"{part}*.jpg", $"{part}*.gif") - .Select(async x => await client.Upload.UploadTweetImageAsync( - new UploadTweetImageParameters(x.ReadAllBytes()) - { - MediaCategory = x.ToString().EndsWithOrdinalIgnoreCase("gif") - ? MediaCategory.Gif - : MediaCategory.Image - })) - .Select(x => x.Result).ToList(); - - var tweetParameters = new PublishTweetParameters - { - InReplyToTweetId = sentTweets.LastOrDefault()?.Id, - Text = text, - Medias = media - }; - - var tweet = await client.Tweets.PublishTweetAsync(tweetParameters); - sentTweets.Add(tweet); - } - - Log.Information("Sent tweet {Url}", sentTweets.First().Url); - }); -} diff --git a/source/Nuke.Components/Nuke.Components.csproj b/source/Nuke.Components/Nuke.Components.csproj index e6f801f96..890d2cbdc 100644 --- a/source/Nuke.Components/Nuke.Components.csproj +++ b/source/Nuke.Components/Nuke.Components.csproj @@ -8,8 +8,4 @@ - - - - From 9670da7a33ed7187f9d7580dedec88c4dcd75f66 Mon Sep 17 00:00:00 2001 From: Matthias Koch Date: Tue, 22 Aug 2023 00:36:19 +0200 Subject: [PATCH 02/13] ci: proceed after announcement failures --- build/Build.Announce.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/build/Build.Announce.cs b/build/Build.Announce.cs index 445b48a93..58481beab 100644 --- a/build/Build.Announce.cs +++ b/build/Build.Announce.cs @@ -78,10 +78,12 @@ partial class Build ("Amazon Web Services", "https://aws.amazon.com/"), }; + // https://api.slack.com/apps/A050ZLH0V40/incoming-webhooks? [Parameter] [Secret] readonly string SlackWebhook; Target AnnounceSlack => _ => _ .TriggeredBy(Announce) + .ProceedAfterFailure() .Requires(() => SlackWebhook) .Executes(async () => { @@ -105,10 +107,12 @@ await SendSlackMessageAsync(_ => _ SlackWebhook); }); + // Server settings | Apps | Integrations | Webhooks | NUKE [Parameter] [Secret] readonly string DiscordWebhook; Target AnnounceDiscord => _ => _ .TriggeredBy(Announce) + .ProceedAfterFailure() .Requires(() => DiscordWebhook) .Executes(async () => { @@ -143,6 +147,7 @@ await SendDiscordMessageAsync(_ => _ Target AnnounceTwitter => _ => _ .TriggeredBy(Announce) + .ProceedAfterFailure() .Requires(() => TwitterCredentials.ConsumerKey) .Requires(() => TwitterCredentials.ConsumerSecret) .Requires(() => TwitterCredentials.AccessToken) @@ -171,10 +176,12 @@ await client.Tweets.PublishTweetAsync( }); string AnnouncementTootText => AnnouncementTweetText; + // https://dotnet.social/settings/applications/496 [Parameter] [Secret] readonly string MastodonAccessToken; Target AnnounceMastodon => _ => _ .TriggeredBy(Announce) + .ProceedAfterFailure() .Requires(() => MastodonAccessToken) .Executes(async () => { From c236f36cb51d453967c8367c6b5e031b8cc8d0dc Mon Sep 17 00:00:00 2001 From: Matthias Koch Date: Tue, 22 Aug 2023 00:45:57 +0200 Subject: [PATCH 03/13] ci: switch from Tweetinvi to LinqToTwitter --- build/Build.Announce.cs | 37 ++++++++++++++++++------------------- build/_build.csproj | 1 + 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/build/Build.Announce.cs b/build/Build.Announce.cs index 58481beab..c3a09433f 100644 --- a/build/Build.Announce.cs +++ b/build/Build.Announce.cs @@ -6,6 +6,8 @@ using System.Collections.Generic; using System.Linq; using System.Text; +using LinqToTwitter; +using LinqToTwitter.OAuth; using Nuke.Common; using Nuke.Common.ChangeLog; using Nuke.Common.Git; @@ -16,9 +18,6 @@ using Nuke.Common.Tools.Slack; using Nuke.Common.Utilities; using Nuke.Components; -using Tweetinvi; -using Tweetinvi.Models; -using Tweetinvi.Parameters; using static Nuke.Common.Tools.Discord.DiscordTasks; using static Nuke.Common.Tools.Git.GitTasks; using static Nuke.Common.Tools.Mastodon.MastodonTasks; @@ -154,25 +153,25 @@ await SendDiscordMessageAsync(_ => _ .Requires(() => TwitterCredentials.AccessTokenSecret) .Executes(async () => { - var client = new TwitterClient( - new TwitterCredentials( - TwitterCredentials.ConsumerKey, - TwitterCredentials.ConsumerSecret, - TwitterCredentials.AccessToken, - TwitterCredentials.AccessTokenSecret)); - - var media = await client.Upload.UploadTweetImageAsync( - new UploadTweetImageParameters(ReleaseImageFile.ReadAllBytes()) + var context = new TwitterContext( + new SingleUserAuthorizer { - MediaCategory = MediaCategory.Image + CredentialStore = + new SingleUserInMemoryCredentialStore + { + ConsumerKey = TwitterCredentials.ConsumerKey, + ConsumerSecret = TwitterCredentials.ConsumerSecret, + AccessToken = TwitterCredentials.AccessToken, + AccessTokenSecret = TwitterCredentials.AccessTokenSecret + } }); - await client.Tweets.PublishTweetAsync( - new PublishTweetParameters - { - Text = AnnouncementTweetText, - Medias = new List { media } - }); + var media = await context.UploadMediaAsync( + media: ReleaseImageFile.ReadAllBytes(), + mediaType: "image/png", + mediaCategory: "tweet_image"); + + await context.TweetMediaAsync(AnnouncementTweetText, mediaIds: new[] { media.NotNull().MediaID.ToString() }); }); string AnnouncementTootText => AnnouncementTweetText; diff --git a/build/_build.csproj b/build/_build.csproj index 228f882be..a335ad710 100644 --- a/build/_build.csproj +++ b/build/_build.csproj @@ -52,6 +52,7 @@ + From 0375422fe0764d9fa7bddb7b9e9e2a660f4d5d72 Mon Sep 17 00:00:00 2001 From: Matthias Koch Date: Tue, 22 Aug 2023 00:46:27 +0200 Subject: [PATCH 04/13] chore: update Twitter credentials --- appveyor.yml | 8 ++++---- build/Build.CI.AppVeyor.cs | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 2c9b2f882..3c2516244 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -41,13 +41,13 @@ environment: SignPathApiToken: secure: uQTH2MxpqiqWTy7EJkjtNc43ipG17EUOQN99QsODRNgtNEcikDaP0t4ylekK/ibn TwitterConsumerKey: - secure: mYr1Uw8bcVUyl1P0prdaUFurdiF7V283BSRlQHxe2Zg= + secure: T61zL4r+xtyj7b0aOGYCsyixrXHooXE759T8z3M67Lw= TwitterConsumerSecret: - secure: pGt5X6KOwj/bLM4A5mnDRBqPxt7o7UreSlZSFmbfZwyfKZnhfFRnr20fXWjVqToVw7NSp30s6GxjswTrQSIogw== + secure: CZwdlO4PHT51Xr0Pe/mT6WpfBzQXsL0C3yWfHgXqdYrf22rx8ePEt5qpszWckbHE5Vh5ErtVfIAQgLeFrqe2Gg== TwitterAccessToken: - secure: nnv1h5nkNm4MS50soQHiYUZLERgkft/ooq73B02sLValeUDZFypI3tk1TzUwACzJPOdjqRSvY9efvQbt2MoNaQ== + secure: nnv1h5nkNm4MS50soQHiYZk9hnPkWEMQP/5cdf6RJfDIL1gUYxLR7uBaAi1M4sswT0TQ7oL4TBIN/yziq33N5A== TwitterAccessTokenSecret: - secure: odqmaAfKaVzNj8Ph/q2sLVmM/1COuix8NoqtDwayr8KEli3kmtGFThrN4g5k6aKT + secure: /RrBl2p46rlgpzBHweWeD0spt3JNZDsM8vABoI9Ao29+Z9D4rUYvpM5oHUWA8Lb6 SlackWebhook: secure: xENxLITTR28hBLEY51YWMeHhxkhg1h1tLY1zGre1/hmM/XDRPsJCxvZvTHFhtfLsQ3cF7GQi3xDaShkVVR7zoXHsIYT+KT0zLnq9FSEvr5c= DiscordWebhook: diff --git a/build/Build.CI.AppVeyor.cs b/build/Build.CI.AppVeyor.cs index e91a2c584..51dd13e13 100644 --- a/build/Build.CI.AppVeyor.cs +++ b/build/Build.CI.AppVeyor.cs @@ -37,10 +37,10 @@ [AppVeyorSecret(nameof(PublicNuGetApiKey), "dSaquYHVNEAZO+hhGGoGqeHaVP99BP8koHTTqcD3WInWBTmB7yE4CzxZ1pWypnX2")] [AppVeyorSecret(ICreateGitHubRelease.GitHubRelease + nameof(ICreateGitHubRelease.GitHubToken), "a5UfxXiDEere9GkCCN9TUZMUdyzjC01cvHthbMLtSl0w+/giDwOyApiHRRRrwyKL5yd/vjD6xDBTBj+W/ZxKzMtzC+gDCSTNO8bSJG9Rh2n9eGzLtWzEFDw/zDYZXe5N")] [AppVeyorSecret(ISignPackages.SignPath + nameof(ISignPackages.ApiToken), "uQTH2MxpqiqWTy7EJkjtNc43ipG17EUOQN99QsODRNgtNEcikDaP0t4ylekK/ibn")] -[AppVeyorSecret(IHazTwitterCredentials.Twitter + nameof(IHazTwitterCredentials.ConsumerKey), "mYr1Uw8bcVUyl1P0prdaUFurdiF7V283BSRlQHxe2Zg=")] -[AppVeyorSecret(IHazTwitterCredentials.Twitter + nameof(IHazTwitterCredentials.ConsumerSecret), "pGt5X6KOwj/bLM4A5mnDRBqPxt7o7UreSlZSFmbfZwyfKZnhfFRnr20fXWjVqToVw7NSp30s6GxjswTrQSIogw==")] -[AppVeyorSecret(IHazTwitterCredentials.Twitter + nameof(IHazTwitterCredentials.AccessToken), "nnv1h5nkNm4MS50soQHiYUZLERgkft/ooq73B02sLValeUDZFypI3tk1TzUwACzJPOdjqRSvY9efvQbt2MoNaQ==")] -[AppVeyorSecret(IHazTwitterCredentials.Twitter + nameof(IHazTwitterCredentials.AccessTokenSecret), "odqmaAfKaVzNj8Ph/q2sLVmM/1COuix8NoqtDwayr8KEli3kmtGFThrN4g5k6aKT")] +[AppVeyorSecret(IHazTwitterCredentials.Twitter + nameof(IHazTwitterCredentials.ConsumerKey), "T61zL4r+xtyj7b0aOGYCsyixrXHooXE759T8z3M67Lw=")] +[AppVeyorSecret(IHazTwitterCredentials.Twitter + nameof(IHazTwitterCredentials.ConsumerSecret), "CZwdlO4PHT51Xr0Pe/mT6WpfBzQXsL0C3yWfHgXqdYrf22rx8ePEt5qpszWckbHE5Vh5ErtVfIAQgLeFrqe2Gg==")] +[AppVeyorSecret(IHazTwitterCredentials.Twitter + nameof(IHazTwitterCredentials.AccessToken), "nnv1h5nkNm4MS50soQHiYZk9hnPkWEMQP/5cdf6RJfDIL1gUYxLR7uBaAi1M4sswT0TQ7oL4TBIN/yziq33N5A==")] +[AppVeyorSecret(IHazTwitterCredentials.Twitter + nameof(IHazTwitterCredentials.AccessTokenSecret), "/RrBl2p46rlgpzBHweWeD0spt3JNZDsM8vABoI9Ao29+Z9D4rUYvpM5oHUWA8Lb6")] [AppVeyorSecret(nameof(SlackWebhook), "xENxLITTR28hBLEY51YWMeHhxkhg1h1tLY1zGre1/hmM/XDRPsJCxvZvTHFhtfLsQ3cF7GQi3xDaShkVVR7zoXHsIYT+KT0zLnq9FSEvr5c=")] [AppVeyorSecret(nameof(DiscordWebhook), "K5WG8m71vcB56C75b0ErFPLYTsqywhPy8hSn49uqc5XBE7txUnZqWBHfbWCuU9AdFkm3TNgSYLoejjF59OgiACEn45fghVe7XCwAXo2l54ZXl08MZyBkJ8by9HsZirL9W+SeysNdw/Cfc0sxKrWcpDkn1IH2zZ+iXAgqBsW2CNY=")] [AppVeyorSecret(nameof(MastodonAccessToken), "pD/C1TvhUnFtb0oLUvlf2NtjkWeZQcrUVvYJE/LgZb8nxagK8Lwk+OR7TUqOh+Nn")] From 04b84d6f4cf5a86370ae1dac46a871797fdaa1f8 Mon Sep 17 00:00:00 2001 From: Matthias Koch Date: Thu, 10 Aug 2023 02:56:14 +0200 Subject: [PATCH 05/13] fix(components): make ICreateGitHubRelease to fallback to existing release for distributed asset uploads --- .../Nuke.Components/ICreateGitHubRelease.cs | 36 +++++++++++++------ 1 file changed, 26 insertions(+), 10 deletions(-) diff --git a/source/Nuke.Components/ICreateGitHubRelease.cs b/source/Nuke.Components/ICreateGitHubRelease.cs index d9ceb75ae..429685e46 100644 --- a/source/Nuke.Components/ICreateGitHubRelease.cs +++ b/source/Nuke.Components/ICreateGitHubRelease.cs @@ -36,18 +36,34 @@ public interface ICreateGitHubRelease : IHazGitRepository, IHazChangelog .Requires(() => GitHubToken) .Executes(async () => { - GitHubTasks.GitHubClient.Credentials ??= new Credentials(GitHubToken.NotNull()); + async Task GetOrCreateRelease() + { + try + { + return await GitHubTasks.GitHubClient.Repository.Release.Create( + GitRepository.GetGitHubOwner(), + GitRepository.GetGitHubName(), + new NewRelease(Name) + { + Name = Name, + Prerelease = Prerelease, + Draft = Draft, + Body = ChangelogTasks.ExtractChangelogSectionNotes(ChangelogFile).JoinNewLine() + }); - var release = await GitHubTasks.GitHubClient.Repository.Release.Create( - GitRepository.GetGitHubOwner(), - GitRepository.GetGitHubName(), - new NewRelease(Name) + } + catch { - Name = Name, - Prerelease = Prerelease, - Draft = Draft, - Body = ChangelogTasks.ExtractChangelogSectionNotes(ChangelogFile).JoinNewLine() - }); + return await GitHubTasks.GitHubClient.Repository.Release.Get( + GitRepository.GetGitHubOwner(), + GitRepository.GetGitHubName(), + Name); + } + } + + GitHubTasks.GitHubClient.Credentials ??= new Credentials(GitHubToken.NotNull()); + + var release = await GetOrCreateRelease(); var uploadTasks = AssetFiles.Select(async x => { From 1478d02fe52cbe1ca1efd485d8a5640c8eed0dfc Mon Sep 17 00:00:00 2001 From: Matthias Koch Date: Tue, 22 Aug 2023 01:51:55 +0200 Subject: [PATCH 06/13] fix(components): set credentials unconditionally in ICreateGitHubRelease --- source/Nuke.Components/ICreateGitHubRelease.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/Nuke.Components/ICreateGitHubRelease.cs b/source/Nuke.Components/ICreateGitHubRelease.cs index 429685e46..5057b045f 100644 --- a/source/Nuke.Components/ICreateGitHubRelease.cs +++ b/source/Nuke.Components/ICreateGitHubRelease.cs @@ -61,7 +61,7 @@ async Task GetOrCreateRelease() } } - GitHubTasks.GitHubClient.Credentials ??= new Credentials(GitHubToken.NotNull()); + GitHubTasks.GitHubClient.Credentials = new Credentials(GitHubToken.NotNull()); var release = await GetOrCreateRelease(); From c74db2fbbeb11307830eb54ab1013d7298966e84 Mon Sep 17 00:00:00 2001 From: Matthias Koch Date: Tue, 22 Aug 2023 01:51:55 +0200 Subject: [PATCH 07/13] fix(execution): check if nullable parameter type is assignable to IAbsolutePathHolder --- .../ArgumentsFromParametersFileAttribute.cs | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/source/Nuke.Build/Execution/Extensions/ArgumentsFromParametersFileAttribute.cs b/source/Nuke.Build/Execution/Extensions/ArgumentsFromParametersFileAttribute.cs index b165d1e51..1a2b1c97d 100644 --- a/source/Nuke.Build/Execution/Extensions/ArgumentsFromParametersFileAttribute.cs +++ b/source/Nuke.Build/Execution/Extensions/ArgumentsFromParametersFileAttribute.cs @@ -6,10 +6,10 @@ using System.Collections.Generic; using System.IO; using System.Linq; +using JetBrains.Annotations; using Newtonsoft.Json.Linq; using Nuke.Common.CI; using Nuke.Common.IO; -using Nuke.Common.ProjectModel; using Nuke.Common.Utilities; using Nuke.Common.Utilities.Collections; using Nuke.Common.ValueInjection; @@ -48,11 +48,10 @@ string DecryptValue(string profile, string name, string value) name); // TODO: Abstract AbsolutePath/Solution/Project etc. - string ConvertValue(Type scalarType, string value) - => scalarType.IsAssignableTo(typeof(IAbsolutePathHolder)) - ? PathConstruction.HasPathRoot(value) - ? value - : EnvironmentInfo.WorkingDirectory.GetUnixRelativePathTo(Build.RootDirectory / value) + string ConvertValue([CanBeNull] Type scalarType, string value) + => typeof(IAbsolutePathHolder).IsAssignableFrom(scalarType) && + !PathConstruction.HasPathRoot(value) + ? EnvironmentInfo.WorkingDirectory.GetUnixRelativePathTo(Build.RootDirectory / value) : value; var arguments = GetParameters().SelectMany(x => ConvertToArguments(x.Profile, x.Name, x.Values)).ToArray(); From 463327cbcb6a68ae841951d76c690792f74d2d96 Mon Sep 17 00:00:00 2001 From: Matthias Koch Date: Thu, 31 Aug 2023 21:12:15 +0200 Subject: [PATCH 08/13] fix(telemetry): home directory postfix --- source/Nuke.Build/Telemetry/Telemetry.Properties.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/Nuke.Build/Telemetry/Telemetry.Properties.cs b/source/Nuke.Build/Telemetry/Telemetry.Properties.cs index f980b17a8..8904dd6ef 100644 --- a/source/Nuke.Build/Telemetry/Telemetry.Properties.cs +++ b/source/Nuke.Build/Telemetry/Telemetry.Properties.cs @@ -126,7 +126,7 @@ private static bool IsCommonType(Type type) { return type.Assembly .GetCustomAttributes() - .Any(x => x is { Key: "RepositoryUrl", Value: "https://github.com/nuke-build/nuke" }); + .Any(x => x is { Key: "RepositoryUrl", Value: "https://github.com/nuke-build/nuke.git" }); } private static bool IsCustomType(Type type) From 3f4af87596439b3430bb9e70ce6bb91a74a155da Mon Sep 17 00:00:00 2001 From: Oleg Shevchenko Date: Wed, 30 Aug 2023 15:24:46 -0700 Subject: [PATCH 09/13] fix(cicd): missing AppVeyor environment variables (#1243) --- source/Nuke.Common/CI/AppVeyor/AppVeyor.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/source/Nuke.Common/CI/AppVeyor/AppVeyor.cs b/source/Nuke.Common/CI/AppVeyor/AppVeyor.cs index e9f7e11f8..11ea4760a 100644 --- a/source/Nuke.Common/CI/AppVeyor/AppVeyor.cs +++ b/source/Nuke.Common/CI/AppVeyor/AppVeyor.cs @@ -67,6 +67,9 @@ internal AppVeyor() public string BuildWorkerImage => EnvironmentInfo.GetVariable("APPVEYOR_BUILD_WORKER_IMAGE"); [CanBeNull] public int? PullRequestNumber => EnvironmentInfo.GetVariable("APPVEYOR_PULL_REQUEST_NUMBER"); [CanBeNull] public string PullRequestTitle => EnvironmentInfo.GetVariable("APPVEYOR_PULL_REQUEST_TITLE"); + [CanBeNull] public string PullRequestHeadRepositoryName => EnvironmentInfo.GetVariable("APPVEYOR_PULL_REQUEST_HEAD_REPO_NAME"); + [CanBeNull] public string PullRequestHeadRepositoryBranch => EnvironmentInfo.GetVariable("APPVEYOR_PULL_REQUEST_HEAD_REPO_BRANCH"); + [CanBeNull] public string PullRequestHeadCommit => EnvironmentInfo.GetVariable("APPVEYOR_PULL_REQUEST_HEAD_COMMIT"); public string JobId => EnvironmentInfo.GetVariable("APPVEYOR_JOB_ID"); [CanBeNull] public string JobName => EnvironmentInfo.GetVariable("APPVEYOR_JOB_NAME"); public int JobNumber => EnvironmentInfo.GetVariable("APPVEYOR_JOB_NUMBER"); From 0c3e9c37786bce30bc2d1c9a43638cd8b54cf06c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Kopa=C5=84ski?= <130975497+kkopanski@users.noreply.github.com> Date: Thu, 31 Aug 2023 21:14:49 +0200 Subject: [PATCH 10/13] fix(tools): UnityRunTestsSettings base type (#1234) --- source/Nuke.Common/Tools/Unity/Unity.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/Nuke.Common/Tools/Unity/Unity.json b/source/Nuke.Common/Tools/Unity/Unity.json index deff95cd0..353fb1762 100644 --- a/source/Nuke.Common/Tools/Unity/Unity.json +++ b/source/Nuke.Common/Tools/Unity/Unity.json @@ -166,7 +166,7 @@ "customAssertion": true, "definiteArgument": "-runTests", "settingsClass": { - "baseClass": "UnityBaseSettings", + "baseClass": "UnityProjectSettings", "properties": [ { "name": "TestCategories", From d8d68cf356bf6114446ecad117f8593d0bb46d9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Kopa=C5=84ski?= <130975497+kkopanski@users.noreply.github.com> Date: Thu, 31 Aug 2023 21:16:19 +0200 Subject: [PATCH 11/13] fix(tools): SetBuildTarget and SetTestPlatform overloads in UnityTasks (#1232) --- .../Tools/Unity/UnityProjectSettingsExtensions.cs | 8 +++----- .../Unity/UnityRunTestsSettingsExtensions.cs | 15 ++++++--------- 2 files changed, 9 insertions(+), 14 deletions(-) diff --git a/source/Nuke.Common/Tools/Unity/UnityProjectSettingsExtensions.cs b/source/Nuke.Common/Tools/Unity/UnityProjectSettingsExtensions.cs index dfa84db84..fe4533d5c 100644 --- a/source/Nuke.Common/Tools/Unity/UnityProjectSettingsExtensions.cs +++ b/source/Nuke.Common/Tools/Unity/UnityProjectSettingsExtensions.cs @@ -5,7 +5,6 @@ using System; using System.Linq; using JetBrains.Annotations; -using Nuke.Common.Tooling; namespace Nuke.Common.Tools.Unity; @@ -15,11 +14,10 @@ public static partial class UnityProjectSettingsExtensions ///

Sets .

Allows the selection of an active build target before a project is loaded.

[Pure] - public static UnityProjectSettings SetBuildTarget(this UnityProjectSettings toolSettings, UnityBuildTarget buildTarget) + public static T SetBuildTarget(this T toolSettings, UnityBuildTarget buildTarget) + where T : UnityProjectSettings { - toolSettings = toolSettings.NewInstance(); - toolSettings.BuildTarget = buildTarget.ToString(); - return toolSettings; + return toolSettings.SetBuildTarget(buildTarget.ToString()); } #endregion diff --git a/source/Nuke.Common/Tools/Unity/UnityRunTestsSettingsExtensions.cs b/source/Nuke.Common/Tools/Unity/UnityRunTestsSettingsExtensions.cs index e603ea4b7..ce2957c09 100644 --- a/source/Nuke.Common/Tools/Unity/UnityRunTestsSettingsExtensions.cs +++ b/source/Nuke.Common/Tools/Unity/UnityRunTestsSettingsExtensions.cs @@ -5,7 +5,6 @@ using System; using System.Linq; using JetBrains.Annotations; -using Nuke.Common.Tooling; namespace Nuke.Common.Tools.Unity; @@ -18,11 +17,10 @@ public static partial class UnityRunTestsSettingsExtensions ///

The platform to run tests on.

/// [Pure] - public static UnityRunTestsSettings SetTestPlatform(this UnityRunTestsSettings toolSettings, UnityTestPlatform testPlatform) + public static T SetTestPlatform(this T toolSettings, UnityTestPlatform testPlatform) + where T : UnityRunTestsSettings { - toolSettings = toolSettings.NewInstance(); - toolSettings.TestPlatform = testPlatform.ToString(); - return toolSettings; + return toolSettings.SetTestPlatform(testPlatform.ToString()); } /// @@ -30,11 +28,10 @@ public static UnityRunTestsSettings SetTestPlatform(this UnityRunTestsSettings t ///

The platform to run tests on.

///
[Pure] - public static UnityRunTestsSettings SetTestPlatform(this UnityRunTestsSettings toolSettings, UnityBuildTarget buildTarget) + public static T SetTestPlatform(this T toolSettings, UnityBuildTarget buildTarget) + where T : UnityRunTestsSettings { - toolSettings = toolSettings.NewInstance(); - toolSettings.TestPlatform = buildTarget.ToString(); - return toolSettings; + return toolSettings.SetTestPlatform(buildTarget.ToString()); } #endregion From 082e5c8738753c6b095c47167932bba4012a16f3 Mon Sep 17 00:00:00 2001 From: Matthias Koch Date: Thu, 31 Aug 2023 21:19:57 +0200 Subject: [PATCH 12/13] chore: regenerate tools --- source/Nuke.Common/Tools/Unity/Unity.Generated.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/Nuke.Common/Tools/Unity/Unity.Generated.cs b/source/Nuke.Common/Tools/Unity/Unity.Generated.cs index 155f2351d..7d1d387a3 100644 --- a/source/Nuke.Common/Tools/Unity/Unity.Generated.cs +++ b/source/Nuke.Common/Tools/Unity/Unity.Generated.cs @@ -752,7 +752,7 @@ protected override Arguments ConfigureProcessArguments(Arguments arguments) [PublicAPI] [ExcludeFromCodeCoverage] [Serializable] -public partial class UnityRunTestsSettings : UnityBaseSettings +public partial class UnityRunTestsSettings : UnityProjectSettings { /// /// Path to the Unity executable. From d7ccb872604bb7e87f52b7fee5188e14bc2440f3 Mon Sep 17 00:00:00 2001 From: Matthias Koch Date: Thu, 31 Aug 2023 21:26:49 +0200 Subject: [PATCH 13/13] chore: CHANGELOG.md for 7.0.4 --- CHANGELOG.md | 109 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 109 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f9e154a08..58b3a31b4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,15 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [vNext] +## [7.0.4] / 2023-08-31 +- Fixed check on nullable parameter type +- Fixed telemetry check on home repository +- Fixed missing environment variables for AppVeyor +- Fixed `ICreateGitHubRelease` to work with existing releases +- Fixed `ICreateGitHubRelease` to set `GitHubToken` unconditionally +- Fixed `SetBuildTarget` and `SetTestPlatform` overloads in `UnityTasks` +- Fixed `UnityRunTestsSettings` base type + ## [7.0.3] / 2023-08-21 - Fixed enumeration value sets to exclude non-public fields - Fixed check for `NUKE_ENTERPRISE_TOKEN` in `build.sh` bootstrapping script @@ -1474,3 +1483,103 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. [0.3.1]: https://github.com/nuke-build/nuke/compare/0.2.10...0.3.1 [0.2.10]: https://github.com/nuke-build/nuke/compare/0.2.0...0.2.10 [0.2.0]: https://github.com/nuke-build/nuke/tree/0.2.0 + +[vNext]: https://github.com/nuke-build/nuke/compare/7.0.4...HEAD +[7.0.4]: https://github.com/nuke-build/nuke/compare/7.0.3...7.0.4 +[7.0.3]: https://github.com/nuke-build/nuke/compare/7.0.2...7.0.3 +[7.0.2]: https://github.com/nuke-build/nuke/compare/7.0.1...7.0.2 +[7.0.1]: https://github.com/nuke-build/nuke/compare/7.0.0...7.0.1 +[7.0.0]: https://github.com/nuke-build/nuke/compare/6.3.0...7.0.0 +[6.3.0]: https://github.com/nuke-build/nuke/compare/6.2.1...6.3.0 +[6.2.1]: https://github.com/nuke-build/nuke/compare/6.2.0...6.2.1 +[6.2.0]: https://github.com/nuke-build/nuke/compare/6.1.2...6.2.0 +[6.1.2]: https://github.com/nuke-build/nuke/compare/6.1.1...6.1.2 +[6.1.1]: https://github.com/nuke-build/nuke/compare/6.1.0...6.1.1 +[6.1.0]: https://github.com/nuke-build/nuke/compare/6.0.3...6.1.0 +[6.0.3]: https://github.com/nuke-build/nuke/compare/6.0.2...6.0.3 +[6.0.2]: https://github.com/nuke-build/nuke/compare/6.0.1...6.0.2 +[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 +[5.2.0]: https://github.com/nuke-build/nuke/compare/5.1.4...5.2.0 +[5.1.4]: https://github.com/nuke-build/nuke/compare/5.1.3...5.1.4 +[5.1.3]: https://github.com/nuke-build/nuke/compare/5.1.2...5.1.3 +[5.1.2]: https://github.com/nuke-build/nuke/compare/5.1.1...5.1.2 +[5.1.1]: https://github.com/nuke-build/nuke/compare/5.1.0...5.1.1 +[5.1.0]: https://github.com/nuke-build/nuke/compare/5.0.2...5.1.0 +[5.0.2]: https://github.com/nuke-build/nuke/compare/5.0.1...5.0.2 +[5.0.1]: https://github.com/nuke-build/nuke/compare/5.0.0...5.0.1 +[5.0.0]: https://github.com/nuke-build/nuke/compare/0.25.0...5.0.0 +[0.25.0]: https://github.com/nuke-build/nuke/compare/0.24.11...0.25.0 +[0.24.11]: https://github.com/nuke-build/nuke/compare/0.24.10...0.24.11 +[0.24.10]: https://github.com/nuke-build/nuke/compare/0.24.9...0.24.10 +[0.24.9]: https://github.com/nuke-build/nuke/compare/0.24.8...0.24.9 +[0.24.8]: https://github.com/nuke-build/nuke/compare/0.24.7...0.24.8 +[0.24.7]: https://github.com/nuke-build/nuke/compare/0.24.6...0.24.7 +[0.24.6]: https://github.com/nuke-build/nuke/compare/0.24.5...0.24.6 +[0.24.5]: https://github.com/nuke-build/nuke/compare/0.24.4...0.24.5 +[0.24.4]: https://github.com/nuke-build/nuke/compare/0.24.2...0.24.4 +[0.24.2]: https://github.com/nuke-build/nuke/compare/0.24.1...0.24.2 +[0.24.1]: https://github.com/nuke-build/nuke/compare/0.24.0...0.24.1 +[0.24.0]: https://github.com/nuke-build/nuke/compare/0.23.7...0.24.0 +[0.23.7]: https://github.com/nuke-build/nuke/compare/0.23.6...0.23.7 +[0.23.6]: https://github.com/nuke-build/nuke/compare/0.23.5...0.23.6 +[0.23.5]: https://github.com/nuke-build/nuke/compare/0.23.4...0.23.5 +[0.23.4]: https://github.com/nuke-build/nuke/compare/0.23.3...0.23.4 +[0.23.3]: https://github.com/nuke-build/nuke/compare/0.23.2...0.23.3 +[0.23.2]: https://github.com/nuke-build/nuke/compare/0.23.1...0.23.2 +[0.23.1]: https://github.com/nuke-build/nuke/compare/0.23.0...0.23.1 +[0.23.0]: https://github.com/nuke-build/nuke/compare/0.22.2...0.23.0 +[0.22.2]: https://github.com/nuke-build/nuke/compare/0.22.1...0.22.2 +[0.22.1]: https://github.com/nuke-build/nuke/compare/0.22.0...0.22.1 +[0.22.0]: https://github.com/nuke-build/nuke/compare/0.21.2...0.22.0 +[0.21.2]: https://github.com/nuke-build/nuke/compare/0.21.1...0.21.2 +[0.21.1]: https://github.com/nuke-build/nuke/compare/0.21.0...0.21.1 +[0.21.0]: https://github.com/nuke-build/nuke/compare/0.20.1...0.21.0 +[0.20.1]: https://github.com/nuke-build/nuke/compare/0.20.0...0.20.1 +[0.20.0]: https://github.com/nuke-build/nuke/compare/0.19.2...0.20.0 +[0.19.2]: https://github.com/nuke-build/nuke/compare/0.19.1...0.19.2 +[0.19.1]: https://github.com/nuke-build/nuke/compare/0.19.0...0.19.1 +[0.19.0]: https://github.com/nuke-build/nuke/compare/0.18.0...0.19.0 +[0.18.0]: https://github.com/nuke-build/nuke/compare/0.17.7...0.18.0 +[0.17.7]: https://github.com/nuke-build/nuke/compare/0.17.6...0.17.7 +[0.17.6]: https://github.com/nuke-build/nuke/compare/0.17.5...0.17.6 +[0.17.5]: https://github.com/nuke-build/nuke/compare/0.17.4...0.17.5 +[0.17.4]: https://github.com/nuke-build/nuke/compare/0.17.3...0.17.4 +[0.17.3]: https://github.com/nuke-build/nuke/compare/0.17.2...0.17.3 +[0.17.2]: https://github.com/nuke-build/nuke/compare/0.17.1...0.17.2 +[0.17.1]: https://github.com/nuke-build/nuke/compare/0.17.0...0.17.1 +[0.17.0]: https://github.com/nuke-build/nuke/compare/0.16.0...0.17.0 +[0.16.0]: https://github.com/nuke-build/nuke/compare/0.15.0...0.16.0 +[0.15.0]: https://github.com/nuke-build/nuke/compare/0.14.1...0.15.0 +[0.14.1]: https://github.com/nuke-build/nuke/compare/0.14.0...0.14.1 +[0.14.0]: https://github.com/nuke-build/nuke/compare/0.13.0...0.14.0 +[0.13.0]: https://github.com/nuke-build/nuke/compare/0.12.4...0.13.0 +[0.12.4]: https://github.com/nuke-build/nuke/compare/0.12.3...0.12.4 +[0.12.3]: https://github.com/nuke-build/nuke/compare/0.12.2...0.12.3 +[0.12.2]: https://github.com/nuke-build/nuke/compare/0.12.1...0.12.2 +[0.12.1]: https://github.com/nuke-build/nuke/compare/0.12.0...0.12.1 +[0.12.0]: https://github.com/nuke-build/nuke/compare/0.11.1...0.12.0 +[0.11.1]: https://github.com/nuke-build/nuke/compare/0.11.0...0.11.1 +[0.11.0]: https://github.com/nuke-build/nuke/compare/0.10.5...0.11.0 +[0.10.5]: https://github.com/nuke-build/nuke/compare/0.10.4...0.10.5 +[0.10.4]: https://github.com/nuke-build/nuke/compare/0.10.3...0.10.4 +[0.10.3]: https://github.com/nuke-build/nuke/compare/0.10.2...0.10.3 +[0.10.2]: https://github.com/nuke-build/nuke/compare/0.10.1...0.10.2 +[0.10.1]: https://github.com/nuke-build/nuke/compare/0.10.0...0.10.1 +[0.10.0]: https://github.com/nuke-build/nuke/compare/0.9.1...0.10.0 +[0.9.1]: https://github.com/nuke-build/nuke/compare/0.9.0...0.9.1 +[0.9.0]: https://github.com/nuke-build/nuke/compare/0.8.0...0.9.0 +[0.8.0]: https://github.com/nuke-build/nuke/compare/0.7.0...0.8.0 +[0.7.0]: https://github.com/nuke-build/nuke/compare/0.6.2...0.7.0 +[0.6.2]: https://github.com/nuke-build/nuke/compare/0.6.1...0.6.2 +[0.6.1]: https://github.com/nuke-build/nuke/compare/0.6.0...0.6.1 +[0.6.0]: https://github.com/nuke-build/nuke/compare/0.5.3...0.6.0 +[0.5.3]: https://github.com/nuke-build/nuke/compare/0.5.2...0.5.3 +[0.5.2]: https://github.com/nuke-build/nuke/compare/0.5.0...0.5.2 +[0.5.0]: https://github.com/nuke-build/nuke/compare/0.4.0...0.5.0 +[0.4.0]: https://github.com/nuke-build/nuke/compare/0.3.1...0.4.0 +[0.3.1]: https://github.com/nuke-build/nuke/compare/0.2.10...0.3.1 +[0.2.10]: https://github.com/nuke-build/nuke/compare/0.2.0...0.2.10 +[0.2.0]: https://github.com/nuke-build/nuke/tree/0.2.0