From 91e6e89d940edf08e63de679b5ea386c87104cad Mon Sep 17 00:00:00 2001 From: Benoit Daloze Date: Sat, 18 Jan 2025 13:28:08 +0100 Subject: [PATCH] Add support for ubuntu-22.04-arm64 and ubuntu-24.04-arm64 --- common.js | 2 ++ dist/index.js | 14 +++++++++++++- ruby-builder.js | 12 +++++++++++- 3 files changed, 26 insertions(+), 2 deletions(-) diff --git a/common.js b/common.js index b9ff6138d..d6d5b40f8 100644 --- a/common.js +++ b/common.js @@ -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', diff --git a/dist/index.js b/dist/index.js index 54b4a95df..3b56fc8ce 100644 --- a/dist/index.js +++ b/dist/index.js @@ -484,7 +484,9 @@ 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', @@ -74085,7 +74087,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-')) { @@ -74094,6 +74096,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)) { diff --git a/ruby-builder.js b/ruby-builder.js index dcafe620c..985ad2c86 100644 --- a/ruby-builder.js +++ b/ruby-builder.js @@ -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-')) { @@ -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)) {