Skip to content

Support windows-11-arm #750

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 26, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 22 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ ubuntu-22.04, ubuntu-24.04, ubuntu-22.04-arm, ubuntu-24.04-arm, macos-13, macos-14, macos-15, windows-2019, windows-2022, windows-2025 ]
os: [ ubuntu-22.04, ubuntu-24.04, ubuntu-22.04-arm, ubuntu-24.04-arm, macos-13, macos-14, macos-15, windows-2019, windows-2022, windows-2025, windows-11-arm ]
ruby: [
'1.9', '2.0', '2.1', '2.2', '2.3', '2.4', '2.5', '2.6', '2.7', '3.0', '3.1', '3.2', '3.3', '3.4', ruby-head,
jruby, jruby-head,
Expand Down Expand Up @@ -64,25 +64,43 @@ jobs:
- { os: ubuntu-24.04-arm, ruby: '2.0' }
- { os: ubuntu-24.04-arm, ruby: '2.1' }
- { os: ubuntu-24.04-arm, ruby: '2.2' }
# RubyInstaller windows-arm64 builds only exist for Ruby 3.4+
- { os: windows-11-arm, ruby: '1.9' }
- { os: windows-11-arm, ruby: '2.0' }
- { os: windows-11-arm, ruby: '2.1' }
- { os: windows-11-arm, ruby: '2.2' }
- { os: windows-11-arm, ruby: '2.3' }
- { os: windows-11-arm, ruby: '2.4' }
- { os: windows-11-arm, ruby: '2.5' }
- { os: windows-11-arm, ruby: '2.6' }
- { os: windows-11-arm, ruby: '2.7' }
- { os: windows-11-arm, ruby: '3.0' }
- { os: windows-11-arm, ruby: '3.1' }
- { os: windows-11-arm, ruby: '3.2' }
- { os: windows-11-arm, ruby: '3.3' }
# https://github.com/ruby/jruby-dev-builder/pull/14#issuecomment-2829841247
- { os: windows-11-arm, ruby: jruby }
- { os: windows-11-arm, ruby: jruby-head }
# Windows (note: previews are not available on Windows)
- { os: windows-2019, ruby: '1.9' }
- { os: windows-2022, ruby: '1.9' }
- { os: windows-2025, ruby: '1.9' }
- { os: windows-2019, ruby: debug }
- { os: windows-2022, ruby: debug }
- { os: windows-2025, ruby: debug }
- { os: windows-2019, ruby: truffleruby }
- { os: windows-2022, ruby: truffleruby }
- { os: windows-2025, ruby: truffleruby }
- { os: windows-11-arm, ruby: truffleruby }
- { os: windows-2019, ruby: truffleruby-head }
- { os: windows-2022, ruby: truffleruby-head }
- { os: windows-2025, ruby: truffleruby-head }
- { os: windows-11-arm, ruby: truffleruby-head }
- { os: windows-2019, ruby: truffleruby+graalvm }
- { os: windows-2022, ruby: truffleruby+graalvm }
- { os: windows-2025, ruby: truffleruby+graalvm }
- { os: windows-11-arm, ruby: truffleruby+graalvm }
- { os: windows-2019, ruby: truffleruby+graalvm-head }
- { os: windows-2022, ruby: truffleruby+graalvm-head }
- { os: windows-2025, ruby: truffleruby+graalvm-head }
- { os: windows-11-arm, ruby: truffleruby+graalvm-head }

name: ${{ matrix.os }} ${{ matrix.ruby }}
runs-on: ${{ matrix.os }}
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ The action works on these [GitHub-hosted runners](https://docs.github.com/en/act
| ---------------- | --------- |
| Ubuntu | `ubuntu-22.04`, `ubuntu-24.04`, `ubuntu-22.04-arm`, `ubuntu-24.04-arm` |
| macOS | `macos-13` and newer versions |
| Windows | `windows-2019`, `windows-2022` |
| Windows | `windows-2019`, `windows-2022`, `windows-2025`, `windows-11-arm` |

Not all combinations of runner images and versions are supported.
The list of available Ruby versions can be seen in [ruby-builder-versions.json](ruby-builder-versions.json) for Ubuntu and macOS
Expand Down
7 changes: 5 additions & 2 deletions common.js
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ const GitHubHostedPlatforms = [
'windows-2019-x64',
'windows-2022-x64',
'windows-2025-x64',
'windows-11-arm64'
]

// Precisely: whether we have builds for that platform and there are GitHub-hosted runners to test it
Expand Down Expand Up @@ -270,7 +271,7 @@ export function getOSNameVersionArch() {

function findWindowsVersion() {
const version = os.version()
const match = version.match(/^Windows Server (\d+) Datacenter/)
const match = version.match(/^Windows(?: Server)? (\d+) (?:Datacenter|Enterprise)/)
if (match) {
return match[1]
} else {
Expand Down Expand Up @@ -386,7 +387,9 @@ export function setupPath(newPathEntries) {
const windowsToolchain = core.getInput('windows-toolchain')
if (windows && windowsToolchain !== 'none') {
// main Ruby dll determines whether mingw or ucrt build
msys2Type = rubyIsUCRT(newPathEntries[0]) ? 'ucrt64' : 'mingw64'
msys2Type = os.arch() === 'arm64'
? 'clangarm64'
: rubyIsUCRT(newPathEntries[0]) ? 'ucrt64' : 'mingw64'

// add MSYS2 in path for all Rubies on Windows, as it provides a better bash shell and a native toolchain
const msys2 = [`C:\\msys64\\${msys2Type}\\bin`, 'C:\\msys64\\usr\\bin']
Expand Down
45 changes: 28 additions & 17 deletions dist/index.js

Large diffs are not rendered by default.

39 changes: 27 additions & 12 deletions generate-windows-versions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,25 +9,40 @@

versions = entries.select { |entry|
entry[:filetype] == 'rubyinstaller7z' and
entry[:name].include?('(x64)')
entry[:name].include?('(x64)') || entry[:name].include?('(arm)')
}.group_by { |entry|
entry[:name][/Ruby (\d+\.\d+\.\d+)/, 1]
}.map { |version, builds|
unless builds.sort_by { |build| build[:name] } == builds.reverse
raise "not sorted as expected for #{version}"
end
[version, builds.first]
}.map { |version, builds_by_version|
builds = builds_by_version.group_by { |entry|
entry[:name][/\((x64|arm)\)/, 1]
}.map { |arch, builds_by_arch|
arch = 'arm64' if arch == 'arm'
unless builds_by_arch.sort_by { |build| build[:name] } == builds_by_arch.reverse
raise "not sorted as expected for #{version}"
end
[arch, builds_by_arch.first[:href]]
}.sort_by { |arch, builds|
arch
}.to_h
[version, builds]
}.sort_by { |version, entry|
Gem::Version.new(version)
}.select { |version, entry|
min_requirements.any? { |req| req.satisfied_by?(Gem::Version.new(version)) }
}.map { |version, entry|
[version, entry[:href]]
}.to_h

versions['head'] = 'https://github.com/oneclick/rubyinstaller2/releases/download/rubyinstaller-head/rubyinstaller-head-x64.7z'
versions['mingw'] = 'https://github.com/MSP-Greg/ruby-loco/releases/download/ruby-master/ruby-mingw.7z'
versions['mswin'] = 'https://github.com/MSP-Greg/ruby-loco/releases/download/ruby-master/ruby-mswin.7z'
versions['ucrt'] = 'https://github.com/MSP-Greg/ruby-loco/releases/download/ruby-master/ruby-ucrt.7z'
versions['head'] = {
'arm64': 'https://github.com/oneclick/rubyinstaller2/releases/download/rubyinstaller-head/rubyinstaller-head-arm.7z',
'x64': 'https://github.com/oneclick/rubyinstaller2/releases/download/rubyinstaller-head/rubyinstaller-head-x64.7z'
}
versions['mingw'] = {
'x64': 'https://github.com/MSP-Greg/ruby-loco/releases/download/ruby-master/ruby-mingw.7z'
}
versions['mswin'] = {
'x64': 'https://github.com/MSP-Greg/ruby-loco/releases/download/ruby-master/ruby-mswin.7z'
}
versions['ucrt'] = {
'x64': 'https://github.com/MSP-Greg/ruby-loco/releases/download/ruby-master/ruby-ucrt.7z'
}

File.binwrite 'windows-versions.json', "#{JSON.pretty_generate(versions)}\n"
8 changes: 6 additions & 2 deletions ruby-builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,12 @@ async function downloadAndExtract(platform, engine, version, rubyPrefix) {

function getDownloadURL(platform, engine, version) {
let builderPlatform = null
if (platform.startsWith('windows-') && os.arch() === 'x64') {
builderPlatform = 'windows-latest'
if (platform.startsWith('windows-')) {
if (os.arch() === 'x64') {
builderPlatform = 'windows-latest'
} else if (os.arch() === 'arm64') {
builderPlatform = 'windows-arm64'
}
} else if (platform.startsWith('macos-')) {
if (os.arch() === 'x64') {
builderPlatform = 'macos-latest'
Expand Down
Loading
Loading