From 81b7ad83b43d32b4f8524b6e20bf807fba219b62 Mon Sep 17 00:00:00 2001 From: Van Nguyen Date: Wed, 21 Oct 2026 21:38:48 +0700 Subject: [PATCH] feat(dotnet): test on the .NET 10 SDK by default .NET 8 and .NET 9 both reach end of support on 10 November 2026, and .NET 10 is the current LTS. The dotnet stack and the stack-dotnet workflow now default to ["10.0"] instead of ["8.0","9.0"]; the GitLab job falls back to the 10.0 image. Existing ci.yml files keep the list they were written with until the next `repokeeper update`. A project that still targets net8.0 or net9.0 should move to net10.0 or set `stack_options.dotnet.versions`. --- .github/workflows/stack-dotnet.yml | 2 +- .github/workflows/workflow-tests.yml | 2 +- fixtures/dotnet/Fixture.Tests.csproj | 2 +- src/platforms/gitlab-jobs.ts | 2 +- src/stacks/dotnet.ts | 2 +- test/platforms-gitlab-stacks.test.ts | 3 +++ test/stacks-dotnet.test.ts | 2 +- 7 files changed, 9 insertions(+), 6 deletions(-) diff --git a/.github/workflows/stack-dotnet.yml b/.github/workflows/stack-dotnet.yml index 57ff4ae..d0a2f72 100644 --- a/.github/workflows/stack-dotnet.yml +++ b/.github/workflows/stack-dotnet.yml @@ -6,7 +6,7 @@ on: dotnet-versions: description: JSON list of .NET SDK versions, all installed side by side type: string - default: '["8.0","9.0"]' + default: '["10.0"]' os: description: JSON list of runner labels type: string diff --git a/.github/workflows/workflow-tests.yml b/.github/workflows/workflow-tests.yml index ca925e7..a591c60 100644 --- a/.github/workflows/workflow-tests.yml +++ b/.github/workflows/workflow-tests.yml @@ -155,7 +155,7 @@ jobs: with: working-directory: fixtures/dotnet os: ${{ github.event_name == 'push' && '["ubuntu-latest","windows-latest"]' || '["ubuntu-latest"]' }} - dotnet-versions: '["8.0","9.0"]' + dotnet-versions: '["10.0"]' commands: '["dotnet restore","dotnet format --verify-no-changes --no-restore","dotnet build --no-restore","dotnet test --no-build"]' go: needs: changes diff --git a/fixtures/dotnet/Fixture.Tests.csproj b/fixtures/dotnet/Fixture.Tests.csproj index 5273390..4041350 100644 --- a/fixtures/dotnet/Fixture.Tests.csproj +++ b/fixtures/dotnet/Fixture.Tests.csproj @@ -1,7 +1,7 @@ - net8.0 + net10.0 enable enable false diff --git a/src/platforms/gitlab-jobs.ts b/src/platforms/gitlab-jobs.ts index 41a0714..edc0225 100644 --- a/src/platforms/gitlab-jobs.ts +++ b/src/platforms/gitlab-jobs.ts @@ -178,7 +178,7 @@ export function stackJobs(stack: ResolvedStack): Array<{ key: string; job: Job } return [{ key: stack.id, job: perVersion(image, "JAVA_VERSION", list(input, "java-versions"), commands) }]; } if (stack.id === "dotnet") { - const [newest = "9.0", ...older] = newestFirst(list(input, "dotnet-versions")); + const [newest = "10.0", ...older] = newestFirst(list(input, "dotnet-versions")); return [ { key: "dotnet", diff --git a/src/stacks/dotnet.ts b/src/stacks/dotnet.ts index b42400b..76b87cd 100644 --- a/src/stacks/dotnet.ts +++ b/src/stacks/dotnet.ts @@ -63,7 +63,7 @@ export const dotnetStack: StackPack = { ci: { workflow: "stack-dotnet.yml", with: { - "dotnet-versions": JSON.stringify(stringList("dotnet", options, "versions") ?? ["8.0", "9.0"]), + "dotnet-versions": JSON.stringify(stringList("dotnet", options, "versions") ?? ["10.0"]), os: JSON.stringify(stringList("dotnet", options, "os") ?? ["ubuntu-latest"]), commands: JSON.stringify([ `dotnet restore${target}`, diff --git a/test/platforms-gitlab-stacks.test.ts b/test/platforms-gitlab-stacks.test.ts index 565785b..4a8209c 100644 --- a/test/platforms-gitlab-stacks.test.ts +++ b/test/platforms-gitlab-stacks.test.ts @@ -230,6 +230,9 @@ describe("gitlab ci for the other stacks", () => { "\n \n 0.1.0\n \n\n", }); expectBump(versioned, ["Directory.Build.props"]); + // with no versions set, the .NET 10 SDK alone + expect(versioned.ci.dotnet?.image).toBe("mcr.microsoft.com/dotnet/sdk:10.0"); + expect(versioned.ci.dotnet?.script?.[0]).toBe("dotnet restore"); }); it("script: a job per kind of script, with the versions the GitHub workflow pins", async () => { diff --git a/test/stacks-dotnet.test.ts b/test/stacks-dotnet.test.ts index 4bd90e7..6697882 100644 --- a/test/stacks-dotnet.test.ts +++ b/test/stacks-dotnet.test.ts @@ -22,7 +22,7 @@ it("restores, checks formatting, builds and tests, and releases through Director expect(stack.ci).toEqual({ workflow: "stack-dotnet.yml", with: { - "dotnet-versions": '["8.0","9.0"]', + "dotnet-versions": '["10.0"]', os: '["ubuntu-latest"]', commands: '["dotnet restore","dotnet format --verify-no-changes --no-restore","dotnet build --no-restore","dotnet test --no-build"]',