-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
51090ff
commit 0d370ca
Showing
6 changed files
with
174 additions
and
106 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
$ErrorActionPreference = 'Stop' | ||
|
||
cd .\Tools\NukeBuild | ||
.\build.cmd | ||
.\build.cmd Test Publish | ||
|
||
cd ..\..\Artifacts\latest | ||
.\install-update.ps1 | ||
|
||
cd ..\.. | ||
cd ..\.. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
Tools/NukeBuild/CustomBuildCmdPathGitHubActionsAttribute.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
using Nuke.Common.CI.GitHubActions; | ||
|
||
public class CustomBuildCmdPathGitHubActionsAttribute : GitHubActionsAttribute | ||
{ | ||
public CustomBuildCmdPathGitHubActionsAttribute( | ||
string name, | ||
GitHubActionsImage image, | ||
params GitHubActionsImage[] images) : base(name, image, images) | ||
{ | ||
} | ||
|
||
protected override string BuildCmdPath => Build.RootDirectory / "Tools" / "NukeBuild" / "build.cmd"; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
using System; | ||
using System.Linq; | ||
using Nuke.Common.IO; | ||
using Nuke.Common.Tooling; | ||
|
||
public static class Z7Tasks | ||
{ | ||
public static void PackAs7z(Action<Z7SfxSettings> configurator) | ||
{ | ||
var settings = new Z7SfxSettings(); | ||
configurator(settings); | ||
|
||
ProcessTasks.StartProcess(settings).WaitForExit(); | ||
} | ||
|
||
public class Z7SfxSettings : ToolSettings | ||
{ | ||
public override string ProcessToolPath => @"C:\Program Files\7-Zip\7z.exe"; | ||
|
||
public override Action<ToolSettings, IProcess> ProcessExitHandler => (_, process) => | ||
{ | ||
if (process.Output.Any(x => x.Type == OutputType.Err)) | ||
{ | ||
Serilog.Log.Error( | ||
string.Join("\n", process.Output.Where(x => x.Type == OutputType.Err).Select(x => x.Text))); | ||
} | ||
else | ||
{ | ||
Serilog.Log.Information("Archive created"); | ||
} | ||
}; | ||
|
||
public string Command { get; private set; } | ||
|
||
public string Switch { get; private set; } | ||
|
||
public string ArchiveName { get; private set; } | ||
|
||
public string SourceName { get; private set; } | ||
|
||
public Z7SfxSettings CreateArchive() | ||
{ | ||
Command = "a"; | ||
return this; | ||
} | ||
|
||
public Z7SfxSettings AsSfx() | ||
{ | ||
Switch = "-sfx"; | ||
return this; | ||
} | ||
|
||
public Z7SfxSettings SetOutputArchiveFile(AbsolutePath archiveName) | ||
{ | ||
ArchiveName = archiveName; | ||
return this; | ||
} | ||
|
||
public Z7SfxSettings SetSourceDirectory(string sourceName) | ||
{ | ||
SourceName = sourceName; | ||
return this; | ||
} | ||
|
||
protected override Arguments ConfigureProcessArguments(Arguments arguments) | ||
{ | ||
return arguments | ||
.Add(Command) | ||
.Add(Switch) | ||
.Add("\"{0}\"", ArchiveName) | ||
.Add("\"{0}\\*\"", SourceName); | ||
} | ||
} | ||
} |