build: migrate from Cake to Nuke - #198
Closed
phmatray wants to merge 1 commit into
Closed
Conversation
Replaces build.cake with a Nuke build under build/, matching FormCraft and PipeException — the portfolio's other two build-automation repos — so there is one build system to know instead of two. The task graph is translated faithfully rather than reimagined: Clean -> Restore -> Compile -> Test -> Pack -> Validate -> Publish, with Validate as the default target, exactly as Cake's Default stopped at Validate-NuGet-Package. Artifacts stay in ./.artifacts so nothing outside the build has to move. TreatWarningsAsErrors is passed as an MSBuild property, not added to the project files, so it binds CI and command-line builds and leaves an IDE build alone — the same reach Cake's TreatAllWarningsAs(Error) had. Three deliberate differences, each an improvement rather than a port: - the NuGet package validator is restored as the LOCAL tool already pinned in dotnet-tools.json, instead of 'dotnet tool update --global' drifting to whatever version the machine happens to have; - Publish uses Requires(NuGetApiKey) where Cake used WithCriteria(IsRunningOnGitHubActions), which skipped silently off CI. It now fails and says why rather than reporting success without publishing; - Validate asserts at least one .nupkg exists before validating, so an empty artifacts directory cannot pass as 'all packages valid'. cake.tool is dropped from dotnet-tools.json; the validator stays. Both workflows now invoke ./build.sh and gain the .nuke/temp + ~/.nuget/packages cache the sibling repos use. .nuke/temp is git-ignored. Trusted Publishing is preserved: publish.yml still exchanges the OIDC token for a short-lived key and feeds it to Nuke through the NuGetApiKey parameter.
Up to standards ✅🟢 Issues
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replaces
build.cakewith a Nuke build underbuild/, matching FormCraft and PipeException — the portfolio's other two build-automation repos — so there is one build system to know instead of two. MasterCommander was the last classic Cake script.The task graph is translated, not reimagined
Clean → Restore → Compile → Test → Pack → Validate → Publish, with Validate as the default target — exactly as Cake'sDefaultstopped atValidate-NuGet-Package. Artifacts stay in./.artifactsso nothing outside the build has to move.--rebuildstill gatesCleanand no-incremental, asWithCriteria(HasArgument("rebuild"))did.TreatWarningsAsErrorsis passed as an MSBuild property, not added to the project files: that binds CI and command-line builds while leaving an IDE build alone — the same reachTreatAllWarningsAs(Error)had. Putting it in the.csprojwould have quietly changed local development too.Three deliberate differences, each an improvement rather than a port
dotnet tool update … --globalbefore validatingdotnet-tools.json1.0.59and then overrode it with whatever was latest on the machineWithCriteria(IsRunningOnGitHubActions)on publishRequires(() => NuGetApiKey)publishreported success while pushing nothing.nupkgfirstWhat I could not verify locally, stated plainly
global.jsonpins SDK10.0.302; this machine has10.0.301, androllForwarddoes not roll backward — so I could not build or run anything in this repo. I compiledbuild/Build.csin an isolated directory outside the repo instead, where the pin does not apply: build succeeded, which validates every Nuke API call in it. What that does not prove is the pipeline end to end. This PR's own CI run is the first real execution of the new build, and it is what should be trusted over my say-so.For the same reason
.nuke/build.schema.jsonis not committed (PipeException does commit its own): Nuke writes it on first run, and I could not produce one. It regenerates on the first local./build.shand only affects editor completion inparameters.json.One thing to be aware of
Nuke.Common10.1.0 drags in transitive packages with 16 NuGet security advisories (GHSA-*). PipeException's build project reports the identical 16, so this is inherent to Nuke rather than something introduced here, andbuild/_build.csprojis not part ofMasterCommander.slnso it never reaches the shipped package. Flagging it rather than leaving you to find it.