Skip to content

Commit

Permalink
Upgrade to NUKE 8.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
lahma committed Oct 7, 2024
1 parent 7d6df3a commit 51c4dcd
Show file tree
Hide file tree
Showing 7 changed files with 105 additions and 108 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
with:
dotnet-version: |
6.0
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: 'Run: Compile, Test, Pack, Publish'
run: ./build.cmd Compile Test Pack Publish
env:
Expand All @@ -53,22 +53,22 @@ jobs:
CHOCO_API_KEY: ${{ secrets.CHOCO_API_KEY }}
NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
- name: 'Publish: NSwag.zip'
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: NSwag.zip
path: artifacts/NSwag.zip
- name: 'Publish: NSwag.Npm.zip'
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: NSwag.Npm.zip
path: artifacts/NSwag.Npm.zip
- name: 'Publish: NSwagStudio.msi'
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: NSwagStudio.msi
path: artifacts/NSwagStudio.msi
- name: 'Publish: NuGet Packages'
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: NuGet Packages
path: artifacts/*.nupkg
Expand All @@ -80,7 +80,7 @@ jobs:
with:
dotnet-version: |
6.0
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: 'Run: Compile, Test, Pack, Publish'
run: ./build.cmd Compile Test Pack Publish
env:
Expand All @@ -96,7 +96,7 @@ jobs:
with:
dotnet-version: |
6.0
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: 'Run: Compile, Test, Pack, Publish'
run: ./build.cmd Compile Test Pack Publish
env:
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,26 +42,26 @@ jobs:
with:
dotnet-version: |
6.0
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: 'Run: Compile, Test, Pack'
run: ./build.cmd Compile Test Pack
- name: 'Publish: NSwag.zip'
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: NSwag.zip
path: artifacts/NSwag.zip
- name: 'Publish: NSwag.Npm.zip'
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: NSwag.Npm.zip
path: artifacts/NSwag.Npm.zip
- name: 'Publish: NSwagStudio.msi'
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: NSwagStudio.msi
path: artifacts/NSwagStudio.msi
- name: 'Publish: NuGet Packages'
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: NuGet Packages
path: artifacts/*.nupkg
Expand All @@ -73,7 +73,7 @@ jobs:
with:
dotnet-version: |
6.0
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: 'Run: Compile, Test, Pack'
run: ./build.cmd Compile Test Pack
macos-latest:
Expand All @@ -84,6 +84,6 @@ jobs:
with:
dotnet-version: |
6.0
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: 'Run: Compile, Test, Pack'
run: ./build.cmd Compile Test Pack
157 changes: 79 additions & 78 deletions .nuke/build.schema.json
Original file line number Diff line number Diff line change
@@ -1,23 +1,80 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"$ref": "#/definitions/build",
"title": "Build Schema",
"properties": {
"ChocoApiKey": {
"type": "string",
"default": "Secrets must be entered via 'nuke :secrets [profile]'"
},
"Configuration": {
"type": "string",
"description": "Configuration to build - Default is 'Debug' (local) or 'Release' (server)",
"enum": [
"Debug",
"Release"
]
},
"MyGetApiKey": {
"type": "string",
"default": "Secrets must be entered via 'nuke :secrets [profile]'"
},
"NpmAuthToken": {
"type": "string",
"default": "Secrets must be entered via 'nuke :secrets [profile]'"
},
"NuGetApiKey": {
"type": "string",
"default": "Secrets must be entered via 'nuke :secrets [profile]'"
},
"Solution": {
"type": "string",
"description": "Path to a solution file that is automatically loaded"
}
},
"definitions": {
"build": {
"type": "object",
"Host": {
"type": "string",
"enum": [
"AppVeyor",
"AzurePipelines",
"Bamboo",
"Bitbucket",
"Bitrise",
"GitHubActions",
"GitLab",
"Jenkins",
"Rider",
"SpaceAutomation",
"TeamCity",
"Terminal",
"TravisCI",
"VisualStudio",
"VSCode"
]
},
"ExecutableTarget": {
"type": "string",
"enum": [
"Clean",
"Compile",
"InstallDependencies",
"Pack",
"Publish",
"Restore",
"Test"
]
},
"Verbosity": {
"type": "string",
"description": "",
"enum": [
"Verbose",
"Normal",
"Minimal",
"Quiet"
]
},
"NukeBuild": {
"properties": {
"ChocoApiKey": {
"type": "string",
"default": "Secrets must be entered via 'nuke :secrets [profile]'"
},
"Configuration": {
"type": "string",
"description": "Configuration to build - Default is 'Debug' (local) or 'Release' (server)",
"enum": [
"Debug",
"Release"
]
},
"Continue": {
"type": "boolean",
"description": "Indicates to continue a previously failed build attempt"
Expand All @@ -27,42 +84,13 @@
"description": "Shows the help text for this build assembly"
},
"Host": {
"type": "string",
"description": "Host for execution. Default is 'automatic'",
"enum": [
"AppVeyor",
"AzurePipelines",
"Bamboo",
"Bitbucket",
"Bitrise",
"GitHubActions",
"GitLab",
"Jenkins",
"Rider",
"SpaceAutomation",
"TeamCity",
"Terminal",
"TravisCI",
"VisualStudio",
"VSCode"
]
},
"MyGetApiKey": {
"type": "string",
"default": "Secrets must be entered via 'nuke :secrets [profile]'"
"$ref": "#/definitions/Host"
},
"NoLogo": {
"type": "boolean",
"description": "Disables displaying the NUKE logo"
},
"NpmAuthToken": {
"type": "string",
"default": "Secrets must be entered via 'nuke :secrets [profile]'"
},
"NuGetApiKey": {
"type": "string",
"default": "Secrets must be entered via 'nuke :secrets [profile]'"
},
"Partition": {
"type": "string",
"description": "Partition to use on CI"
Expand All @@ -86,49 +114,22 @@
"type": "array",
"description": "List of targets to be skipped. Empty list skips all dependencies",
"items": {
"type": "string",
"enum": [
"Clean",
"Compile",
"InstallDependencies",
"Pack",
"Publish",
"Restore",
"Test"
]
"$ref": "#/definitions/ExecutableTarget"
}
},
"Solution": {
"type": "string",
"description": "Path to a solution file that is automatically loaded"
},
"Target": {
"type": "array",
"description": "List of targets to be invoked. Default is '{default_target}'",
"items": {
"type": "string",
"enum": [
"Clean",
"Compile",
"InstallDependencies",
"Pack",
"Publish",
"Restore",
"Test"
]
"$ref": "#/definitions/ExecutableTarget"
}
},
"Verbosity": {
"type": "string",
"description": "Logging verbosity during build execution. Default is 'Normal'",
"enum": [
"Minimal",
"Normal",
"Quiet",
"Verbose"
]
"$ref": "#/definitions/Verbosity"
}
}
}
}
},
"$ref": "#/definitions/NukeBuild"
}
10 changes: 4 additions & 6 deletions build/Build.CI.GitHubActions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
OnPullRequestExcludePaths = ["**/*.md"],
PublishArtifacts = true,
InvokedTargets = [nameof(Compile), nameof(Test), nameof(Pack)],
CacheKeyFiles = new string[0],
JobConcurrencyCancelInProgress = false),
CacheKeyFiles = [],
ConcurrencyCancelInProgress = false),
]
[CustomGitHubActions(
"build",
Expand All @@ -30,11 +30,9 @@
PublishArtifacts = true,
InvokedTargets = [nameof(Compile), nameof(Test), nameof(Pack), nameof(Publish)],
ImportSecrets = ["NUGET_API_KEY", "MYGET_API_KEY", "CHOCO_API_KEY", "NPM_AUTH_TOKEN"],
CacheKeyFiles = new string[0])
CacheKeyFiles = [])
]
public partial class Build
{
}
public partial class Build;

