Skip to content

Commit ae5065e

Browse files
authored
Merge pull request #135 from lahma/fallout
Migrate the build orchestrator from NUKE to Fallout, and refresh the CI workflow actions
2 parents ae43398 + 3984c95 commit ae5065e

21 files changed

Lines changed: 87 additions & 84 deletions

‎.config/dotnet-tools.json‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"version": 1,
3+
"isRoot": true,
4+
"tools": {
5+
"fallout.cli": {
6+
"version": "11.0.18",
7+
"commands": [
8+
"fallout"
9+
]
10+
}
11+
}
12+
}
Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
"Quiet"
4949
]
5050
},
51-
"NukeBuild": {
51+
"FalloutBuild": {
5252
"properties": {
5353
"Continue": {
5454
"type": "boolean",
@@ -102,6 +102,13 @@
102102
"Verbosity": {
103103
"description": "Logging verbosity during build execution. Default is 'Normal'",
104104
"$ref": "#/definitions/Verbosity"
105+
},
106+
"BuildProjectFile": {
107+
"type": [
108+
"null",
109+
"string"
110+
],
111+
"description": "Path to the build project (.csproj) relative to the repository root. Defaults to 'build/_build.csproj' when unset. Read by the Fallout global tool's in-tool runner."
105112
}
106113
}
107114
}
@@ -115,11 +122,11 @@
115122
},
116123
"Configuration": {
117124
"type": "string",
118-
"description": "Configuration to build - Default is 'Debug' (local) or 'Release' (server)",
119125
"enum": [
120126
"Debug",
121127
"Release"
122-
]
128+
],
129+
"description": "Configuration to build - Default is 'Debug' (local) or 'Release' (server)"
123130
},
124131
"ReleaseNotesFilePath": {
125132
"type": "string",
@@ -132,7 +139,7 @@
132139
}
133140
},
134141
{
135-
"$ref": "#/definitions/NukeBuild"
142+
"$ref": "#/definitions/FalloutBuild"
136143
}
137144
]
138145
}

‎.github/workflows/ci.yml‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,18 @@ jobs:
1818
id: check_job
1919
run: |
2020
echo "value: ${{ env.DOCS_PATH != null && github.ref == env.DOCS_BRANCH }}"
21-
echo "::set-output name=value::${{ env.DOCS_PATH != null && github.ref == env.DOCS_BRANCH }}"
21+
echo "value=${{ env.DOCS_PATH != null && github.ref == env.DOCS_BRANCH }}" >> "$GITHUB_OUTPUT"
2222
2323
documentation:
2424
needs: [can_document]
2525
runs-on: ubuntu-latest
2626
if: needs.can_document.outputs.value == 'true'
2727

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

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

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

53-
- uses: actions/setup-dotnet@v5
53+
- uses: actions/setup-dotnet@v6
5454
with:
5555
dotnet-version: |
5656
10.0.x
@@ -62,9 +62,9 @@ jobs:
6262
runs-on: windows-latest
6363

6464
steps:
65-
- uses: actions/checkout@v5
65+
- uses: actions/checkout@v7
6666

67-
- uses: actions/setup-dotnet@v5
67+
- uses: actions/setup-dotnet@v6
6868
with:
6969
dotnet-version: |
7070
10.0.x

‎.gitignore‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,5 +195,5 @@ pip-log.txt
195195
# Mac crap
196196
.DS_Store
197197

198-
# Nuke build tool
199-
.nuke/temp
198+
# Fallout build tool
199+
.fallout/temp

‎AGENTS.md‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,19 @@ over AngleSharp's `[DomName]`-style attributes.
1010

1111
## Commands
1212

