Repository navigation
ci: make global.json the single source of truth for the SDK version - #30
Merged
Merged
Conversation
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.
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.
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.