Skip to content

Commit

Permalink
updated
Browse files Browse the repository at this point in the history
  • Loading branch information
seayxu committed Oct 15, 2022
1 parent d0f0929 commit 6c18036
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
10 changes: 6 additions & 4 deletions nuke/Build.Github.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@

using Octokit;

using Serilog;

using System;
using System.IO;
using System.Linq;
Expand All @@ -35,10 +37,10 @@ internal partial class Build
.OnlyWhenDynamic(() => GitVersion.BranchName.Equals("main") || GitVersion.BranchName.Equals("origin/main"))
.Executes(async () =>
{
if (string.IsNullOrWhiteSpace(GhAccessToken)) ControlFlow.Fail($"{nameof(GhAccessToken)} is null");
Logger.Info("Release to github...");
if (string.IsNullOrWhiteSpace(GhAccessToken)) Assert.Fail($"{nameof(GhAccessToken)} is null");
Log.Information("Release to github...");
await PublishAndUploadToGitHubRelease(GitVersion);
Logger.Info("Release to github finished.");
Log.Information("Release to github finished.");
});

private async Task PublishAndUploadToGitHubRelease(GitVersion git)
Expand Down Expand Up @@ -73,7 +75,7 @@ private async Task PublishAndUploadToGitHubRelease(GitVersion git)
}
catch (Exception e)
{
Logger.Error(e);
Log.Error(e, null);
}
// await GitHubTasks.GitHubClient
// .Repository.Release
Expand Down
8 changes: 5 additions & 3 deletions nuke/Build.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
using Nuke.Common.Tools.MSBuild;
using Nuke.Common.Utilities.Collections;

using Serilog;

using System;
using System.IO;
using System.IO.Compression;
Expand Down Expand Up @@ -130,7 +132,7 @@ protected override void OnBuildInitialized()
.DependsOn(Publish)
.Executes(() =>
{
Logger.Info("Delete output..");
Log.Information("Delete output..");
PublishDirectory.GlobDirectories("**/output").ForEach(DeleteDirectory);
});

Expand Down Expand Up @@ -164,9 +166,9 @@ protected override void OnBuildInitialized()
.Executes(() =>
{
if (HostType != HostType.AzurePipelines) return;
Logger.Info("Upload artifacts to azure...");
Log.Information("Upload artifacts to azure...");
AzurePipelines
.UploadArtifacts("artifacts", "artifacts", ArtifactsDirectory);
Logger.Info("Upload artifacts to azure finished.");
Log.Information("Upload artifacts to azure finished.");
});
}

0 comments on commit 6c18036

Please sign in to comment.