Compare commits

..
3 Commits
7 changed files with 65 additions and 32 deletions
+17 -2
View File
@@ -17,7 +17,7 @@ jobs:
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
os: [ ubuntu-20.04, ubuntu-22.04, macos-11, macos-12, macos-13, windows-2019, windows-2022 ] os: [ ubuntu-20.04, ubuntu-22.04, macos-11, macos-12, macos-13, macos-arm-oss, windows-2019, windows-2022 ]
ruby: [ 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', ruby-head, '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,
jruby, jruby-head, jruby, jruby-head,
@@ -31,7 +31,22 @@ jobs:
- { os: windows-2022, ruby: mswin } - { os: windows-2022, ruby: mswin }
- { os: windows-2022, ruby: ucrt } - { os: windows-2022, ruby: ucrt }
exclude: exclude:
- { os: ubuntu-22.04, ruby: '2.2' } # https://github.com/ruby/setup-ruby/issues/496 # https://github.com/ruby/setup-ruby/issues/496
- { os: ubuntu-22.04, ruby: '2.2' }
# Too old, fails to compile on macos-arm-oss
- { os: macos-arm-oss, ruby: '1.9' }
- { os: macos-arm-oss, ruby: '2.0' }
- { os: macos-arm-oss, ruby: '2.1' }
- { os: macos-arm-oss, ruby: '2.2' }
- { os: macos-arm-oss, ruby: '2.3' }
- { os: macos-arm-oss, ruby: '2.4' }
- { os: macos-arm-oss, ruby: '2.5' }
# Fails to compile on macos-arm-oss, https://github.com/ruby/setup-ruby/pull/494#issuecomment-1758099885
- { os: macos-arm-oss, ruby: '3.1' }
# No Java available yet on macos-arm-oss images
- { os: macos-arm-oss, ruby: 'jruby' }
- { os: macos-arm-oss, ruby: 'jruby-head' }
# Windows
- { os: windows-2019, ruby: '1.9' } - { os: windows-2019, ruby: '1.9' }
- { os: windows-2019, ruby: '3.3' } - { os: windows-2019, ruby: '3.3' }
- { os: windows-2019, ruby: debug } - { os: windows-2019, ruby: debug }
+1 -1
View File
@@ -43,7 +43,7 @@ The action works on these [GitHub-hosted runners](https://docs.github.com/en/act
| Operating System | Supported | | Operating System | Supported |
| ---------------- | --------- | | ---------------- | --------- |
| Ubuntu | `ubuntu-20.04`, `ubuntu-22.04` | | Ubuntu | `ubuntu-20.04`, `ubuntu-22.04` |
| macOS | `macos-11`, `macos-12`, `macos-13` | | macOS | `macos-11`, `macos-12`, `macos-13`, `macos-13-xlarge` (arm64) |
| Windows | `windows-2019`, `windows-2022` | | Windows | `windows-2019`, `windows-2022` |
The prebuilt releases are generated by [ruby-builder](https://github.com/ruby/ruby-builder) The prebuilt releases are generated by [ruby-builder](https://github.com/ruby/ruby-builder)
+10 -9
View File
@@ -168,6 +168,7 @@ const GitHubHostedPlatforms = [
'macos-11-x64', 'macos-11-x64',
'macos-12-x64', 'macos-12-x64',
'macos-13-x64', 'macos-13-x64',
'macos-13-arm64',
'windows-2019-x64', 'windows-2019-x64',
'windows-2022-x64', 'windows-2022-x64',
] ]
@@ -192,11 +193,11 @@ export function selfHostedRunnerReason() {
} }
} }
let virtualEnvironmentName = undefined let osNameVersion = undefined
export function getVirtualEnvironmentName() { export function getOSNameVersion() {
if (virtualEnvironmentName !== undefined) { if (osNameVersion !== undefined) {
return virtualEnvironmentName return osNameVersion
} }
const platform = os.platform() const platform = os.platform()
@@ -216,12 +217,12 @@ export function getVirtualEnvironmentName() {
throw new Error(`Unknown platform ${platform}`) throw new Error(`Unknown platform ${platform}`)
} }
virtualEnvironmentName = `${osName}-${osVersion}` osNameVersion = `${osName}-${osVersion}`
return virtualEnvironmentName return osNameVersion
} }
export function getOSNameVersionArch() { export function getOSNameVersionArch() {
return `${getVirtualEnvironmentName()}-${os.arch()}` return `${getOSNameVersion()}-${os.arch()}`
} }
function findWindowsVersion() { function findWindowsVersion() {
@@ -243,7 +244,7 @@ export function getToolCachePath() {
return getRunnerToolCache() return getRunnerToolCache()
} else { } else {
// Rubies prebuilt by this action embed this path rather than using $RUNNER_TOOL_CACHE // Rubies prebuilt by this action embed this path rather than using $RUNNER_TOOL_CACHE
// so use that path is not isSelfHostedRunner() // so use that path if not isSelfHostedRunner()
return getDefaultToolCachePath() return getDefaultToolCachePath()
} }
} }
@@ -258,7 +259,7 @@ export function getRunnerToolCache() {
// Rubies prebuilt by this action embed this path rather than using $RUNNER_TOOL_CACHE // Rubies prebuilt by this action embed this path rather than using $RUNNER_TOOL_CACHE
function getDefaultToolCachePath() { function getDefaultToolCachePath() {
const platform = getVirtualEnvironmentName() const platform = getOSNameVersion()
if (platform.startsWith('ubuntu-')) { if (platform.startsWith('ubuntu-')) {
return '/opt/hostedtoolcache' return '/opt/hostedtoolcache'
} else if (platform.startsWith('macos-')) { } else if (platform.startsWith('macos-')) {
Generated Vendored
+21 -13
View File
@@ -292,11 +292,11 @@ __nccwpck_require__.d(__webpack_exports__, {
"createToolCacheCompleteFile": () => (/* binding */ createToolCacheCompleteFile), "createToolCacheCompleteFile": () => (/* binding */ createToolCacheCompleteFile),
"drive": () => (/* binding */ drive), "drive": () => (/* binding */ drive),
"floatVersion": () => (/* binding */ floatVersion), "floatVersion": () => (/* binding */ floatVersion),
"getOSNameVersion": () => (/* binding */ getOSNameVersion),
"getOSNameVersionArch": () => (/* binding */ getOSNameVersionArch), "getOSNameVersionArch": () => (/* binding */ getOSNameVersionArch),
"getRunnerToolCache": () => (/* binding */ getRunnerToolCache), "getRunnerToolCache": () => (/* binding */ getRunnerToolCache),
"getToolCachePath": () => (/* binding */ getToolCachePath), "getToolCachePath": () => (/* binding */ getToolCachePath),
"getToolCacheRubyPrefix": () => (/* binding */ getToolCacheRubyPrefix), "getToolCacheRubyPrefix": () => (/* binding */ getToolCacheRubyPrefix),
"getVirtualEnvironmentName": () => (/* binding */ getVirtualEnvironmentName),
"hasBundlerDefaultGem": () => (/* binding */ hasBundlerDefaultGem), "hasBundlerDefaultGem": () => (/* binding */ hasBundlerDefaultGem),
"hashFile": () => (/* binding */ hashFile), "hashFile": () => (/* binding */ hashFile),
"inputs": () => (/* binding */ inputs), "inputs": () => (/* binding */ inputs),
@@ -528,6 +528,7 @@ const GitHubHostedPlatforms = [
'macos-11-x64', 'macos-11-x64',
'macos-12-x64', 'macos-12-x64',
'macos-13-x64', 'macos-13-x64',
'macos-13-arm64',
'windows-2019-x64', 'windows-2019-x64',
'windows-2022-x64', 'windows-2022-x64',
] ]
@@ -552,11 +553,11 @@ function selfHostedRunnerReason() {
} }
} }
let virtualEnvironmentName = undefined let osNameVersion = undefined
function getVirtualEnvironmentName() { function getOSNameVersion() {
if (virtualEnvironmentName !== undefined) { if (osNameVersion !== undefined) {
return virtualEnvironmentName return osNameVersion
} }
const platform = os.platform() const platform = os.platform()
@@ -576,12 +577,12 @@ function getVirtualEnvironmentName() {
throw new Error(`Unknown platform ${platform}`) throw new Error(`Unknown platform ${platform}`)
} }
virtualEnvironmentName = `${osName}-${osVersion}` osNameVersion = `${osName}-${osVersion}`
return virtualEnvironmentName return osNameVersion
} }
function getOSNameVersionArch() { function getOSNameVersionArch() {
return `${getVirtualEnvironmentName()}-${os.arch()}` return `${getOSNameVersion()}-${os.arch()}`
} }
function findWindowsVersion() { function findWindowsVersion() {
@@ -603,7 +604,7 @@ function getToolCachePath() {
return getRunnerToolCache() return getRunnerToolCache()
} else { } else {
// Rubies prebuilt by this action embed this path rather than using $RUNNER_TOOL_CACHE // Rubies prebuilt by this action embed this path rather than using $RUNNER_TOOL_CACHE
// so use that path is not isSelfHostedRunner() // so use that path if not isSelfHostedRunner()
return getDefaultToolCachePath() return getDefaultToolCachePath()
} }
} }
@@ -618,7 +619,7 @@ function getRunnerToolCache() {
// Rubies prebuilt by this action embed this path rather than using $RUNNER_TOOL_CACHE // Rubies prebuilt by this action embed this path rather than using $RUNNER_TOOL_CACHE
function getDefaultToolCachePath() { function getDefaultToolCachePath() {
const platform = getVirtualEnvironmentName() const platform = getOSNameVersion()
if (platform.startsWith('ubuntu-')) { if (platform.startsWith('ubuntu-')) {
return '/opt/hostedtoolcache' return '/opt/hostedtoolcache'
} else if (platform.startsWith('macos-')) { } else if (platform.startsWith('macos-')) {
@@ -65053,10 +65054,14 @@ async function downloadAndExtract(platform, engine, version, rubyPrefix) {
function getDownloadURL(platform, engine, version) { function getDownloadURL(platform, engine, version) {
let builderPlatform = platform let builderPlatform = platform
if (platform.startsWith('windows-')) { if (platform.startsWith('windows-') && os.arch() === 'x64') {
builderPlatform = 'windows-latest' builderPlatform = 'windows-latest'
} else if (platform.startsWith('macos-')) { } else if (platform.startsWith('macos-')) {
builderPlatform = 'macos-latest' if (os.arch() === 'x64') {
builderPlatform = 'macos-latest'
} else if (os.arch() === 'arm64') {
builderPlatform = 'macos-13-arm64'
}
} }
if (common.isHeadVersion(version)) { if (common.isHeadVersion(version)) {
@@ -65690,6 +65695,9 @@ __nccwpck_require__.r(__webpack_exports__);
/* harmony export */ "run": () => (/* binding */ run), /* harmony export */ "run": () => (/* binding */ run),
/* harmony export */ "setupRuby": () => (/* binding */ setupRuby) /* harmony export */ "setupRuby": () => (/* binding */ setupRuby)
/* harmony export */ }); /* harmony export */ });
/* harmony import */ var _common__WEBPACK_IMPORTED_MODULE_0__ = __nccwpck_require__(3143);
const os = __nccwpck_require__(2037) const os = __nccwpck_require__(2037)
const fs = __nccwpck_require__(7147) const fs = __nccwpck_require__(7147)
const path = __nccwpck_require__(1017) const path = __nccwpck_require__(1017)
@@ -65736,7 +65744,7 @@ async function setupRuby(options = {}) {
process.chdir(inputs['working-directory']) process.chdir(inputs['working-directory'])
const platform = common.getVirtualEnvironmentName() const platform = common.getOSNameVersion()
const [engine, parsedVersion] = parseRubyEngineAndVersion(inputs['ruby-version']) const [engine, parsedVersion] = parseRubyEngineAndVersion(inputs['ruby-version'])
let installer let installer
+3 -1
View File
@@ -1,3 +1,5 @@
import {getOSNameVersion} from "./common";
const os = require('os') const os = require('os')
const fs = require('fs') const fs = require('fs')
const path = require('path') const path = require('path')
@@ -44,7 +46,7 @@ export async function setupRuby(options = {}) {
process.chdir(inputs['working-directory']) process.chdir(inputs['working-directory'])
const platform = common.getVirtualEnvironmentName() const platform = common.getOSNameVersion()
const [engine, parsedVersion] = parseRubyEngineAndVersion(inputs['ruby-version']) const [engine, parsedVersion] = parseRubyEngineAndVersion(inputs['ruby-version'])
let installer let installer
+6 -2
View File
@@ -101,10 +101,14 @@ async function downloadAndExtract(platform, engine, version, rubyPrefix) {
function getDownloadURL(platform, engine, version) { function getDownloadURL(platform, engine, version) {
let builderPlatform = platform let builderPlatform = platform
if (platform.startsWith('windows-')) { if (platform.startsWith('windows-') && os.arch() === 'x64') {
builderPlatform = 'windows-latest' builderPlatform = 'windows-latest'
} else if (platform.startsWith('macos-')) { } else if (platform.startsWith('macos-')) {
builderPlatform = 'macos-latest' if (os.arch() === 'x64') {
builderPlatform = 'macos-latest'
} else if (os.arch() === 'arm64') {
builderPlatform = 'macos-13-arm64'
}
} }
if (common.isHeadVersion(version)) { if (common.isHeadVersion(version)) {
+7 -4
View File
@@ -4,15 +4,18 @@ versions = JSON.load(hash).transform_keys(&:to_sym)
by_minor = versions[:ruby].group_by { |v| v[/^\d\.\d/] } by_minor = versions[:ruby].group_by { |v| v[/^\d\.\d/] }
(1..7).each do |minor| by_minor.each_pair do |minor, versions|
p by_minor["2.#{minor}"].map { |v| "ruby-#{v}" } puts versions.map { |v| "ruby-#{v}" }.join(', ') if minor
end end
puts puts
p (versions[:truffleruby] - %w[head]).map { |v| "truffleruby-#{v}" } puts (versions[:truffleruby] - %w[head]).map { |v| "truffleruby-#{v}" }.join(', ')
puts puts
p (versions[:jruby] - %w[head]).map { |v| "jruby-#{v}" } puts (versions[:"truffleruby+graalvm"] - %w[head]).map { |v| "truffleruby+graalvm-#{v}" }.join(', ')
puts
puts (versions[:jruby] - %w[head]).map { |v| "jruby-#{v}" }.join(', ')
(versions[:jruby] - %w[head]).each do |v| (versions[:jruby] - %w[head]).each do |v|
puts "- { os: windows-latest, jruby-version: #{v}, ruby: jruby-#{v} }" puts "- { os: windows-latest, jruby-version: #{v}, ruby: jruby-#{v} }"