Skip to content

Commit 665568a

Browse files
committed
Support windows-11-arm
1 parent bcde69c commit 665568a

File tree

8 files changed

+341
-124
lines changed

8 files changed

+341
-124
lines changed

.github/workflows/test.yml

+18-4
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
strategy:
1818
fail-fast: false
1919
matrix:
20-
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 ]
20+
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 ]
2121
ruby: [
2222
'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,
2323
jruby, jruby-head,
@@ -68,21 +68,35 @@ jobs:
6868
- { os: windows-2019, ruby: '1.9' }
6969
- { os: windows-2022, ruby: '1.9' }
7070
- { os: windows-2025, ruby: '1.9' }
71-
- { os: windows-2019, ruby: debug }
72-
- { os: windows-2022, ruby: debug }
73-
- { os: windows-2025, ruby: debug }
71+
- { os: windows-11-arm, ruby: '1.9' }
72+
- { os: windows-11-arm, ruby: '2.0' }
73+
- { os: windows-11-arm, ruby: '2.1' }
74+
- { os: windows-11-arm, ruby: '2.2' }
75+
- { os: windows-11-arm, ruby: '2.3' }
76+
- { os: windows-11-arm, ruby: '2.4' }
77+
- { os: windows-11-arm, ruby: '2.5' }
78+
- { os: windows-11-arm, ruby: '2.6' }
79+
- { os: windows-11-arm, ruby: '2.7' }
80+
- { os: windows-11-arm, ruby: '3.0' }
81+
- { os: windows-11-arm, ruby: '3.1' }
82+
- { os: windows-11-arm, ruby: '3.2' }
83+
- { os: windows-11-arm, ruby: '3.3' }
7484
- { os: windows-2019, ruby: truffleruby }
7585
- { os: windows-2022, ruby: truffleruby }
7686
- { os: windows-2025, ruby: truffleruby }
87+
- { os: windows-11-arm, ruby: truffleruby }
7788
- { os: windows-2019, ruby: truffleruby-head }
7889
- { os: windows-2022, ruby: truffleruby-head }
7990
- { os: windows-2025, ruby: truffleruby-head }
91+
- { os: windows-11-arm, ruby: truffleruby-head }
8092
- { os: windows-2019, ruby: truffleruby+graalvm }
8193
- { os: windows-2022, ruby: truffleruby+graalvm }
8294
- { os: windows-2025, ruby: truffleruby+graalvm }
95+
- { os: windows-11-arm, ruby: truffleruby+graalvm }
8396
- { os: windows-2019, ruby: truffleruby+graalvm-head }
8497
- { os: windows-2022, ruby: truffleruby+graalvm-head }
8598
- { os: windows-2025, ruby: truffleruby+graalvm-head }
99+
- { os: windows-11-arm, ruby: truffleruby+graalvm-head }
86100

87101
name: ${{ matrix.os }} ${{ matrix.ruby }}
88102
runs-on: ${{ matrix.os }}

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ The action works on these [GitHub-hosted runners](https://docs.github.com/en/act
5151
| ---------------- | --------- |
5252
| Ubuntu | `ubuntu-20.04`, `ubuntu-22.04`, `ubuntu-24.04`, `ubuntu-22.04-arm`, `ubuntu-24.04-arm` |
5353
| macOS | `macos-13` and newer versions |
54-
| Windows | `windows-2019`, `windows-2022` |
54+
| Windows | `windows-2019`, `windows-2022`, `windows-2025`, `windows-11-arm` |
5555

5656
Not all combinations of runner images and versions are supported.
5757
The list of available Ruby versions can be seen in [ruby-builder-versions.json](ruby-builder-versions.json) for Ubuntu and macOS

common.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,7 @@ const GitHubHostedPlatforms = [
179179
'windows-2019-x64',
180180
'windows-2022-x64',
181181
'windows-2025-x64',
182+
'windows-11-arm64'
182183
]
183184

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

272273
function findWindowsVersion() {
273274
const version = os.version()
274-
const match = version.match(/^Windows Server (\d+) Datacenter/)
275+
const match = version.match(/^Windows(?: Server)? (\d+) (?:Datacenter|Enterprise)/)
275276
if (match) {
276277
return match[1]
277278
} else {

dist/index.js

+20-12
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

generate-windows-versions.rb

+27-12
Original file line numberDiff line numberDiff line change
@@ -9,25 +9,40 @@
99

1010
versions = entries.select { |entry|
1111
entry[:filetype] == 'rubyinstaller7z' and
12-
entry[:name].include?('(x64)')
12+
entry[:name].include?('(x64)') || entry[:name].include?('(arm)')
1313
}.group_by { |entry|
1414
entry[:name][/Ruby (\d+\.\d+\.\d+)/, 1]
15-
}.map { |version, builds|
16-
unless builds.sort_by { |build| build[:name] } == builds.reverse
17-
raise "not sorted as expected for #{version}"
18-
end
19-
[version, builds.first]
15+
}.map { |version, builds_by_version|
16+
builds = builds_by_version.group_by { |entry|
17+
entry[:name][/\((x64|arm)\)/, 1]
18+
}.map { |arch, builds_by_arch|
19+
arch = 'arm64' if arch == 'arm'
20+
unless builds_by_arch.sort_by { |build| build[:name] } == builds_by_arch.reverse
21+
raise "not sorted as expected for #{version}"
22+
end
23+
[arch, builds_by_arch.first[:href]]
24+
}.sort_by { |arch, builds|
25+
arch
26+
}.to_h
27+
[version, builds]
2028
}.sort_by { |version, entry|
2129
Gem::Version.new(version)
2230
}.select { |version, entry|
2331
min_requirements.any? { |req| req.satisfied_by?(Gem::Version.new(version)) }
24-
}.map { |version, entry|
25-
[version, entry[:href]]
2632
}.to_h
2733

28-
versions['head'] = 'https://github.com/oneclick/rubyinstaller2/releases/download/rubyinstaller-head/rubyinstaller-head-x64.7z'
29-
versions['mingw'] = 'https://github.com/MSP-Greg/ruby-loco/releases/download/ruby-master/ruby-mingw.7z'
30-
versions['mswin'] = 'https://github.com/MSP-Greg/ruby-loco/releases/download/ruby-master/ruby-mswin.7z'
31-
versions['ucrt'] = 'https://github.com/MSP-Greg/ruby-loco/releases/download/ruby-master/ruby-ucrt.7z'
34+
versions['head'] = {
35+
'arm64': 'https://github.com/oneclick/rubyinstaller2/releases/download/rubyinstaller-head/rubyinstaller-head-arm.7z',
36+
'x64': 'https://github.com/oneclick/rubyinstaller2/releases/download/rubyinstaller-head/rubyinstaller-head-x64.7z'
37+
}
38+
versions['mingw'] = {
39+
'x64': 'https://github.com/MSP-Greg/ruby-loco/releases/download/ruby-master/ruby-mingw.7z'
40+
}
41+
versions['mswin'] = {
42+
'x64': 'https://github.com/MSP-Greg/ruby-loco/releases/download/ruby-master/ruby-mswin.7z'
43+
}
44+
versions['ucrt'] = {
45+
'x64': 'https://github.com/MSP-Greg/ruby-loco/releases/download/ruby-master/ruby-ucrt.7z'
46+
}
3247

3348
File.binwrite 'windows-versions.json', "#{JSON.pretty_generate(versions)}\n"

ruby-builder.js

+6-2
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,12 @@ async function downloadAndExtract(platform, engine, version, rubyPrefix) {
9797

9898
function getDownloadURL(platform, engine, version) {
9999
let builderPlatform = null
100-
if (platform.startsWith('windows-') && os.arch() === 'x64') {
101-
builderPlatform = 'windows-latest'
100+
if (platform.startsWith('windows-')) {
101+
if (os.arch() === 'x64') {
102+
builderPlatform = 'windows-latest'
103+
} else if (os.arch() === 'arm64') {
104+
builderPlatform = 'windows-11-arm64'
105+
}
102106
} else if (platform.startsWith('macos-')) {
103107
if (os.arch() === 'x64') {
104108
builderPlatform = 'macos-latest'

0 commit comments

Comments
 (0)