Skip to content

build: target net10.0 and net11.0 only - #20

Merged
solrevdev merged 3 commits into
masterfrom
chore/net10-net11
Nov 12, 2026
Merged

solrevdev merged 3 commits into
masterfrom
chore/net10-net11

Conversation

@solrevdev

@solrevdev solrevdev commented Nov 12, 2026 •

Copy link
Copy Markdown
Owner

What changed

  • src/Ytx/Ytx.csproj and tests/Ytx.Tests/Ytx.Tests.csproj always target net10.0 and add net11.0 when the SDK is 11 or later:
    <TargetFrameworks>net10.0</TargetFrameworks>
    <TargetFrameworks Condition="$([MSBuild]::VersionGreaterThanOrEquals('$(NETCoreSdkVersion)', '11.0'))">net10.0;net11.0</TargetFrameworks>
  • New global.json: { "sdk": { "version": "10.0.100", "rollForward": "latestMajor", "allowPrerelease": false } }.
  • .github/workflows/publish.yml: both setup-dotnet steps install 10.0.x and 11.0.x only. They list explicit versions and do not use global-json-file, so the new global.json does not reduce them to one SDK. global.json is not in the path filters on purpose, so a build-setting change alone does not publish.
  • .github/workflows/publish.yml: a "Check package targets" step after Pack in both the validate and publish jobs, matching bbx. It fails the run unless the nupkg holds tools/net10.0/any/Ytx.dll and tools/net11.0/any/Ytx.dll. It also requires exactly one package in nupkg/, because unzip -l reads a second path as a member name. codeql.yml uses build-mode: none and sets up no SDK, so it needed no change.
  • README.md (new "SDK policy" section), AGENTS.md and .github/copilot-instructions.md describe the SDK policy and name .NET 10 and 11 only.
  • CHANGELOG.md: a Breaking entry under Unreleased.

Why

John decided on 11 Nov 2026 that tools and tests follow supported .NET versions only. .NET 8 and 9 left support on 10 Nov 2026, so nothing targets them now.

SDK policy

.NET 10 is the LTS and the baseline.

  • With only SDK 11, the project builds and works.
  • With SDKs 10 and 11, latestMajor picks 11 and both targets build.
  • With only SDK 10, the project still builds and works, for net10.0 only.
  • CI installs both SDKs, so the published package ships net10.0 and net11.0. A package packed on SDK 10 alone would hold net10.0 only. The new CI check fails the run in that case, so such a package cannot be published.

<RollForward>Major</RollForward> is already in the csproj since e6f0b16. This PR does not add it again.

Install compatibility

Dropping net8.0 and net9.0 means a machine with only .NET 8 or 9 can no longer install new releases. It needs the .NET 10 or 11 runtime. Older versions stay on NuGet.

Versioning and release

CI owns <Version>, so this PR does not bump it by hand. A normal merge to master triggers publish.yml, which does a patch bump (1.2.2) and publishes to NuGet. To ship this as the minor release it should be (1.3.0), merge with [skip ci] in the merge commit subject, then run "Publish NuGet (ytx)" manually with bump: minor. Merging and releasing is John's call.

Proof (local, macOS, SDKs 10.0.404 and 11.0.100, runtimes 10.0.15 and 11.0.0)

Packs used -p:Version=1.3.0 to match the planned minor bump. Installs went to scratch tool paths. The global install was not touched.

(a) Normal run, repo global.json

dotnet --version: 11.0.100
dotnet build src/Ytx -c Release
  Ytx -> .../bin/Release/net10.0/Ytx.dll
  Ytx -> .../bin/Release/net11.0/Ytx.dll
  0 Warning(s), 0 Error(s)
dotnet test -f net10.0: Passed!  - Failed: 0, Passed: 145, Skipped: 0, Total: 145
dotnet test -f net11.0: Passed!  - Failed: 0, Passed: 145, Skipped: 0, Total: 145
unzip -l solrevdev.ytx.1.3.0.nupkg: tools/net10.0/, tools/net11.0/

(b) SDK 10 only (scratch copy, global.json pinned to 10.0.404 with rollForward: disable, not committed)

dotnet --version: 10.0.404
dotnet build src/Ytx -c Release
  Ytx -> .../bin/Release/net10.0/Ytx.dll
  0 Warning(s), 0 Error(s)
bin/Release: net10.0 (tool and tests)
dotnet test: Passed!  - Failed: 0, Passed: 145, Skipped: 0, Total: 145 (net10.0)
unzip -l solrevdev.ytx.1.3.0.nupkg: tools/net10.0/
ytx --version: ytx 1.3.0

(c) Install the package from (a)

dotnet tool install --tool-path <scratch>/tools --add-source <scratch>/nupkg solrevdev.ytx --version 1.3.0
Tool 'solrevdev.ytx' (version '1.3.0') was successfully installed.
installed tools/: net10.0, net11.0
ytx --version: ytx 1.3.0

(d) Package target check, run locally with the step's exact script

SDK 11 pack (dotnet --version 11.0.100, tools/net10.0 and tools/net11.0):
exit=0

SDK-10-only pack from (b) (tools/net10.0 only):
Package is missing tools/net11.0
exit=1

Folder with two old packages: "Expected one package in .../nupkg, found: ...1.0.4.nupkg ...1.0.5.nupkg", exit=1
Empty folder: "Expected one package ...", exit=1

🤖 Generated with Claude Code

https://claude.ai/code/session_014Mjr3bTLWVmY8sc2j5bcqH

solrevdev and others added 3 commits November 12, 2026 11:14
.NET 8 and 9 left support on 10 Nov 2026. The tool and tests now
target net10.0;net11.0, and CI installs only the 10.0.x and 11.0.x SDKs.
Docs and agent instructions name .NET 10 and 11.

A machine with only .NET 8 or 9 can no longer install new releases.
Release this as a minor bump (1.3.0). RollForward Major is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014Mjr3bTLWVmY8sc2j5bcqH
.NET 10 is the LTS baseline. global.json asks for SDK 10.0.100 and
rolls forward to the latest installed major, so a machine with 10 and
11 builds with 11. The tool and tests target net10.0 always and add
net11.0 when NETCoreSdkVersion is 11 or later, so SDK 10 alone still
builds. CI installs both SDKs, so the package ships both targets.

publish.yml now also runs when global.json changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014Mjr3bTLWVmY8sc2j5bcqH
The package targets depend on the SDK that built it. A "Check package
targets" step after each Pack fails the run unless the nupkg holds
tools/net10.0 and tools/net11.0. It matches bbx's step and also
insists on exactly one package, since unzip -l reads a second path as
a member name.

global.json leaves the path filters again, so a build-setting change
alone does not publish.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014Mjr3bTLWVmY8sc2j5bcqH
@solrevdev
solrevdev merged commit 553578b into master Nov 12, 2026
4 checks passed
@solrevdev
solrevdev deleted the chore/net10-net11 branch November 12, 2026 11:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant