Skip to content

Add optional architecture input (x64, x86, arm64, amd64, arm, s390x, ppc64le, riscv64) and dedupe multi-version installs#4

Open
lmvysakh wants to merge 3 commits intomainfrom
implement_architecture_support
Open

Add optional architecture input (x64, x86, arm64, amd64, arm, s390x, ppc64le, riscv64) and dedupe multi-version installs#4
lmvysakh wants to merge 3 commits intomainfrom
implement_architecture_support

Conversation

@lmvysakh
Copy link
Owner

Description
This PR adds support for explicitly selecting the .NET SDK architecture in actions/setup-dotnet@v5 via a new optional architecture input, while preserving the installer’s native auto-detection behavior when the input is not provided.

Key changes

  • New input: architecture added to action.yml (optional, supported values: x64, x86, arm64, amd64, arm, s390x, ppc64le, riscv64).
  • Preserve auto-detect: When architecture is empty/unset, the action does not pass any --architecture / -Architecture flag to the install scripts, ensuring the install scripts continue to auto-detect the current runner architecture.
  • Applies to all versions: When set, the specified architecture is applied consistently to each version from dotnet-version (including multiline input).
  • Avoid duplicate installs: dotnet-version values are normalized (trimmed, empty lines removed) and treated as a set, preventing duplicate installations caused by repeated entries and/or whitespace differences.

Tests updated/added

  • Validates that unsupported architecture values fails.
  • Ensures duplicates in dotnet-version do not trigger extra installs.
  • Verifies architecture flag is omitted when not set and included when set (x64/arm64).

Docs: README updated with usage examples and notes about auto-detection when architecture is not specified

- uses: actions/setup-dotnet@v5
  with:
    dotnet-version: |
      8.0.x
      9.0.x
    architecture: x64

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