13-
The orchestrator is NUKE (`nuke/Build.cs`), bootstrapped by `build.ps1` / `build.sh`
14-
(`build.cmd` forwards to either). Default target is `RunUnitTests`.
13+
The orchestrator is [Fallout](https://fallout.build) (`build/Build.cs`), the maintained hard fork
14+
of NUKE. `build.ps1` / `build.sh` (`build.cmd` forwards to either) provision the SDK, then
15+
`dotnet tool restore` + `dotnet fallout`; the CLI itself is pinned in
16+
`.config/dotnet-tools.json` and resolves `build/_build.csproj` by convention. Default target is
17+
`RunUnitTests`.
1518

1619
```powershell
1720
.\build.ps1 # restore, compile, run the full test suite
1821
.\build.ps1 -Target Compile # other targets: Clean Restore Compile RunUnitTests
1922
.\build.ps1 -Target Package # CreatePackage Package PrePublish Publish
2023
```
2124

22-
For the normal edit/test loop use the SDK directly — much faster than the NUKE bootstrap:
25+
For the normal edit/test loop use the SDK directly — much faster than the Fallout bootstrap:
2326

2427
```powershell
2528
dotnet build src/AngleSharp.Js.sln

‎build.ps1‎

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,9 @@ $PSScriptRoot = Split-Path $MyInvocation.MyCommand.Path -Parent
1313
# CONFIGURATION
1414
###########################################################################
1515

16-
$BuildProjectFile = "$PSScriptRoot\nuke\_build.csproj"
17-
$TempDirectory = "$PSScriptRoot\\.nuke\temp"
16+
$TempDirectory = "$PSScriptRoot\.fallout\temp"
1817

19-
$DotNetGlobalFile = "$PSScriptRoot\\global.json"
18+
$DotNetGlobalFile = "$PSScriptRoot\global.json"
2019
$DotNetInstallUrl = "https://dot.net/v1/dotnet-install.ps1"
2120
$DotNetChannel = "STS"
2221

@@ -32,7 +31,7 @@ function ExecSafe([scriptblock] $cmd) {
3231
if ($LASTEXITCODE) { exit $LASTEXITCODE }
3332
}
3433

35-
# If dotnet CLI is installed globally and it matches requested version, use for execution
34+
# If dotnet CLI is installed globally, use it; otherwise provision a local copy under .fallout\temp.
3635
if ($null -ne (Get-Command "dotnet" -ErrorAction SilentlyContinue) -and `
3736
$(dotnet --version) -and $LASTEXITCODE -eq 0) {
3837
$env:DOTNET_EXE = (Get-Command "dotnet").Path
@@ -65,10 +64,5 @@ else {
6564

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

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-
73-
ExecSafe { & $env:DOTNET_EXE build $BuildProjectFile /nodeReuse:false /p:UseSharedCompilation=false -nologo -clp:NoSummary --verbosity quiet }
74-
ExecSafe { & $env:DOTNET_EXE run --project $BuildProjectFile --no-build -- $BuildArguments }
67+
ExecSafe { & $env:DOTNET_EXE tool restore }
68+
ExecSafe { & $env:DOTNET_EXE fallout $BuildArguments }

‎build.sh‎

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,9 @@ SCRIPT_DIR=$(cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd)
99
# CONFIGURATION
1010
###########################################################################
1111

12-
BUILD_PROJECT_FILE="$SCRIPT_DIR/nuke/_build.csproj"
13-
TEMP_DIRECTORY="$SCRIPT_DIR//.nuke/temp"
12+
TEMP_DIRECTORY="$SCRIPT_DIR/.fallout/temp"
1413

15-
DOTNET_GLOBAL_FILE="$SCRIPT_DIR//global.json"
14+
DOTNET_GLOBAL_FILE="$SCRIPT_DIR/global.json"
1615
DOTNET_INSTALL_URL="https://dot.net/v1/dotnet-install.sh"
1716
DOTNET_CHANNEL="STS"
1817

@@ -27,7 +26,7 @@ function FirstJsonValue {
2726
perl -nle 'print $1 if m{"'"$1"'": "([^"]+)",?}' <<< "${@:2}"
2827
}
2928

30-
# If dotnet CLI is installed globally and it matches requested version, use for execution
29+
# If dotnet CLI is installed globally, use it; otherwise provision a local copy under .fallout/temp.
3130
if [ -x "$(command -v dotnet)" ] && dotnet --version &>/dev/null; then
3231
export DOTNET_EXE="$(command -v dotnet)"
3332
else
@@ -58,10 +57,5 @@ fi
5857

5958
echo "Microsoft (R) .NET SDK version $("$DOTNET_EXE" --version)"
6059

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-
66-
"$DOTNET_EXE" build "$BUILD_PROJECT_FILE" /nodeReuse:false /p:UseSharedCompilation=false -nologo -clp:NoSummary --verbosity quiet
67-
"$DOTNET_EXE" run --project "$BUILD_PROJECT_FILE" --no-build -- "$@"
60+
"$DOTNET_EXE" tool restore
61+
exec "$DOTNET_EXE" fallout "$@"
File renamed without changes.

nuke/Build.cs renamed to build/Build.cs

Lines changed: 16 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,32 @@
1+
using Fallout.Common;
2+
using Fallout.Common.CI.GitHubActions;
3+
using Fallout.Common.IO;
4+
using Fallout.Common.Tools.DotNet;
5+
using Fallout.Common.Tools.GitHub;
6+
using Fallout.Common.Utilities.Collections;
7+
using Fallout.Solutions;
18
using Microsoft.Build.Exceptions;
2-
using Nuke.Common;
3-
using Nuke.Common.CI.GitHubActions;
4-
using Nuke.Common.IO;
5-
using Nuke.Common.ProjectModel;
6-
using Nuke.Common.Tools.DotNet;
7-
using Nuke.Common.Tools.GitHub;
8-
using Nuke.Common.Utilities.Collections;
99
using Octokit;
1010
using Octokit.Internal;
1111
using Serilog;
1212
using System;
1313
using System.Collections.Generic;
1414
using System.IO;
1515
using System.Linq;
16-
using static Nuke.Common.Tools.DotNet.DotNetTasks;
17-
using Project = Nuke.Common.ProjectModel.Project;
16+
using static Fallout.Common.Tools.DotNet.DotNetTasks;
17+
using Project = Fallout.Solutions.Project;
1818

19-
class Build : NukeBuild
19+
class Build : FalloutBuild
2020
{
21-
/// Support plugins are available for:
22-
/// - JetBrains ReSharper https://nuke.build/resharper
23-
/// - JetBrains Rider https://nuke.build/rider
24-
/// - Microsoft VisualStudio https://nuke.build/visualstudio
25-
/// - Microsoft VSCode https://nuke.build/vscode
26-
2721
public static int Main () => Execute<Build>(x => x.RunUnitTests);
2822

29-
[Nuke.Common.Parameter("Configuration to build - Default is 'Debug' (local) or 'Release' (server)")]
23+
[Fallout.Common.Parameter("Configuration to build - Default is 'Debug' (local) or 'Release' (server)")]
3024
readonly Configuration Configuration = IsLocalBuild ? Configuration.Debug : Configuration.Release;
3125

32-
[Nuke.Common.Parameter("ReleaseNotesFilePath - To determine the SemanticVersion")]
26+
[Fallout.Common.Parameter("ReleaseNotesFilePath - To determine the SemanticVersion")]
3327
readonly AbsolutePath ReleaseNotesFilePath = RootDirectory / "CHANGELOG.md";
3428

35-
[Nuke.Common.Parameter("AngleSharp package version override (e.g. 1.0.0 for compatibility checks)")]
29+
[Fallout.Common.Parameter("AngleSharp package version override (e.g. 1.0.0 for compatibility checks)")]
3630
readonly string AngleSharpVersion;
3731

3832
[Solution]
@@ -52,7 +46,7 @@ class Build : NukeBuild
5246

5347
Project TargetProject { get; set; }
5448

55-
// Note: The ChangeLogTasks from Nuke itself look buggy. So using the Cake source code.
49+
// Note: The built-in ChangeLogTasks (inherited from NUKE) look buggy. So using the Cake source code.
5650
IReadOnlyList<ReleaseNotes> ChangeLog { get; set; }
5751

5852
ReleaseNotes LatestReleaseNotes { get; set; }
@@ -244,7 +238,7 @@ protected override void OnBuildInitialized()
244238
var credentials = new Credentials(gitHubToken);
245239

246240
GitHubTasks.GitHubClient = new GitHubClient(
247-
new ProductHeaderValue(nameof(NukeBuild)),
241+
new ProductHeaderValue(nameof(FalloutBuild)),
248242
new InMemoryCredentialStore(credentials));
249243

250244
GitHubTasks.GitHubClient.Repository.Release
@@ -280,7 +274,7 @@ protected override void OnBuildInitialized()
280274
var credentials = new Credentials(gitHubToken);
281275

282276
GitHubTasks.GitHubClient = new GitHubClient(
283-
new ProductHeaderValue(nameof(NukeBuild)),
277+
new ProductHeaderValue(nameof(FalloutBuild)),
284278
new InMemoryCredentialStore(credentials));
285279

286280
GitHubTasks.GitHubClient.Repository.Release

0 commit comments

Comments
 (0)