Skip to content

build: pin the .NET 10 SDK with global.json - #214

Merged
CaffeinatedCoder merged 3 commits into
mainfrom
build/sdk-pin
Oct 18, 2026
Merged

CaffeinatedCoder merged 3 commits into
mainfrom
build/sdk-pin

Conversation

@CaffeinatedCoder

Copy link
Copy Markdown
Owner

Closes #207

Problem

The repository had no global.json. CI pinned dotnet-version: 10.0.x in both workflows, but a local build took whatever SDK was first on the machine: the external assessment of 2026-10-18 compiled the repo with an installed .NET 11 RC SDK while CI compiled it with .NET 10, so the compiler that checked the code locally was not the one that ships it.

Change

  • global.json: 10.0.100 with rollForward: latestFeature. Any 10.0.x SDK satisfies it; an 11.x SDK, or a 9.x one, is refused with "A compatible .NET SDK was not found". The net11 branch gets its own pin in its own change.
  • .github/workflows/dotnet.yml (four jobs) and release.yml (verify job): setup-dotnet reads global-json-file: global.json instead of a hard-coded dotnet-version. The pinned action (v5.4.0) maps latestFeature to "latest 10.0 SDK" (src/setup-dotnet.ts, getVersionFromGlobalJson), so it installs exactly what 10.0.x installed. The publish job keeps dotnet-version: 10.0.x with a comment: it has no checkout, so no global.json, and any SDK of the line can push packages.
  • CONTRIBUTING.md: a note under "Getting set up" and a paragraph under "Branches and releases" saying each line pins its SDK there.

Tests

Local, with only SDK 10.0.402 installed:

  • dotnet --version inside the repo prints 10.0.402 (resolved through latestFeature from 10.0.100); dotnet build succeeds.
  • With the pin temporarily set to 10.0.900 (no such feature band installed) and to 9.0.100 (another major), dotnet --version fails with "A compatible .NET SDK was not found", which is the refusal an 11.x-only machine would see. Restored afterwards.
  • ReleaseWiringConventionTests, PackagingConventionTests and ChangelogConventionTests pass (33/33). The workflow files parse as YAML.
  • This PR's own CI run is the check that global-json-file resolves on the runners.

🤖 Generated with Claude Code

A local build took whatever SDK was first on the machine, so a .NET 11
RC compiler could check what a .NET 10 one ships. global.json pins
10.0.100 with rollForward latestFeature: any 10.0.x SDK satisfies it
and another major is refused. The workflows read the same file through
setup-dotnet's global-json-file, which installs the latest 10.0 SDK for
latestFeature exactly as 10.0.x did; the publish job keeps dotnet-version
because it has no checkout.

Closes #207

Co-Authored-By: Claude Fable 5.1 <[email protected]>
@CaffeinatedCoder CaffeinatedCoder added this to the 10.0.0 milestone Oct 18, 2026
@CaffeinatedCoder CaffeinatedCoder added chore Build, CI, packaging, refactoring with no behaviour change area/release Versioning, changelogs, release wiring labels Oct 18, 2026
@CaffeinatedCoder
CaffeinatedCoder merged commit 9400827 into main Oct 18, 2026
@CaffeinatedCoder
CaffeinatedCoder deleted the build/sdk-pin branch October 18, 2026 19:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/release Versioning, changelogs, release wiring chore Build, CI, packaging, refactoring with no behaviour change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Pin the SDK per line with a global.json (10.0.x on main, 11.0.x on net11)

1 participant