Skip to content

Commit e470240

Browse files
committed
chore: update nuke to v8
1 parent 600642a commit e470240

File tree

8 files changed

+62
-57
lines changed

8 files changed

+62
-57
lines changed

.github/workflows/ci-deploy.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,17 +26,17 @@ jobs:
2626
name: windows-latest
2727
runs-on: windows-latest
2828
steps:
29-
- uses: actions/checkout@v2
29+
- uses: actions/checkout@v3
3030
with:
3131
fetch-depth: 0
32-
- name: Cache .nuke/temp, ~/.nuget/packages
33-
uses: actions/cache@v2
32+
- name: 'Cache: .nuke/temp, ~/.nuget/packages'
33+
uses: actions/cache@v3
3434
with:
3535
path: |
3636
.nuke/temp
3737
~/.nuget/packages
38-
key: ${{ runner.os }}-${{ hashFiles('**/global.json', '**/*.csproj') }}
39-
- name: Run './build.cmd Compile CreateRelease'
38+
key: ${{ runner.os }}-${{ hashFiles('**/global.json', '**/*.csproj', '**/Directory.Packages.props') }}
39+
- name: 'Run: Compile, CreateRelease'
4040
run: ./build.cmd Compile CreateRelease
4141
env:
4242
GithubToken: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/ci.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,15 @@ jobs:
2929
name: windows-latest
3030
runs-on: windows-latest
3131
steps:
32-
- uses: actions/checkout@v2
32+
- uses: actions/checkout@v3
3333
with:
3434
fetch-depth: 0
35-
- name: Cache .nuke/temp, ~/.nuget/packages
36-
uses: actions/cache@v2
35+
- name: 'Cache: .nuke/temp, ~/.nuget/packages'
36+
uses: actions/cache@v3
3737
with:
3838
path: |
3939
.nuke/temp
4040
~/.nuget/packages
41-
key: ${{ runner.os }}-${{ hashFiles('**/global.json', '**/*.csproj') }}
42-
- name: Run './build.cmd Compile'
41+
key: ${{ runner.os }}-${{ hashFiles('**/global.json', '**/*.csproj', '**/Directory.Packages.props') }}
42+
- name: 'Run: Compile'
4343
run: ./build.cmd Compile

.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",
@@ -140,4 +140,4 @@
140140
}
141141
}
142142
}
143-
}
143+
}

build.ps1

Lines changed: 9 additions & 4 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

66-
Write-Output "Microsoft (R) .NET Core SDK version $(& $env:DOTNET_EXE --version)"
66+
Write-Output "Microsoft (R) .NET SDK version $(& $env:DOTNET_EXE --version)"
67+
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+
}
6772

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: 9 additions & 4 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

59-
echo "Microsoft (R) .NET Core SDK version $("$DOTNET_EXE" --version)"
59+
echo "Microsoft (R) .NET SDK version $("$DOTNET_EXE" --version)"
60+
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
6065

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 -- "$@"

build/Build.cs

Lines changed: 26 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@
1616
using Nuke.Common.Utilities.Collections;
1717
using Octokit;
1818
using Serilog;
19-
using static Nuke.Common.IO.CompressionTasks;
20-
using static Nuke.Common.IO.FileSystemTasks;
2119
using static Nuke.Common.Tools.DotNet.DotNetTasks;
2220

