Skip to content

Commit

Permalink
Fix BuildAndDeploy
Browse files Browse the repository at this point in the history
  • Loading branch information
ImoutoChan committed Oct 1, 2023
1 parent 0fa5603 commit ba4892a
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 2 deletions.
8 changes: 8 additions & 0 deletions .nuke/build.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,14 @@
"Quiet",
"Verbose"
]
},
"VersionedFolder": {
"type": "string",
"description": "Insert version into the artefacts - Default is 'True'",
"enum": [
"False",
"True"
]
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion BuildAndDeploy.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ $ErrorActionPreference = 'Stop'
cp .\Source\global.json .\global.json

cd .\Tools\NukeBuild
.\build.cmd Test Publish
.\build.cmd Test Publish --VersionedFolder False

cd ..\..\Artifacts\latest
.\install-update.ps1
Expand Down
6 changes: 5 additions & 1 deletion Tools/NukeBuild/Build.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,15 @@ class Build : NukeBuild
[Parameter("Configuration to build - Default is 'Release'")]
readonly Configuration Configuration = Configuration.Release;

[Parameter("Insert version into the artefacts - Default is 'True'")]
readonly BuildToVersionedFolder VersionedFolder = BuildToVersionedFolder.True;

AbsolutePath SourceDirectory => RootDirectory;

AbsolutePath OutputDirectory => RootDirectory / "Artifacts";

AbsolutePath OutputLatestDirectory => OutputDirectory / VersionedName;
AbsolutePath OutputLatestDirectory =>
OutputDirectory / (VersionedFolder == BuildToVersionedFolder.True ? VersionedName : "latest");

[Solution(GenerateProjects = true)]
readonly Solution Solution;
Expand Down
14 changes: 14 additions & 0 deletions Tools/NukeBuild/BuildToVersionedFolder.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
using System.ComponentModel;
using Nuke.Common.Tooling;

[TypeConverter(typeof(TypeConverter<BuildToVersionedFolder>))]
public class BuildToVersionedFolder : Enumeration
{
public static BuildToVersionedFolder True = new() { Value = nameof(True) };
public static BuildToVersionedFolder False = new() { Value = nameof(False) };

public static implicit operator string(BuildToVersionedFolder configuration)
{
return configuration.Value;
}
}

0 comments on commit ba4892a

Please sign in to comment.