Skip to content

Commit d36cd0a

Browse files
committed
Upgrade to NUKE 8
1 parent ff33ad7 commit d36cd0a

File tree

10 files changed

+43
-31
lines changed

10 files changed

+43
-31
lines changed

.github/workflows/ci.yml

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

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

3131
- name: Use Node.js
32-
uses: actions/setup-node@v1
32+
uses: actions/setup-node@v4
3333
with:
3434
node-version: "14.x"
3535
registry-url: 'https://registry.npmjs.org'
@@ -48,10 +48,10 @@ jobs:
4848
runs-on: ubuntu-latest
4949

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

5353
- name: Setup dotnet
54-
uses: actions/setup-dotnet@v1
54+
uses: actions/setup-dotnet@v4
5555
with:
5656
dotnet-version: |
5757
6.0.x
@@ -65,10 +65,10 @@ jobs:
6565
runs-on: windows-latest
6666

6767
steps:
68-
- uses: actions/checkout@v2
68+
- uses: actions/checkout@v4
6969

7070
- name: Setup dotnet
71-
uses: actions/setup-dotnet@v1
71+
uses: actions/setup-dotnet@v4
7272
with:
7373
dotnet-version: |
7474
6.0.x

.nuke/build.schema.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"$schema": "http://json-schema.org/draft-04/schema#",
3-
"title": "Build Schema",
43
"$ref": "#/definitions/build",
4+
"title": "Build Schema",
55
"definitions": {
66
"build": {
77
"type": "object",
@@ -131,4 +131,4 @@
131131
}
132132
}
133133
}
134-
}
134+
}

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: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
using System.Collections.Generic;
1515
using System.IO;
1616
using System.Linq;
17+
using Nuke.Common.Tooling;
1718
using static Nuke.Common.IO.FileSystemTasks;
18-
using static Nuke.Common.IO.PathConstruction;
1919
using static Nuke.Common.Tools.DotNet.DotNetTasks;
2020
using static Nuke.Common.Tools.NuGet.NuGetTasks;
2121
using Project = Nuke.Common.ProjectModel.Project;
@@ -99,7 +99,7 @@ protected override void OnBuildInitialized()
9999

100100
Log.Information("Building version: {Version}", Version);
101101

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

105105
TargetFrameworks = TargetProject.GetTargetFrameworks();
@@ -112,7 +112,7 @@ protected override void OnBuildInitialized()
112112
.Before(Restore)
113113
.Executes(() =>
114114
{
115-
SourceDirectory.GlobDirectories("**/bin", "**/obj").ForEach(DeleteDirectory);
115+
SourceDirectory.GlobDirectories("**/bin", "**/obj").ForEach(x => x.DeleteDirectory());
116116
});
117117

118118
Target Restore => _ => _
@@ -129,6 +129,7 @@ protected override void OnBuildInitialized()
129129
DotNetBuild(s => s
130130
.SetProjectFile(Solution)
131131
.SetConfiguration(Configuration)
132+
.SetContinuousIntegrationBuild(IsServerBuild)
132133
.EnableNoRestore());
133134
});
134135

@@ -140,7 +141,8 @@ protected override void OnBuildInitialized()
140141
.SetProjectFile(Solution)
141142
.SetConfiguration(Configuration)
142143
.EnableNoRestore()
143-
.EnableNoBuild());
144+
.EnableNoBuild()
145+
.When(GitHubActions.Instance is not null, x => x.SetLoggers("GitHubActions")));
144146
});
145147

146148
Target CopyFiles => _ => _
@@ -172,9 +174,9 @@ protected override void OnBuildInitialized()
172174
.SetTargetPath(nuspec)
173175
.SetVersion(Version)
174176
.SetOutputDirectory(NugetDirectory)
175-
.SetSymbols(true)
176-
.SetSymbolPackageFormat("snupkg")
177-
.AddProperty("Configuration", Configuration)
177+
.EnableSymbols()
178+
.SetSymbolPackageFormat(NuGetSymbolPackageFormat.snupkg)
179+
.SetConfiguration(Configuration)
178180
);
179181
});
180182

@@ -185,13 +187,12 @@ protected override void OnBuildInitialized()
185187
{
186188
var apiKey = Environment.GetEnvironmentVariable("NUGET_API_KEY");
187189

188-
189190
if (apiKey.IsNullOrEmpty())
190191
{
191192
throw new BuildAbortedException("Could not resolve the NuGet API key.");
192193
}
193194

194-
foreach (var nupkg in GlobFiles(NugetDirectory, "*.nupkg"))
195+
foreach (var nupkg in NugetDirectory.GlobFiles("*.nupkg"))
195196
{
196197
NuGetPush(s => s
197198
.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>net8.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="8.0.0" />
1515
</ItemGroup>
1616

1717
<ItemGroup>

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@
1818
<ItemGroup>
1919
<PackageReference Include="AngleSharp.Xml" Version="1.0.0" />
2020
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
21-
<PackageReference Include="NUnit" Version="3.13.2" />
22-
<PackageReference Include="NUnit3TestAdapter" Version="4.2.0" />
23-
<PackageReference Include="GitHubActionsTestLogger" Version="2.0.0" PrivateAssets="all" />
24-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.2.0" />
21+
<PackageReference Include="NUnit" Version="3.14.0" />
22+
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
23+
<PackageReference Include="GitHubActionsTestLogger" Version="2.3.3" PrivateAssets="all" />
24+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
2525
</ItemGroup>
2626
</Project>

src/AngleSharp.Css.sln

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,11 @@ EndProject
1616
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{988B2C40-782B-4128-9551-7AE65B60F903}"
1717
ProjectSection(SolutionItems) = preProject
1818
AngleSharp.Css.nuspec = AngleSharp.Css.nuspec
19-
..\build.cake = ..\build.cake
2019
Directory.Build.props = Directory.Build.props
2120
EndProjectSection
2221
EndProject
22+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "_build", "..\nuke\_build.csproj", "{A7AF57F0-E932-4276-A7E9-7109843AECA0}"
23+
EndProject
2324
Global
2425
GlobalSection(SolutionConfigurationPlatforms) = preSolution
2526
Debug|Any CPU = Debug|Any CPU

src/AngleSharp.Css/AngleSharp.Css.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
</PropertyGroup>
1818

1919
<ItemGroup>
20-
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All" />
20+
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" PrivateAssets="All" />
2121
</ItemGroup>
2222

2323
<ItemGroup>

0 commit comments

Comments
 (0)