This commit is contained in:
parent
fda34f23b4
commit
4058972e82
@ -11,6 +11,7 @@ using Nuke.Common.Tools.DotNet;
|
||||
using Nuke.Common.Tools.Git;
|
||||
using Nuke.Common.Tools.GitVersion;
|
||||
using Nuke.Common.Utilities.Collections;
|
||||
using Serilog;
|
||||
using static Nuke.Common.EnvironmentInfo;
|
||||
using static Nuke.Common.IO.PathConstruction;
|
||||
|
||||
@ -47,35 +48,31 @@ class Build : NukeBuild
|
||||
readonly string GiteaNugetSourceName = Environment.GetEnvironmentVariable("GITEA_NUGET_SOURCE_NAME");
|
||||
|
||||
Target Clean => _ => _
|
||||
.Before(Restore)
|
||||
.Before(Compile)
|
||||
.Executes(() =>
|
||||
{
|
||||
SourceDirectory.GlobDirectories("**/bin", "**/obj").ForEach(ap => Directory.Delete(ap, true));
|
||||
SourceDirectory
|
||||
.GlobDirectories("**/bin", "**/obj")
|
||||
.Except(RootDirectory.GlobDirectories("build/**/bin", "build/**/obj"))
|
||||
.ForEach(ap => Directory.Delete(ap, true));
|
||||
ArtifactsDirectory.CreateOrCleanDirectory();
|
||||
});
|
||||
|
||||
Target Restore => _ => _
|
||||
.Executes(() =>
|
||||
{
|
||||
DotNetTasks.DotNetRestore(s => s
|
||||
.SetProjectFile(Solution));
|
||||
});
|
||||
|
||||
Target Compile => _ => _
|
||||
.DependsOn(Restore)
|
||||
.Executes(() =>
|
||||
{
|
||||
var semVer = GitVersion.AssemblySemVer;
|
||||
var semFileVer = GitVersion.AssemblySemFileVer;
|
||||
var informationalVersion = GitVersion.InformationalVersion;
|
||||
|
||||
Log.Logger.Information("AssemblySemVer: {semVer}", semVer);
|
||||
|
||||
DotNetTasks.DotNetBuild(s => s
|
||||
.SetProjectFile(Solution)
|
||||
.SetConfiguration(Configuration)
|
||||
.SetAssemblyVersion(semVer)
|
||||
.SetFileVersion(semFileVer)
|
||||
.SetInformationalVersion(informationalVersion)
|
||||
.EnableNoRestore());
|
||||
.SetInformationalVersion(informationalVersion));
|
||||
});
|
||||
|
||||
Target Test => _ => _
|
||||
@ -104,7 +101,7 @@ class Build : NukeBuild
|
||||
});
|
||||
|
||||
Target Publish => _ => _
|
||||
.DependsOn(Pack)
|
||||
.DependsOn(Pack, CreateAndPushGitTag)
|
||||
.Executes(() =>
|
||||
{
|
||||
DotNetTasks.DotNetNuGetPush(s => s
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user