Skip to content

Commit a0297a2

Browse files
authored
Merge pull request #192 from lahma/nuke-10
Upgrade to NUKE 10 and use latest GH Actions steps
2 parents 78cb0fa + ff8ef2e commit a0297a2

File tree

9 files changed

+119
-111
lines changed

9 files changed

+119
-111
lines changed

.github/workflows/ci.yml

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,12 @@ jobs:
2626
if: needs.can_document.outputs.value == 'true'
2727

2828
steps:
29-
- uses: actions/checkout@v2
29+
- uses: actions/checkout@v5
3030

3131
- name: Use Node.js
32-
uses: actions/setup-node@v1
32+
uses: actions/setup-node@v5
3333
with:
34-
node-version: "14.x"
34+
node-version: "20.x"
3535
registry-url: 'https://registry.npmjs.org'
3636

3737
- name: Install Dependencies
@@ -48,15 +48,13 @@ jobs:
4848
runs-on: ubuntu-latest
4949

5050
steps:
51-
- uses: actions/checkout@v2
51+
- uses: actions/checkout@v5
5252

5353
- name: Setup dotnet
54-
uses: actions/setup-dotnet@v1
54+
uses: actions/setup-dotnet@v5
5555
with:
5656
dotnet-version: |
57-
6.0.x
58-
7.0.x
59-
8.0.x
57+
10.0.x
6058
6159
- name: Build
6260
run: ./build.sh
@@ -65,15 +63,13 @@ jobs:
6563
runs-on: windows-latest
6664

6765
steps:
68-
- uses: actions/checkout@v2
66+
- uses: actions/checkout@v5
6967

7068
- name: Setup dotnet
71-
uses: actions/setup-dotnet@v1
69+
uses: actions/setup-dotnet@v5
7270
with:
7371
dotnet-version: |
74-
6.0.x
75-
7.0.x
76-
8.0.x
72+
10.0.x
7773
7874
- name: Build
7975
run: |

.nuke/build.schema.json

Lines changed: 78 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,56 @@
11
{
22
"$schema": "http://json-schema.org/draft-04/schema#",
3-
"title": "Build Schema",
4-
"$ref": "#/definitions/build",
53
"definitions": {
6-
"build": {
7-
"type": "object",
4+
"Host": {
5+
"type": "string",
6+
"enum": [
7+
"AppVeyor",
8+
"AzurePipelines",
9+
"Bamboo",
10+
"Bitbucket",
11+
"Bitrise",
12+
"GitHubActions",
13+
"GitLab",
14+
"Jenkins",
15+
"Rider",
16+
"SpaceAutomation",
17+
"TeamCity",
18+
"Terminal",
19+
"TravisCI",
20+
"VisualStudio",
21+
"VSCode"
22+
]
23+
},
24+
"ExecutableTarget": {
25+
"type": "string",
26+
"enum": [
27+
"Clean",
28+
"Compile",
29+
"CopyFiles",
30+
"CreatePackage",
31+
"Default",
32+
"Package",
33+
"PrePublish",
34+
"Publish",
35+
"PublishPackage",
36+
"PublishPreRelease",
37+
"PublishRelease",
38+
"Restore",
39+
"RunUnitTests"
40+
]
41+
},
42+
"Verbosity": {
43+
"type": "string",
44+
"description": "",
45+
"enum": [
46+
"Verbose",
47+
"Normal",
48+
"Minimal",
49+
"Quiet"
50+
]
51+
},
52+
"NukeBuild": {
853
"properties": {
9-
"Configuration": {
10-
"type": "string",
11-
"description": "Configuration to build - Default is 'Debug' (local) or 'Release' (server)",
12-
"enum": [
13-
"Debug",
14-
"Release"
15-
]
16-
},
1754
"Continue": {
1855
"type": "boolean",
1956
"description": "Indicates to continue a previously failed build attempt"
@@ -23,25 +60,8 @@
2360
"description": "Shows the help text for this build assembly"
2461
},
2562
"Host": {
26-
"type": "string",
2763
"description": "Host for execution. Default is 'automatic'",
28-
"enum": [
29-
"AppVeyor",
30-
"AzurePipelines",
31-
"Bamboo",
32-
"Bitbucket",
33-
"Bitrise",
34-
"GitHubActions",
35-
"GitLab",
36-
"Jenkins",
37-
"Rider",
38-
"SpaceAutomation",
39-
"TeamCity",
40-
"Terminal",
41-
"TravisCI",
42-
"VisualStudio",
43-
"VSCode"
44-
]
64+
"$ref": "#/definitions/Host"
4565
},
4666
"NoLogo": {
4767
"type": "boolean",
@@ -62,10 +82,6 @@
6282
"type": "string"
6383
}
6484
},
65-
"ReleaseNotesFilePath": {
66-
"type": "string",
67-
"description": "ReleaseNotesFilePath - To determine the SemanticVersion"
68-
},
6985
"Root": {
7086
"type": "string",
7187
"description": "Root directory during build execution"
@@ -74,61 +90,46 @@
7490
"type": "array",
7591
"description": "List of targets to be skipped. Empty list skips all dependencies",
7692
"items": {
77-
"type": "string",
78-
"enum": [
79-
"Clean",
80-
"Compile",
81-
"CopyFiles",
82-
"CreatePackage",
83-
"Default",
84-
"Package",
85-
"PrePublish",
86-
"Publish",
87-
"PublishPackage",
88-
"PublishPreRelease",
89-
"PublishRelease",
90-
"Restore",
91-
"RunUnitTests"
92-
]
93+
"$ref": "#/definitions/ExecutableTarget"
9394
}
9495
},
95-
"Solution": {
96-
"type": "string",
97-
"description": "Path to a solution file that is automatically loaded"
98-
},
9996
"Target": {
10097
"type": "array",
10198
"description": "List of targets to be invoked. Default is '{default_target}'",
10299
"items": {
103-
"type": "string",
104-
"enum": [
105-
"Clean",
106-
"Compile",
107-
"CopyFiles",
108-
"CreatePackage",
109-
"Default",
110-
"Package",
111-
"PrePublish",
112-
"Publish",
113-
"PublishPackage",
114-
"PublishPreRelease",
115-
"PublishRelease",
116-
"Restore",
117-
"RunUnitTests"
118-
]
100+
"$ref": "#/definitions/ExecutableTarget"
119101
}
120102
},
121103
"Verbosity": {
122-
"type": "string",
123104
"description": "Logging verbosity during build execution. Default is 'Normal'",
105+
"$ref": "#/definitions/Verbosity"
106+
}
107+
}
108+
}
109+
},
110+
"allOf": [
111+
{
112+
"properties": {
113+
"Configuration": {
114+
"type": "string",
115+
"description": "Configuration to build - Default is 'Debug' (local) or 'Release' (server)",
124116
"enum": [
125-
"Minimal",
126-
"Normal",
127-
"Quiet",
128-
"Verbose"
117+
"Debug",
118+
"Release"
129119
]
120+
},
121+
"ReleaseNotesFilePath": {
122+
"type": "string",
123+
"description": "ReleaseNotesFilePath - To determine the SemanticVersion"
124+
},
125+
"Solution": {
126+
"type": "string",
127+
"description": "Path to a solution file that is automatically loaded"
130128
}
131129
}
130+
},
131+
{
132+
"$ref": "#/definitions/NukeBuild"
132133
}
133-
}
134-
}
134+
]
135+
}

build.cmd

100644100755
File mode changed.

build.ps1

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,10 @@ $TempDirectory = "$PSScriptRoot\\.nuke\temp"
1818

1919
$DotNetGlobalFile = "$PSScriptRoot\\global.json"
2020
$DotNetInstallUrl = "https://dot.net/v1/dotnet-install.ps1"
21-
$DotNetChannel = "Current"
21+
$DotNetChannel = "STS"
2222

23-
$env:DOTNET_SKIP_FIRST_TIME_EXPERIENCE = 1
2423
$env:DOTNET_CLI_TELEMETRY_OPTOUT = 1
25-
$env:DOTNET_MULTILEVEL_LOOKUP = 0
24+
$env:DOTNET_NOLOGO = 1
2625

2726
###########################################################################
2827
# EXECUTION
@@ -61,9 +60,15 @@ else {
6160
ExecSafe { & powershell $DotNetInstallFile -InstallDir $DotNetDirectory -Version $DotNetVersion -NoPath }
6261
}
6362
$env:DOTNET_EXE = "$DotNetDirectory\dotnet.exe"
63+
$env:PATH = "$DotNetDirectory;$env:PATH"
6464
}
6565

6666
Write-Output "Microsoft (R) .NET SDK version $(& $env:DOTNET_EXE --version)"
6767

68+
if (Test-Path env:NUKE_ENTERPRISE_TOKEN) {
69+
& $env:DOTNET_EXE nuget remove source "nuke-enterprise" > $null
70+
& $env:DOTNET_EXE nuget add source "https://f.feedz.io/nuke/enterprise/nuget" --name "nuke-enterprise" --username "PAT" --password $env:NUKE_ENTERPRISE_TOKEN > $null
71+
}
72+
6873
ExecSafe { & $env:DOTNET_EXE build $BuildProjectFile /nodeReuse:false /p:UseSharedCompilation=false -nologo -clp:NoSummary --verbosity quiet }
6974
ExecSafe { & $env:DOTNET_EXE run --project $BuildProjectFile --no-build -- $BuildArguments }

build.sh

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,10 @@ TEMP_DIRECTORY="$SCRIPT_DIR//.nuke/temp"
1414

1515
DOTNET_GLOBAL_FILE="$SCRIPT_DIR//global.json"
1616
DOTNET_INSTALL_URL="https://dot.net/v1/dotnet-install.sh"
17-
DOTNET_CHANNEL="Current"
17+
DOTNET_CHANNEL="STS"
1818

1919
export DOTNET_CLI_TELEMETRY_OPTOUT=1
20-
export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1
21-
export DOTNET_MULTILEVEL_LOOKUP=0
20+
export DOTNET_NOLOGO=1
2221

2322
###########################################################################
2423
# EXECUTION
@@ -54,9 +53,15 @@ else
5453
"$DOTNET_INSTALL_FILE" --install-dir "$DOTNET_DIRECTORY" --version "$DOTNET_VERSION" --no-path
5554
fi
5655
export DOTNET_EXE="$DOTNET_DIRECTORY/dotnet"
56+
export PATH="$DOTNET_DIRECTORY:$PATH"
5757
fi
5858

5959
echo "Microsoft (R) .NET SDK version $("$DOTNET_EXE" --version)"
6060

61+
if [[ ! -z ${NUKE_ENTERPRISE_TOKEN+x} && "$NUKE_ENTERPRISE_TOKEN" != "" ]]; then
62+
"$DOTNET_EXE" nuget remove source "nuke-enterprise" &>/dev/null || true
63+
"$DOTNET_EXE" nuget add source "https://f.feedz.io/nuke/enterprise/nuget" --name "nuke-enterprise" --username "PAT" --password "$NUKE_ENTERPRISE_TOKEN" --store-password-in-clear-text &>/dev/null || true
64+
fi
65+
6166
"$DOTNET_EXE" build "$BUILD_PROJECT_FILE" /nodeReuse:false /p:UseSharedCompilation=false -nologo -clp:NoSummary --verbosity quiet
6267
"$DOTNET_EXE" run --project "$BUILD_PROJECT_FILE" --no-build -- "$@"

nuke/Build.cs

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@
1414
using System.Collections.Generic;
1515
using System.IO;
1616
using System.Linq;
17-
using static Nuke.Common.IO.FileSystemTasks;
18-
using static Nuke.Common.IO.PathConstruction;
1917
using static Nuke.Common.Tools.DotNet.DotNetTasks;
2018
using static Nuke.Common.Tools.NuGet.NuGetTasks;
2119
using Project = Nuke.Common.ProjectModel.Project;
@@ -99,7 +97,7 @@ protected override void OnBuildInitialized()
9997

10098
Log.Information("Building version: {Version}", Version);
10199

102-
TargetProject = Solution.GetProject(SourceDirectory / TargetProjectName / $"{TargetLibName}.csproj" );
100+
TargetProject = Solution.GetProject(TargetLibName);
103101
TargetProject.NotNull("TargetProject could not be loaded!");
104102

