Skip to content

ci: make global.json the single source of truth for the SDK version - #30

Merged
kieronlanning merged 2 commits into
fix-packfrom
release-types
Oct 15, 2026
Merged

kieronlanning merged 2 commits into
fix-packfrom
release-types

Conversation

@kieronlanning

Copy link
Copy Markdown
Contributor

The shared workflows installed whatever dotnet-version said and left global.json to fend for itself. Those two can disagree, and when they do the job cannot recover: every dotnet command resolves against global.json, so the first one - dotnet tool install Purview.Build - fails with "A compatible .NET SDK was not found" and takes the run with it. A consuming repository had to state its SDK three times (global.json, pr.yml, release.yml) and keep the copies in step by hand, with nothing checking that it had.

Both workflows now read sdk.version from global.json and install exactly that. The dotnet-version input still applies when global.json pins nothing, so every repository that does not pin keeps the behaviour it has today.

Verified against all eight consuming repositories: zodsharp, value-objects and results resolve their pinned 11.0.100-rc.1.26425.128, and build-sdk, sourcegenerator-framework, telemetry-sourcegenerator, aspirec4 and aspire-resourcekit fall back to the 10.0.x input unchanged.

Consumers can drop their explicit dotnet-version once this is on main; until then it is simply redundant rather than wrong, because an explicit value that matches global.json installs the same SDK.

The shared workflows installed whatever dotnet-version said and left global.json
to fend for itself. Those two can disagree, and when they do the job cannot
recover: every dotnet command resolves against global.json, so the first one -
`dotnet tool install Purview.Build` - fails with "A compatible .NET SDK was not
found" and takes the run with it. A consuming repository had to state its SDK
three times (global.json, pr.yml, release.yml) and keep the copies in step by
hand, with nothing checking that it had.

Both workflows now read sdk.version from global.json and install exactly that.
The dotnet-version input still applies when global.json pins nothing, so every
repository that does not pin keeps the behaviour it has today.

Verified against all eight consuming repositories: zodsharp, value-objects and
results resolve their pinned 11.0.100-rc.1.26425.128, and build-sdk,
sourcegenerator-framework, telemetry-sourcegenerator, aspirec4 and
aspire-resourcekit fall back to the 10.0.x input unchanged.

Consumers can drop their explicit dotnet-version once this is on main; until
then it is simply redundant rather than wrong, because an explicit value that
matches global.json installs the same SDK.
@kieronlanning
kieronlanning merged commit baa24e2 into fix-pack Oct 15, 2026
1 check failed
@kieronlanning
kieronlanning deleted the release-types branch October 15, 2026 15:20
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