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.Git;
|
||||||
using Nuke.Common.Tools.GitVersion;
|
using Nuke.Common.Tools.GitVersion;
|
||||||
using Nuke.Common.Utilities.Collections;
|
using Nuke.Common.Utilities.Collections;
|
||||||
|
using Serilog;
|
||||||
using static Nuke.Common.EnvironmentInfo;
|
using static Nuke.Common.EnvironmentInfo;
|
||||||
using static Nuke.Common.IO.PathConstruction;
|
using static Nuke.Common.IO.PathConstruction;
|
||||||
|
|
||||||
@ -47,35 +48,31 @@ class Build : NukeBuild
|
|||||||
readonly string GiteaNugetSourceName = Environment.GetEnvironmentVariable("GITEA_NUGET_SOURCE_NAME");
|
readonly string GiteaNugetSourceName = Environment.GetEnvironmentVariable("GITEA_NUGET_SOURCE_NAME");
|
||||||
|
|
||||||
Target Clean => _ => _
|
Target Clean => _ => _
|
||||||
.Before(Restore)
|
.Before(Compile)
|
||||||
.Executes(() =>
|
.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();
|
ArtifactsDirectory.CreateOrCleanDirectory();
|
||||||
});
|
});
|
||||||
|
|
||||||
Target Restore => _ => _
|
|
||||||
.Executes(() =>
|
|
||||||
{
|
|
||||||
DotNetTasks.DotNetRestore(s => s
|
|
||||||
.SetProjectFile(Solution));
|
|
||||||
});
|
|
||||||
|
|
||||||
Target Compile => _ => _
|
Target Compile => _ => _
|
||||||
.DependsOn(Restore)
|
|
||||||
.Executes(() =>
|
.Executes(() =>
|
||||||
{
|
{
|
||||||
var semVer = GitVersion.AssemblySemVer;
|
var semVer = GitVersion.AssemblySemVer;
|
||||||
var semFileVer = GitVersion.AssemblySemFileVer;
|
var semFileVer = GitVersion.AssemblySemFileVer;
|
||||||
var informationalVersion = GitVersion.InformationalVersion;
|
var informationalVersion = GitVersion.InformationalVersion;
|
||||||
|
|
||||||
|
Log.Logger.Information("AssemblySemVer: {semVer}", semVer);
|
||||||
|
|
||||||
DotNetTasks.DotNetBuild(s => s
|
DotNetTasks.DotNetBuild(s => s
|
||||||
.SetProjectFile(Solution)
|
.SetProjectFile(Solution)
|
||||||
.SetConfiguration(Configuration)
|
.SetConfiguration(Configuration)
|
||||||
.SetAssemblyVersion(semVer)
|
.SetAssemblyVersion(semVer)
|
||||||
.SetFileVersion(semFileVer)
|
.SetFileVersion(semFileVer)
|
||||||
.SetInformationalVersion(informationalVersion)
|
.SetInformationalVersion(informationalVersion));
|
||||||
.EnableNoRestore());
|
|
||||||
});
|
});
|
||||||
|
|
||||||
Target Test => _ => _
|
Target Test => _ => _
|
||||||
@ -104,7 +101,7 @@ class Build : NukeBuild
|
|||||||
});
|
});
|
||||||
|
|
||||||
Target Publish => _ => _
|
Target Publish => _ => _
|
||||||
.DependsOn(Pack)
|
.DependsOn(Pack, CreateAndPushGitTag)
|
||||||
.Executes(() =>
|
.Executes(() =>
|
||||||
{
|
{
|
||||||
DotNetTasks.DotNetNuGetPush(s => s
|
DotNetTasks.DotNetNuGetPush(s => s
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user