105103
TargetFrameworks = TargetProject.GetTargetFrameworks();
@@ -112,7 +110,7 @@ protected override void OnBuildInitialized()
112110
.Before(Restore)
113111
.Executes(() =>
114112
{
115-
SourceDirectory.GlobDirectories("**/bin", "**/obj").ForEach(DeleteDirectory);
113+
SourceDirectory.GlobDirectories("**/bin", "**/obj").ForEach(x => x.DeleteDirectory());
116114
});
117115

118116
Target Restore => _ => _
@@ -152,14 +150,14 @@ protected override void OnBuildInitialized()
152150
var targetDir = NugetDirectory / "lib" / item;
153151
var srcDir = BuildDirectory / item;
154152

155-
CopyFile(srcDir / $"{TargetProjectName}.dll", targetDir / $"{TargetProjectName}.dll", FileExistsPolicy.OverwriteIfNewer);
156-
CopyFile(srcDir / $"{TargetProjectName}.pdb", targetDir / $"{TargetProjectName}.pdb", FileExistsPolicy.OverwriteIfNewer);
157-
CopyFile(srcDir / $"{TargetProjectName}.xml", targetDir / $"{TargetProjectName}.xml", FileExistsPolicy.OverwriteIfNewer);
153+
(srcDir / $"{TargetProjectName}.dll").Copy(targetDir / $"{TargetProjectName}.dll", ExistsPolicy.FileOverwriteIfNewer);
154+
(srcDir / $"{TargetProjectName}.pdb").Copy(targetDir / $"{TargetProjectName}.pdb", ExistsPolicy.FileOverwriteIfNewer);
155+
(srcDir / $"{TargetProjectName}.xml").Copy(targetDir / $"{TargetProjectName}.xml", ExistsPolicy.FileOverwriteIfNewer);
158156
}
159157

160-
CopyFile(SourceDirectory / $"{TargetProjectName}.nuspec", NugetDirectory / $"{TargetProjectName}.nuspec", FileExistsPolicy.OverwriteIfNewer);
161-
CopyFile(RootDirectory / "logo.png", NugetDirectory / "logo.png", FileExistsPolicy.OverwriteIfNewer);
162-
CopyFile(RootDirectory / "README.md", NugetDirectory / "README.md", FileExistsPolicy.OverwriteIfNewer);
158+
(SourceDirectory / $"{TargetProjectName}.nuspec").Copy(NugetDirectory / $"{TargetProjectName}.nuspec", ExistsPolicy.FileOverwriteIfNewer);
159+
(RootDirectory / "logo.png").Copy(NugetDirectory / "logo.png", ExistsPolicy.FileOverwriteIfNewer);
160+
(RootDirectory / "README.md").Copy(NugetDirectory / "README.md", ExistsPolicy.FileOverwriteIfNewer);
163161
});
164162

165163
Target CreatePackage => _ => _
@@ -191,7 +189,7 @@ protected override void OnBuildInitialized()
191189
throw new BuildAbortedException("Could not resolve the NuGet API key.");
192190
}
193191

194-
foreach (var nupkg in GlobFiles(NugetDirectory, "*.nupkg"))
192+
foreach (var nupkg in NugetDirectory.GlobFiles("*.nupkg"))
195193
{
196194
NuGetPush(s => s
197195
.SetTargetPath(nupkg)

nuke/_build.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>net6.0</TargetFramework>
5+
<TargetFramework>net10.0</TargetFramework>
66
<RootNamespace></RootNamespace>
77
<NoWarn>CS0649;CS0169</NoWarn>
88
<NukeRootDirectory>..</NukeRootDirectory>
@@ -11,7 +11,7 @@
1111
</PropertyGroup>
1212

1313
<ItemGroup>
14-
<PackageReference Include="Nuke.Common" Version="6.2.1" />
14+
<PackageReference Include="Nuke.Common" Version="10.0.0" />
1515
</ItemGroup>
1616

1717
<ItemGroup>

src/AngleSharp.Css.Tests/AngleSharp.Css.Tests.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<TargetFrameworks>net6.0</TargetFrameworks>
3+
<TargetFrameworks>net8.0</TargetFrameworks>
44
<SignAssembly>true</SignAssembly>
55
<AssemblyOriginatorKeyFile>Key.snk</AssemblyOriginatorKeyFile>
66
<IsPackable>false</IsPackable>

0 commit comments

Comments
 (0)