From 98331c06cddb82028ab2502ba1933629fd751386 Mon Sep 17 00:00:00 2001 From: Taras Kovalenko Date: Mon, 24 Aug 2026 11:37:53 +0300 Subject: [PATCH] ci: build the pipelines on the .NET 10 SDK MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The release workflow fails before it does anything: Error: Failed to install dotnet, exit code: 1. dotnet_install: Error: Could not find `.NET Core SDK` with version = 9.0.0 global.json asks for SDK 9.0.0. That version does not exist and never has — the 9.0 band starts at 9.0.100. It has been harmless up to now because rollForward quietly lands on whatever 9.0.1xx is installed, but actions/setup-dotnet reads the pin literally when it is given a global-json-file, and release.yml gives it one. Rather than correct the pin to a real 9.0 patch, move to 10.0.100 and have both workflows install 10.0.x directly. The .NET 10 SDK compiles net8.0 and net9.0 as well, so one SDK is enough and the 8.0.x and 9.0.x installs come out of every job. The test projects already roll forward to whatever runtime is present, so nothing else has to change. Verified on a machine with only the .NET 10 SDK, with bin/ and obj/ wiped first: restore, build, test and pack --no-build all succeed, and the package still ships tools for net8.0, net9.0 and net10.0. --- .github/workflows/dotnet.yml | 10 ++-------- .github/workflows/release.yml | 8 ++------ README.md | 2 +- global.json | 2 +- 4 files changed, 6 insertions(+), 16 deletions(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 29b4771..b130dfc 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -24,10 +24,7 @@ jobs: - name: Setup .NET uses: actions/setup-dotnet@v4 with: - dotnet-version: | - 8.0.x - 9.0.x - 10.0.x + dotnet-version: 10.0.x - name: Cache NuGet packages uses: actions/cache@v4 @@ -96,10 +93,7 @@ jobs: - name: Setup .NET uses: actions/setup-dotnet@v4 with: - dotnet-version: | - 8.0.x - 9.0.x - 10.0.x + dotnet-version: 10.0.x - name: Pack run: dotnet pack CentralConfigGenerator/CentralConfigGenerator.csproj -c Release -o ./artifacts diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 778d535..4b4dc1f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -25,14 +25,10 @@ jobs: with: fetch-depth: 0 - # The tool multi-targets net8.0/net9.0/net10.0, so every SDK has to be present. + # The .NET 10 SDK builds every framework the tool targets, so one SDK is enough. - uses: actions/setup-dotnet@v4 with: - global-json-file: global.json - dotnet-version: | - 8.0.x - 9.0.x - 10.0.x + dotnet-version: 10.0.x - name: Resolve version id: version diff --git a/README.md b/README.md index 2700a02..e9e93dd 100644 --- a/README.md +++ b/README.md @@ -395,7 +395,7 @@ Key types: `MigrationService`, `AnalysisEngine`, `AutoFixService`, `Verification ## Contributing -See [CONTRIBUTING.md](CONTRIBUTING.md). Build and test with: +See [CONTRIBUTING.md](CONTRIBUTING.md). Building the repository needs the .NET 10 SDK — it compiles all three target frameworks, so it is the only one you have to install. ```bash dotnet build diff --git a/global.json b/global.json index 3c5cf51..6a28850 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "9.0.0", + "version": "10.0.100", "rollForward": "latestMajor", "allowPrerelease": false }