Skip to content

Commit

Permalink
Add support for ubuntu-22.04-arm64 and ubuntu-24.04-arm64
Browse files Browse the repository at this point in the history
  • Loading branch information
eregon committed Jan 18, 2025
1 parent 87b4893 commit 9f4a9b3
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 3 deletions.
11 changes: 10 additions & 1 deletion .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-20.04, ubuntu-22.04, ubuntu-24.04, macos-13, macos-14, macos-15, windows-2019, windows-2022, windows-2025 ]
os: [ ubuntu-20.04, 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 ]
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 @@ -54,6 +54,15 @@ jobs:
- { os: macos-15, ruby: '2.3' }
- { os: macos-15, ruby: '2.4' }
- { os: macos-15, ruby: '2.5' }
# These old Rubies fail to compile or segfault on Linux arm64
- { os: ubuntu-22.04-arm, ruby: '1.9' }
- { os: ubuntu-22.04-arm, ruby: '2.0' }
- { os: ubuntu-22.04-arm, ruby: '2.1' }
- { os: ubuntu-22.04-arm, ruby: '2.2' }
- { os: ubuntu-24.04-arm, ruby: '1.9' }
- { os: ubuntu-24.04-arm, ruby: '2.0' }
- { os: ubuntu-24.04-arm, ruby: '2.1' }
- { os: ubuntu-24.04-arm, ruby: '2.2' }
# Windows (note: previews are not available on Windows)
- { os: windows-2019, ruby: '1.9' }
- { os: windows-2022, ruby: '1.9' }
Expand Down
2 changes: 2 additions & 0 deletions common.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,9 @@ export async function hashFile(file) {
const GitHubHostedPlatforms = [
'ubuntu-20.04-x64',
'ubuntu-22.04-x64',
'ubuntu-22.04-arm64',
'ubuntu-24.04-x64',
'ubuntu-24.04-arm64',
'windows-2019-x64',
'windows-2022-x64',
'windows-2025-x64',
Expand Down
14 changes: 13 additions & 1 deletion dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 11 additions & 1 deletion ruby-builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ async function downloadAndExtract(platform, engine, version, rubyPrefix) {
}

function getDownloadURL(platform, engine, version) {
let builderPlatform = platform
let builderPlatform = null
if (platform.startsWith('windows-') && os.arch() === 'x64') {
builderPlatform = 'windows-latest'
} else if (platform.startsWith('macos-')) {
Expand All @@ -100,6 +100,16 @@ function getDownloadURL(platform, engine, version) {
} else if (os.arch() === 'arm64') {
builderPlatform = 'macos-13-arm64'
}
} else if (platform.startsWith('ubuntu-')) {
if (os.arch() === 'x64') {
builderPlatform = platform
} else if (os.arch() === 'arm64') {
builderPlatform = `${platform}-arm64`
}
}

if (builderPlatform === null) {
throw new Error(`Unknown download URL for platform ${platform}`)
}

if (common.isHeadVersion(version)) {
Expand Down

0 comments on commit 9f4a9b3

Please sign in to comment.