class CustomGitHubActionsAttribute : GitHubActionsAttribute
{
Expand Down
5 changes: 2 additions & 3 deletions build/Build.Pack.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
using Nuke.Common.Tools.MSBuild;
using Nuke.Common.Tools.NuGet;

using static Nuke.Common.IO.FileSystemTasks;
using static Nuke.Common.Tools.DotNet.DotNetTasks;
using static Nuke.Common.Tools.MSBuild.MSBuildTasks;
using static Nuke.Common.Tools.NuGet.NuGetTasks;
Expand Down Expand Up @@ -115,7 +114,7 @@ public partial class Build
foreach (var artifact in artifacts)
{
CopyFileToDirectory(artifact, ArtifactsDirectory);
artifact.CopyToDirectory(ArtifactsDirectory);
}
// patch npm version
Expand All @@ -129,7 +128,7 @@ public partial class Build
ZipFile.CreateFromDirectory(NSwagStudioBinaries, ArtifactsDirectory / "NSwag.zip");
// NSwagStudio.msi
CopyFileToDirectory(ArtifactsDirectory / "bin" / "NSwagStudio.Installer" / Configuration / "NSwagStudio.msi", ArtifactsDirectory);
(ArtifactsDirectory / "bin" / "NSwagStudio.Installer" / Configuration / "NSwagStudio.msi").CopyToDirectory(ArtifactsDirectory);
});
}

