Skip to content

Commit 6c18036

Browse files
committed
updated
1 parent d0f0929 commit 6c18036

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

nuke/Build.Github.cs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99

1010
using Octokit;
1111

12+
using Serilog;
13+
1214
using System;
1315
using System.IO;
1416
using System.Linq;
@@ -35,10 +37,10 @@ internal partial class Build
3537
.OnlyWhenDynamic(() => GitVersion.BranchName.Equals("main") || GitVersion.BranchName.Equals("origin/main"))
3638
.Executes(async () =>
3739
{
38-
if (string.IsNullOrWhiteSpace(GhAccessToken)) ControlFlow.Fail($"{nameof(GhAccessToken)} is null");
39-
Logger.Info("Release to github...");
40+
if (string.IsNullOrWhiteSpace(GhAccessToken)) Assert.Fail($"{nameof(GhAccessToken)} is null");
41+
Log.Information("Release to github...");
4042
await PublishAndUploadToGitHubRelease(GitVersion);
41-
Logger.Info("Release to github finished.");
43+
Log.Information("Release to github finished.");
4244
});
4345

4446
private async Task PublishAndUploadToGitHubRelease(GitVersion git)
@@ -73,7 +75,7 @@ private async Task PublishAndUploadToGitHubRelease(GitVersion git)
7375
}
7476
catch (Exception e)
7577
{
76-
Logger.Error(e);
78+
Log.Error(e, null);
7779
}
7880
// await GitHubTasks.GitHubClient
7981
// .Repository.Release

nuke/Build.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
using Nuke.Common.Tools.MSBuild;
1111
using Nuke.Common.Utilities.Collections;
1212

13+
using Serilog;
14+
1315
using System;
1416
using System.IO;
1517
using System.IO.Compression;
@@ -130,7 +132,7 @@ protected override void OnBuildInitialized()
130132
.DependsOn(Publish)
131133
.Executes(() =>
132134
{
133-
Logger.Info("Delete output..");
135+
Log.Information("Delete output..");
134136
PublishDirectory.GlobDirectories("**/output").ForEach(DeleteDirectory);
135137
});
136138

@@ -164,9 +166,9 @@ protected override void OnBuildInitialized()
164166
.Executes(() =>
165167
{
166168
if (HostType != HostType.AzurePipelines) return;
167-
Logger.Info("Upload artifacts to azure...");
169+
Log.Information("Upload artifacts to azure...");
168170
AzurePipelines
169171
.UploadArtifacts("artifacts", "artifacts", ArtifactsDirectory);
170-
Logger.Info("Upload artifacts to azure finished.");
172+
Log.Information("Upload artifacts to azure finished.");
171173
});
172174
}

0 commit comments

Comments
 (0)