8000 Add support for macos-13-arm64 GitHub runners · ruby/setup-ruby@5cfe23c · GitHub
[go: up one dir, main page]

Skip to content

Commit 5cfe23c

Browse files
committed
Add support for macos-13-arm64 GitHub runners
1 parent f887fb3 commit 5cfe23c

File tree

5 files changed

+34
-9
lines changed

5 files changed

+34
-9
lines changed

.github/workflows/test.yml

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
strategy:
1818
fail-fast: false
1919
matrix:
20-
os: [ ubuntu-20.04, ubuntu-22.04, macos-11, macos-12, macos-13, windows-2019, windows-2022 ]
20+
os: [ ubuntu-20.04, ubuntu-22.04, macos-11, macos-12, macos-13, macos-arm-oss, windows-2019, windows-2022 ]
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', ruby-head,
2323
jruby, jruby-head,
@@ -31,7 +31,22 @@ jobs:
3131
- { os: windows-2022, ruby: mswin }
3232
- { os: windows-2022, ruby: ucrt }
3333
exclude:
34-
- { os: ubuntu-22.04, ruby: '2.2' } # https://github.com/ruby/setup-ruby/issues/496
34+
# https://github.com/ruby/setup-ruby/issues/496
35+
- { os: ubuntu-22.04, ruby: '2.2' }
36+
# Too old, fails to compile on macos-arm-oss
37+
- { os: macos-arm-oss, ruby: '1.9' }
38+
- { os: macos-arm-oss, ruby: '2.0' }
39+
- { os: macos-arm-oss, ruby: '2.1' }
40+
- { os: macos-arm-oss, ruby: '2.2' }
41+
- { os: macos-arm-oss, ruby: '2.3' }
42+
- { os: macos-arm-oss, ruby: '2.4' }
43+
- { os: macos-arm-oss, ruby: '2.5' }
44+
# Fails to compile on macos-arm-oss, https://github.com/ruby/setup-ruby/pull/494#issuecomment-1758099885
45+
- { os: macos-arm-oss, ruby: '3.1' }
46+
# No Java available yet on macos-arm-oss images
47+
- { os: macos-arm-oss, ruby: 'jruby' }
48+
- { os: macos-arm-oss, ruby: 'jruby-head' }
49+
# Windows
3550
- { os: windows-2019, ruby: '1.9' }
3651
- { os: windows-2019, ruby: '3.3' }
3752
- { os: windows-2019, ruby: debug }

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ The action works on these [GitHub-hosted runners](https://docs.github.com/en/act
4343
| Operating System | Supported |
4444
| ---------------- | --------- |
4545
| Ubuntu | `ubuntu-20.04`, `ubuntu-22.04` |
46-
| macOS | `macos-11`, `macos-12`, `macos-13` |
46+
| macOS | `macos-11`, `macos-12`, `macos-13`, `macos-13-xlarge` (arm64) |
4747
| Windows | `windows-2019`, `windows-2022` |
4848

4949
The prebuilt releases are generated by [ruby-builder](https://github.com/ruby/ruby-builder)

common.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,7 @@ const GitHubHostedPlatforms = [
168168
'macos-11-x64',
169169
'macos-12-x64',
170170
'macos-13-x64',
171+
'macos-13-arm64',
171172
'windows-2019-x64',
172173
'windows-2022-x64',
173174
]
@@ -243,7 +244,7 @@ export function getToolCachePath() {
243244
return getRunnerToolCache()
244245
} else {
245246
// Rubies prebuilt by this action embed this path rather than using $RUNNER_TOOL_CACHE
246-
// so use that path is not isSelfHostedRunner()
247+
// so use that path if not isSelfHostedRunner()
247248
return getDefaultToolCachePath()
248249
}
249250
}

dist/index.js

Lines changed: 8 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ruby-builder.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,10 +101,14 @@ async function downloadAndExtract(platform, engine, version, rubyPrefix) {
101101

102102
function getDownloadURL(platform, engine, version) {
103103
let builderPlatform = platform
104-
if (platform.startsWith('windows-')) {
104+
if (platform.startsWith('windows-') && os.arch() === 'x64') {
105105
builderPlatform = 'windows-latest'
106106
} else if (platform.startsWith('macos-')) {
107-
builderPlatform = 'macos-latest'
107+
if (os.arch() === 'x64') {
108+
builderPlatform = 'macos-latest'
109+
} else if (os.arch() === 'arm64') {
110+
builderPlatform = 'macos-13-arm64'
111+
}
108112
}
109113

110114
if (common.isHeadVersion(version)) {

0 commit comments

Comments
 (0)
0