Skip to content

Commit 72c77bf

Browse files
committed
Merge branch 'develop'
2 parents c4b3973 + 7311867 commit 72c77bf

File tree

10 files changed

+78
-32
lines changed

10 files changed

+78
-32
lines changed

.nuke/build.schema.json

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,21 @@
1313
"type": "boolean",
1414
"description": "Indicates to continue a previously failed build attempt"
1515
},
16+
"DanglCiCdTeamsWebhookUrl": {
17+
"type": "string"
18+
},
19+
"DanglPublicFeedSource": {
20+
"type": "string"
21+
},
22+
"DocuBaseUrl": {
23+
"type": "string"
24+
},
25+
"FeedzAccessToken": {
26+
"type": "string"
27+
},
28+
"GitHubAuthenticationToken": {
29+
"type": "string"
30+
},
1631
"Help": {
1732
"type": "boolean",
1833
"description": "Shows the help text for this build assembly"
@@ -54,6 +69,15 @@
5469
"type": "boolean",
5570
"description": "Disables displaying the NUKE logo"
5671
},
72+
"NuGetApiKey": {
73+
"type": "string"
74+
},
75+
"NukeGitHubDocuApiKey": {
76+
"type": "string"
77+
},
78+
"NukeWebDocuDocuApiKey": {
79+
"type": "string"
80+
},
5781
"Partition": {
5882
"type": "string",
5983
"description": "Partition to use on CI"

CHANGELOG_GitHub.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
All notable changes to **Nuke.GitHub** are documented here.
44

5+
## v5.0.1:
6+
- Update logging to indicate if publishing a release is skipped due to it already existing
7+
58
## v5.0.0:
69
- Update NUKE to v7
710
- Version alignment with **Nuke.WebDocu**

GitVersion.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
assembly-versioning-scheme: MajorMinorPatch
22
assembly-file-versioning-scheme: MajorMinorPatch
33
mode: Mainline
4-
next-version: 5.0.0
54

65
branches:
76
master:

README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,17 +45,22 @@ All builds are available on MyGet:
4545
.OnlyWhen(() => GitVersion.BranchName.Equals("master") || GitVersion.BranchName.Equals("origin/master"))
4646
.Executes<Task>(async () =>
4747
{
48+
// You'll create a tag for the release, e.g. v1.0.0
4849
var releaseTag = $"v{GitVersion.MajorMinorPatch}";
4950

51+
// We also want to fill the changelog with the latest release notes,
52+
// so we're just reading from a markdown file containing the changelog.
5053
// Not providing the second, optional parameter gives the latest section
51-
var changeLogSectionEntries = ExtractChangelogSectionNotes(ChangeLogFile);
54+
var changeLogSectionEntries = Nuke.Common.ChangeLog.ExtractChangelogSectionNotes(ChangeLogFile);
5255
var latestChangeLog = changeLogSectionEntries
5356
.Aggregate((c, n) => c + Environment.NewLine + n);
5457
var completeChangeLog = $"## {releaseTag}" + Environment.NewLine + latestChangeLog;
5558

5659
var repositoryInfo = GetGitHubRepositoryInfo(GitRepository);
5760

5861
await PublishRelease(x => x
62+
// We can optionally upload artifacts to the release, for example by finding
63+
// all nupkg files in the output directory
5964
.SetArtifactPaths(GlobFiles(OutputDirectory, "*.nupkg").NotEmpty().ToArray())
6065
.SetCommitSha(GitVersion.Sha)
6166
.SetReleaseNotes(completeChangeLog)

build/.build.csproj

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,16 @@
1111
</PropertyGroup>
1212

1313
<ItemGroup>
14-
<PackageReference Include="Nuke.Common" Version="7.0.0" />
15-
<PackageDownload Include="GitVersion.Tool" Version="[5.8.1]" />
14+
<PackageReference Include="Nuke.Common" Version="7.0.6" />
15+
<PackageDownload Include="GitVersion.Tool" Version="[5.12.0]" />
1616
<PackageReference Include="docfx.console" Version="2.59.4">
1717
<ExcludeAssets>build</ExcludeAssets>
1818
</PackageReference>
19-
<PackageReference Include="Nuke.Tooling.Generator" Version="7.0.0" />
19+
<PackageReference Include="Nuke.Tooling.Generator" Version="7.0.6" />
2020
<!-- The references below are required to compiled the embedded files from
2121
the separate Nuke.GitHub and Nuke.WebDocu projects itself -->
22-
<PackageReference Include="Octokit" Version="5.1.0" />
23-
<PackageReference Include="Azure.Storage.Blobs" Version="12.16.0" />
22+
<PackageReference Include="Octokit" Version="9.1.0" />
23+
<PackageReference Include="Azure.Storage.Blobs" Version="12.19.1" />
2424
</ItemGroup>
2525

2626
<ItemGroup>

build/Build.cs

Lines changed: 31 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using Nuke.Common;
1+
using Nuke.Common;
22
using Nuke.Common.Git;
33
using Nuke.Common.IO;
44
using Nuke.Common.ProjectModel;
@@ -46,8 +46,8 @@ class Build : NukeBuild
4646

4747
[AzureKeyVaultSecret] string DocuBaseUrl;
4848
[AzureKeyVaultSecret] string GitHubAuthenticationToken;
49-
[AzureKeyVaultSecret] string PublicMyGetSource;
50-
[AzureKeyVaultSecret] string PublicMyGetApiKey;
49+
[AzureKeyVaultSecret] string DanglPublicFeedSource;
50+
[AzureKeyVaultSecret] string FeedzAccessToken;
5151
[AzureKeyVaultSecret("NukeGitHub-DocuApiKey")] string NukeGitHubDocuApiKey;
5252
[AzureKeyVaultSecret("NukeWebDocu-DocuApiKey")] string NukeWebDocuDocuApiKey;
5353
[AzureKeyVaultSecret] string NuGetApiKey;
@@ -77,13 +77,20 @@ private void SendTeamsMessage(string title, string message, bool isError)
7777
{
7878
if (!string.IsNullOrWhiteSpace(DanglCiCdTeamsWebhookUrl))
7979
{
80-
var themeColor = isError ? "f44336" : "00acc1";
81-
TeamsTasks
82-
.SendTeamsMessage(m => m
83-
.SetTitle(title)
84-
.SetText(message)
85-
.SetThemeColor(themeColor),
86-
DanglCiCdTeamsWebhookUrl);
80+
try
81+
{
82+
var themeColor = isError ? "f44336" : "00acc1";
83+
TeamsTasks
84+
.SendTeamsMessage(m => m
85+
.SetTitle(title)
86+
.SetText(message)
87+
.SetThemeColor(themeColor),
88+
DanglCiCdTeamsWebhookUrl);
89+
}
90+
catch (Exception e)
91+
{
92+
Serilog.Log.Error("Failed to send Teams message: " + e);
93+
}
8794
}
8895
}
8996

@@ -165,16 +172,17 @@ private void SendTeamsMessage(string title, string message, bool isError)
165172
Target Push => _ => _
166173
.DependsOn(Pack)
167174
.Requires(() => Configuration == "Release")
175+
.OnlyWhenDynamic(() => IsOnBranch("master") || IsOnBranch("develop"))
168176
.Executes(() =>
169177
{
170-
if (string.IsNullOrWhiteSpace(PublicMyGetSource))
178+
if (string.IsNullOrWhiteSpace(DanglPublicFeedSource))
171179
{
172-
Assert.Fail(nameof(PublicMyGetSource) + " is required");
180+
Assert.Fail(nameof(DanglPublicFeedSource) + " is required");
173181
}
174182

175-
if (string.IsNullOrWhiteSpace(PublicMyGetApiKey))
183+
if (string.IsNullOrWhiteSpace(FeedzAccessToken))
176184
{
177-
Assert.Fail(nameof(PublicMyGetApiKey) + " is required");
185+
Assert.Fail(nameof(FeedzAccessToken) + " is required");
178186
}
179187

180188
var packages = GlobFiles(OutputDirectory, "*.nupkg")
@@ -186,8 +194,8 @@ private void SendTeamsMessage(string title, string message, bool isError)
186194
DotNetNuGetPush(s => s
187195
.EnableSkipDuplicate()
188196
.SetTargetPath(x)
189-
.SetSource(PublicMyGetSource)
190-
.SetApiKey(PublicMyGetApiKey));
197+
.SetSource(DanglPublicFeedSource)
198+
.SetApiKey(FeedzAccessToken));
191199
});
192200

193201
if (GitVersion.BranchName.Equals("master") || GitVersion.BranchName.Equals("origin/master"))
@@ -253,6 +261,7 @@ private void SendTeamsMessage(string title, string message, bool isError)
253261
Target UploadDocumentation => _ => _
254262
.DependsOn(Push) // To have a relation between pushed package version and published docs version
255263
.DependsOn(BuildDocumentation)
264+
.OnlyWhenDynamic(() => IsOnBranch("master") || IsOnBranch("develop"))
256265
.Executes(() =>
257266
{
258267
if (string.IsNullOrWhiteSpace(DocuBaseUrl))
@@ -289,7 +298,7 @@ private void SendTeamsMessage(string title, string message, bool isError)
289298

290299
Target PublishGitHubRelease => _ => _
291300
.DependsOn(Pack)
292-
.OnlyWhenDynamic(() => GitVersion.BranchName.Equals("master") || GitVersion.BranchName.Equals("origin/master"))
301+
.OnlyWhenDynamic(() => IsOnBranch("master"))
293302
.Executes(async () =>
294303
{
295304
if (string.IsNullOrWhiteSpace(GitHubAuthenticationToken))
@@ -330,4 +339,9 @@ await PublishRelease(x => x
330339
outputFileProvider: x => RootDirectory / "src" / "Nuke.GitHub" / "GitHubTasks.Generated.cs",
331340
namespaceProvider: x => "Nuke.GitHub");
332341
});
342+
343+
private bool IsOnBranch(string branchName)
344+
{
345+
return GitVersion.BranchName.Equals(branchName) || GitVersion.BranchName.Equals($"origin/{branchName}");
346+
}
333347
}

src/Nuke.GitHub/GitHubTasks.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ public static async Task PublishRelease(Configure<GitHubReleaseSettings> configu
2424
if (existingReleases.Any(r => r.TagName == releaseTag))
2525
{
2626
// Release already present
27+
Serilog.Log.Information($"The tag {releaseTag} is already present, no GitHub release is created");
2728
return;
2829
}
2930

src/Nuke.GitHub/Nuke.GitHub.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
</PropertyGroup>
1111

1212
<ItemGroup>
13-
<PackageReference Include="Octokit" Version="5.1.0" />
14-
<PackageReference Include="Nuke.Common" Version="7.0.0" />
13+
<PackageReference Include="Octokit" Version="9.1.0" />
14+
<PackageReference Include="Nuke.Common" Version="7.0.6" />
1515
</ItemGroup>
1616

1717
</Project>

src/Nuke.WebDocu/Nuke.WebDocu.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
</PropertyGroup>
1515

1616
<ItemGroup>
17-
<PackageReference Include="Nuke.Common" Version="7.0.0" />
18-
<PackageReference Include="Azure.Storage.Blobs" Version="12.16.0" />
17+
<PackageReference Include="Nuke.Common" Version="7.0.6" />
18+
<PackageReference Include="Azure.Storage.Blobs" Version="12.19.1" />
1919
</ItemGroup>
2020

2121
</Project>

test/Nuke.WebDocu.Tests/Nuke.WebDocu.Tests.csproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@
77
</PropertyGroup>
88

99
<ItemGroup>
10-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.6.0-preview-20230223-05" />
11-
<PackageReference Include="xunit" Version="2.5.0-pre.11" />
12-
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5">
10+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
11+
<PackageReference Include="xunit" Version="2.6.5" />
12+
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.6">
1313
<PrivateAssets>all</PrivateAssets>
1414
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
1515
</PackageReference>
16-
<PackageReference Include="XunitXml.TestLogger" Version="3.0.78" />
16+
<PackageReference Include="XunitXml.TestLogger" Version="3.1.17" />
1717
</ItemGroup>
1818

1919
<ItemGroup>

0 commit comments

Comments
 (0)