11 changes: 5 additions & 6 deletions build/Build.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
using Nuke.Common.Tools.Npm;
using Nuke.Common.Utilities.Collections;

using static Nuke.Common.IO.FileSystemTasks;
using static Nuke.Common.Tools.Chocolatey.ChocolateyTasks;
using static Nuke.Common.Tools.DotNet.DotNetTasks;
using static Nuke.Common.Tools.MSBuild.MSBuildTasks;
Expand Down Expand Up @@ -278,14 +277,14 @@ void CopyConsoleBinaries(AbsolutePath target)
if (IsRunningOnWindows)
{
var consoleX86Directory = ArtifactsDirectory / "publish" / consoleX86Project.Name / configuration;
CopyFileToDirectory(consoleX86Directory / "NSwag.x86.exe", target / "Win");
CopyFileToDirectory(consoleX86Directory / "NSwag.x86.exe.config", target / "Win");
(consoleX86Directory / "NSwag.x86.exe").CopyToDirectory(target / "Win");
(consoleX86Directory / "NSwag.x86.exe.config").CopyToDirectory(target / "Win");

CopyDirectoryRecursively(ArtifactsDirectory / "publish" / consoleProject.Name / configuration, target / "Win", DirectoryExistsPolicy.Merge);
(ArtifactsDirectory / "publish" / consoleProject.Name / configuration).Copy(target / "Win", ExistsPolicy.DirectoryMerge);
}

CopyDirectoryRecursively(ArtifactsDirectory / "publish" / consoleCoreProject.Name / (configuration + "_net6.0"), target / "Net60");
CopyDirectoryRecursively(ArtifactsDirectory / "publish" / consoleCoreProject.Name / (configuration + "_net8.0"), target / "Net80");
(ArtifactsDirectory / "publish" / consoleCoreProject.Name / (configuration + "_net6.0")).Copy(target / "Net60");
(ArtifactsDirectory / "publish" / consoleCoreProject.Name / (configuration + "_net8.0")).Copy(target / "Net80");
}

if (IsRunningOnWindows)
Expand Down
2 changes: 1 addition & 1 deletion build/_build.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Nuke.Common" Version="8.0.0" />
<PackageReference Include="Nuke.Common" Version="8.1.1" />
</ItemGroup>

<ItemGroup>
Expand Down

0 comments on commit 51c4dcd

Please sign in to comment.