Skip to content

Conversation

@Arlodotexe
Copy link
Member

Problem

The current CI setup has version specified in two places:

  1. global.json with exact version (9.0.308) and rollForward: disable
  2. DOTNET_VERSION env var in workflow with floating version (9.0.x)

This led to a previous breakage when GitHub Actions runners installed 9.0.309 while global.json expected 9.0.308 (fixed in #826 by disabling rollForward).

Solution

This PR implements single source of truth for .NET SDK version:

  • Version update: 9.0.308 → 9.0.310
  • Workflow pattern: Use global-json-file: global.json input for actions/setup-dotnet@v4
  • Step reordering: Checkout repository before setup-dotnet (required for global.json access)

Changes

global.json:

  • Updated SDK version to 9.0.310

build.yml:

  • Reordered steps: actions/checkout now precedes actions/setup-dotnet
  • Changed setup-dotnet input from dotnet-version: 9.0.x to global-json-file: global.json
  • Retained DOTNET_VERSION env var for artifact-only jobs (sign, nuget) that cannot access global.json

Benefits

  • ✅ Single source of truth for SDK version
  • ✅ Prevents future version drift
  • ✅ Simplifies version updates (edit global.json only)
  • ✅ Follows setup-dotnet recommended pattern

Related

@Arlodotexe Arlodotexe force-pushed the dependency/dotnet/global-json-9.0.310 branch 2 times, most recently from 022bdad to 8041623 Compare February 2, 2026 23:25
- Update SDK version from 9.0.308 to 9.0.310 in global.json
- Reorder workflow steps: checkout before setup-dotnet
- Use global-json-file input for jobs with checkout
- Maintain DOTNET_VERSION env var for artifact-only jobs (no checkout)

This eliminates version duplication and prevents future drift between
global.json and workflow definitions. Related to PR #826 which disabled
rollForward to prevent SDK version mismatches.
@Arlodotexe Arlodotexe force-pushed the dependency/dotnet/global-json-9.0.310 branch from 8041623 to fea64cf Compare February 2, 2026 23:26

steps:
- name: Install .NET SDK v${{ env.DOTNET_VERSION }}
- name: Install .NET SDK
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're only pushing to NuGet in this step, eh? Is there another nuget tool installer or something we could use instead of the dotnet tool so we don't have to track a version here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Our options are:

  1. What we did here
  2. Hardcoding inline
  3. Cloning the repo so we have access to global.json

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Noting also duplicate with CommunityToolkit/Labs-Windows#779

@Arlodotexe Arlodotexe merged commit e05d627 into main Feb 3, 2026
23 checks passed
@Arlodotexe Arlodotexe deleted the dependency/dotnet/global-json-9.0.310 branch February 3, 2026 01:12
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.

3 participants