2321
[GitHubActions(
@@ -49,11 +47,6 @@
4947
[ShutdownDotNetAfterServerBuild]
5048
class Build : NukeBuild
5149
{
52-
/// Support plugins are available for:
53-
/// - JetBrains ReSharper https://nuke.build/resharper
54-
/// - JetBrains Rider https://nuke.build/rider
55-
/// - Microsoft VisualStudio https://nuke.build/visualstudio
56-
/// - Microsoft VSCode https://nuke.build/vscode
5750
public static int Main() => Execute<Build>(x => x.Compile);
5851

5952
protected override void OnBuildInitialized()
@@ -83,14 +76,17 @@ protected override void OnBuildInitialized()
8376
Log.Information("NuGet Version: {NuGetVersion}", GitVersion.NuGetVersion);
8477
}
8578

86-
[Parameter("Configuration to build - Default is 'Debug' (local) or 'Release' (server)")] readonly Configuration Configuration = IsLocalBuild ? Configuration.Debug : Configuration.Release;
79+
[Parameter("Configuration to build - Default is 'Debug' (local) or 'Release' (server)")]
80+
readonly Configuration Configuration = IsLocalBuild ? Configuration.Debug : Configuration.Release;
8781

88-
[Solution(GenerateProjects = true, SuppressBuildProjectCheck = false)] readonly Solution Solution;
89-
[GitRepository] readonly GitRepository GitRepository;
90-
[GitVersion(Framework = "net6.0", NoFetch = true)] readonly GitVersion GitVersion;
82+
[Solution(GenerateProjects = true, SuppressBuildProjectCheck = false)]
83+
readonly Solution Solution;
84+
[GitRepository]
85+
readonly GitRepository GitRepository;
86+
[GitVersion(Framework = "net6.0", NoFetch = true)]
87+
readonly GitVersion GitVersion;
9188

9289
AbsolutePath SourceDirectory => RootDirectory / "src";
93-
AbsolutePath TestsDirectory => RootDirectory / "tests";
9490
AbsolutePath OutputDirectory => RootDirectory / "artifacts";
9591

9692
Target Clean => _ => _
@@ -99,9 +95,8 @@ protected override void OnBuildInitialized()
9995
{
10096
try
10197
{
102-
SourceDirectory.GlobDirectories("**/bin", "**/obj").ForEach(EnsureCleanDirectory);
103-
TestsDirectory.GlobDirectories("**/bin", "**/obj").ForEach(EnsureCleanDirectory);
104-
OutputDirectory.GlobDirectories("*.*").ForEach(EnsureCleanDirectory);
98+
SourceDirectory.GlobDirectories("**/bin", "**/obj").ForEach(d => d.DeleteDirectory());
99+
OutputDirectory.CreateOrCleanDirectory();
105100
}
106101
catch
107102
{
@@ -144,11 +139,12 @@ protected override void OnBuildInitialized()
144139
.SetAssemblyVersion(GitVersion.AssemblySemVer)
145140
.SetFileVersion(GitVersion.AssemblySemFileVer)
146141
.SetInformationalVersion(GitVersion.InformationalVersion)
147-
.SetFramework("net5.0-windows")
142+
.SetFramework("net8.0-windows")
148143
.SetRuntime("win-x64")
149144
.DisablePublishTrimmed()
150145
.EnableSelfContained()
151146
.EnablePublishSingleFile()
147+
.EnableDeterministic()
152148
.SetProperty("IncludeNativeLibrariesForSelfExtract", true)
153149
.SetProperty("IncludeAllContentForSelfExtract", true)
154150
);
@@ -160,13 +156,13 @@ protected override void OnBuildInitialized()
160156
.OnlyWhenStatic(() => EnvironmentInfo.IsWin)
161157
.Executes(() =>
162158
{
163-
Compress(SourceDirectory / "IconPacks.Browser" / "bin" / Configuration / "net47", OutputDirectory / $"IconPacks.Browser-net47-v{GitVersion.NuGetVersion}.zip");
164-
Compress(SourceDirectory / "IconPacks.Browser" / "bin" / Configuration / "net5.0-windows" / "win-x64" / "publish", OutputDirectory / $"IconPacks.Browser-net50-v{GitVersion.NuGetVersion}.zip");
159+
(SourceDirectory / "IconPacks.Browser" / "bin" / Configuration / "net47").ZipTo(OutputDirectory / $"IconPacks.Browser-net47-v{GitVersion.NuGetVersion}.zip");
160+
(SourceDirectory / "IconPacks.Browser" / "bin" / Configuration / "net8.0-windows" / "win-x64" / "publish").ZipTo(OutputDirectory / $"IconPacks.Browser-net8-v{GitVersion.NuGetVersion}.zip");
165161
});
166162

167163
Target SignArtifacts => _ => _
168164
.DependsOn(Publish)
169-
.OnlyWhenStatic(() => EnvironmentInfo.IsWin)
165+
.OnlyWhenStatic(() => EnvironmentInfo.IsWin && !IsLocalBuild)
170166
.Executes(() =>
171167
{
172168
var files = SourceDirectory.GlobFiles("**/bin/**/IconPacks.Browser.exe").Select(p => p.ToString());
@@ -227,12 +223,12 @@ private void UploadReleaseAssetToGithub(IGitHubClient client, Release release, A
227223
Log.Information("Done Uploading {FileName} to the release", asset.Name);
228224
}
229225

230-
[Parameter("GitHub Api key")] [Secret] string GithubToken = null;
231-
[Parameter] [Secret] readonly string AzureKeyVaultUrl;
232-
[Parameter] [Secret] readonly string AzureKeyVaultClientId;
233-
[Parameter] [Secret] readonly string AzureKeyVaultTenantId;
234-
[Parameter] [Secret] readonly string AzureKeyVaultClientSecret;
235-
[Parameter] [Secret] readonly string AzureKeyVaultCertificate;
226+
[Parameter("GitHub Api key")][Secret] string GithubToken = null;
227+
[Parameter][Secret] readonly string AzureKeyVaultUrl;
228+
[Parameter][Secret] readonly string AzureKeyVaultClientId;
229+
[Parameter][Secret] readonly string AzureKeyVaultTenantId;
230+
[Parameter][Secret] readonly string AzureKeyVaultClientSecret;
231+
[Parameter][Secret] readonly string AzureKeyVaultCertificate;
236232

237233
void SignFiles(IEnumerable<string> files, string description, string descriptionUrl)
238234
{
@@ -244,11 +240,11 @@ void SignFiles(IEnumerable<string> files, string description, string description
244240
.ToggleNoPageHashing()
245241
.SetTimestampRfc3161Url("http://timestamp.digicert.com")
246242
.SetTimestampDigest(AzureSignToolDigestAlgorithm.sha256)
247-
.SetKeyVaultUrl(EnvironmentInfo.GetParameter<string>(nameof(AzureKeyVaultUrl)))
248-
.SetKeyVaultClientId(EnvironmentInfo.GetParameter<string>(nameof(AzureKeyVaultClientId)))
249-
.SetKeyVaultTenantId(EnvironmentInfo.GetParameter<string>(nameof(AzureKeyVaultTenantId)))
250-
.SetKeyVaultClientSecret(EnvironmentInfo.GetParameter<string>(nameof(AzureKeyVaultClientSecret)))
251-
.SetKeyVaultCertificateName(EnvironmentInfo.GetParameter<string>(nameof(AzureKeyVaultCertificate)))
243+
.SetKeyVaultUrl(EnvironmentInfo.GetVariable<string>(nameof(AzureKeyVaultUrl)))
244+
.SetKeyVaultClientId(EnvironmentInfo.GetVariable<string>(nameof(AzureKeyVaultClientId)))
245+
.SetKeyVaultTenantId(EnvironmentInfo.GetVariable<string>(nameof(AzureKeyVaultTenantId)))
246+
.SetKeyVaultClientSecret(EnvironmentInfo.GetVariable<string>(nameof(AzureKeyVaultClientSecret)))
247+
.SetKeyVaultCertificateName(EnvironmentInfo.GetVariable<string>(nameof(AzureKeyVaultCertificate)))
252248
;
253249

254250
AzureSignToolTasks.AzureSignTool(azureSignToolSettings);

build/_build.csproj

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,17 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>net6.0</TargetFramework>
5+
<TargetFramework>net8.0</TargetFramework>
66
<NoWarn>CS0649;CS0169</NoWarn>
77
<NukeRootDirectory>..</NukeRootDirectory>
88
<NukeScriptDirectory>..</NukeScriptDirectory>
99
<NukeTelemetryVersion>1</NukeTelemetryVersion>
1010
</PropertyGroup>
1111

1212
<ItemGroup>
13-
<PackageReference Include="Nuke.Common" Version="6.2.1" />
14-
<PackageReference Include="Nuke.GitHub" Version="3.0.0" />
15-
<PackageDownload Include="AzureSignTool" Version="[3.0.0]" />
16-
<PackageDownload Include="GitVersion.Tool" Version="[5.10.3]" />
13+
<PackageReference Include="Nuke.Common" Version="8.0.0" />
14+
<PackageDownload Include="AzureSignTool" Version="[5.0.0]" />
15+
<PackageDownload Include="GitVersion.Tool" Version="[5.12.0]" />
1716
</ItemGroup>
1817

1918
</Project>

global.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"sdk": {
3-
"version": "8.0.100",
3+
"version": "8.0.300",
44
"rollForward": "feature"
55
}
6-
}
6+
}

0 commit comments

Comments
 (0)