Compare commits

...
5 Commits
6 changed files with 44 additions and 22 deletions
+6 -4
View File
@@ -29,9 +29,8 @@ Only versions published by [RubyInstaller](https://rubyinstaller.org/downloads/a
Due to that, Ruby 2.2 resolves to 2.2.6 on Windows and 2.2.10 on other platforms. Due to that, Ruby 2.2 resolves to 2.2.6 on Windows and 2.2.10 on other platforms.
And Ruby 2.3 on Windows only has builds for 2.3.0, 2.3.1 and 2.3.3. And Ruby 2.3 on Windows only has builds for 2.3.0, 2.3.1 and 2.3.3.
Note that Ruby ≤ 2.3 and the OpenSSL version it needs (1.0.2) are both end-of-life, Note that Ruby ≤ 2.4 and the OpenSSL version it needs (1.0.2) are both end-of-life,
which means Ruby ≤ 2.3 is unmaintained and considered insecure. which means Ruby ≤ 2.4 is unmaintained and considered insecure.
On Windows, Ruby 2.4 uses OpenSSL 1.0.2, which is no longer maintained.
### Supported Platforms ### Supported Platforms
@@ -204,7 +203,10 @@ if the [virtual environment](https://github.com/actions/virtual-environments) is
* Make sure to use the same operating system and version. * Make sure to use the same operating system and version.
* Make sure to use the same version of libssl. * Make sure to use the same version of libssl.
* Make sure that the operating system has `libyaml-0` installed * Make sure that the operating system has `libyaml-0` installed
* The runner software is running as user `runner` with a home directory of `/home/runner`, or you have created a symlink for the home directory of whatever user that the runner is running as to `/home/runner`. * The default tool cache directory (`/opt/hostedtoolcache` on Linux, `/Users/runner/hostedtoolcache` on macOS,
`C:/hostedtoolcache/windows` on Windows) must be writable by the `runner` user.
This is necessary since the Ruby builds embed the install path when built and cannot be moved around.
* `/home/runner` must be writable by the `runner` user.
In other cases, please use a system Ruby or [install Ruby manually](https://github.com/postmodern/chruby/wiki#installing-rubies) instead. In other cases, please use a system Ruby or [install Ruby manually](https://github.com/postmodern/chruby/wiki#installing-rubies) instead.
+14 -4
View File
@@ -63,11 +63,21 @@ export function shouldExtractInToolCache(engine, version) {
return engine === 'ruby' && !isHeadVersion(version) return engine === 'ruby' && !isHeadVersion(version)
} }
export function getToolCacheRubyPrefix(version) { function getPlatformToolCache(platform) {
const toolCache = process.env['RUNNER_TOOL_CACHE'] // Hardcode paths rather than using $RUNNER_TOOL_CACHE because the prebuilt Rubies cannot be moved anyway
if (!toolCache) { if (platform.startsWith('ubuntu-')) {
throw new Error('$RUNNER_TOOL_CACHE must be set') return '/opt/hostedtoolcache'
} else if (platform.startsWith('macos-')) {
return '/Users/runner/hostedtoolcache'
} else if (platform.startsWith('windows-')) {
return 'C:/hostedtoolcache/windows'
} else {
throw new Error('Unknown platform')
} }
}
export function getToolCacheRubyPrefix(platform, version) {
const toolCache = getPlatformToolCache(platform)
return path.join(toolCache, 'Ruby', version, 'x64') return path.join(toolCache, 'Ruby', version, 'x64')
} }
Generated Vendored
+19 -9
View File
@@ -27714,7 +27714,7 @@ async function install(platform, engine, version) {
let rubyPrefix let rubyPrefix
if (common.shouldExtractInToolCache(engine, version)) { if (common.shouldExtractInToolCache(engine, version)) {
rubyPrefix = common.getToolCacheRubyPrefix(version) rubyPrefix = common.getToolCacheRubyPrefix(platform, version)
} else { } else {
rubyPrefix = `${drive}:\\${base}` rubyPrefix = `${drive}:\\${base}`
} }
@@ -32167,11 +32167,21 @@ function shouldExtractInToolCache(engine, version) {
return engine === 'ruby' && !isHeadVersion(version) return engine === 'ruby' && !isHeadVersion(version)
} }
function getToolCacheRubyPrefix(version) { function getPlatformToolCache(platform) {
const toolCache = process.env['RUNNER_TOOL_CACHE'] // Hardcode paths rather than using $RUNNER_TOOL_CACHE because the prebuilt Rubies cannot be moved anyway
if (!toolCache) { if (platform.startsWith('ubuntu-')) {
throw new Error('$RUNNER_TOOL_CACHE must be set') return '/opt/hostedtoolcache'
} else if (platform.startsWith('macos-')) {
return '/Users/runner/hostedtoolcache'
} else if (platform.startsWith('windows-')) {
return 'C:/hostedtoolcache/windows'
} else {
throw new Error('Unknown platform')
} }
}
function getToolCacheRubyPrefix(platform, version) {
const toolCache = getPlatformToolCache(platform)
return path.join(toolCache, 'Ruby', version, 'x64') return path.join(toolCache, 'Ruby', version, 'x64')
} }
@@ -51181,7 +51191,7 @@ async function setupRuby(options = {}) {
const [engine, parsedVersion] = parseRubyEngineAndVersion(inputs['ruby-version']) const [engine, parsedVersion] = parseRubyEngineAndVersion(inputs['ruby-version'])
let installer let installer
if (platform === 'windows-latest' && engine === 'ruby') { if (platform.startsWith('windows-') && engine === 'ruby') {
installer = __webpack_require__(216) installer = __webpack_require__(216)
} else { } else {
installer = __webpack_require__(974) installer = __webpack_require__(974)
@@ -51365,9 +51375,9 @@ async function installBundler(bundlerVersionInput, lockFile, platform, rubyPrefi
bundlerVersion = '1' bundlerVersion = '1'
} }
if (engine === 'ruby' && common.isHeadVersion(rubyVersion) && bundlerVersion === '2') { if ((engine === 'ruby' || engine === 'truffleruby') && common.isHeadVersion(rubyVersion) && bundlerVersion === '2') {
console.log(`Using Bundler 2 shipped with ${engine}-${rubyVersion}`) console.log(`Using Bundler 2 shipped with ${engine}-${rubyVersion}`)
} else if (engine === 'truffleruby' && bundlerVersion === '1') { } else if (engine === 'truffleruby' && !common.isHeadVersion(rubyVersion) && bundlerVersion === '1') {
console.log(`Using Bundler 1 shipped with ${engine}`) console.log(`Using Bundler 1 shipped with ${engine}`)
} else { } else {
const gem = path.join(rubyPrefix, 'bin', 'gem') const gem = path.join(rubyPrefix, 'bin', 'gem')
@@ -52901,7 +52911,7 @@ async function install(platform, engine, version) {
async function downloadAndExtract(platform, engine, version) { async function downloadAndExtract(platform, engine, version) {
let rubyPrefix let rubyPrefix
if (common.shouldExtractInToolCache(engine, version)) { if (common.shouldExtractInToolCache(engine, version)) {
rubyPrefix = common.getToolCacheRubyPrefix(version) rubyPrefix = common.getToolCacheRubyPrefix(platform, version)
} else if (windows) { } else if (windows) {
rubyPrefix = path.join(`${common.drive}:`, `${engine}-${version}`) rubyPrefix = path.join(`${common.drive}:`, `${engine}-${version}`)
} else { } else {
+3 -3
View File
@@ -39,7 +39,7 @@ export async function setupRuby(options = {}) {
const [engine, parsedVersion] = parseRubyEngineAndVersion(inputs['ruby-version']) const [engine, parsedVersion] = parseRubyEngineAndVersion(inputs['ruby-version'])
let installer let installer
if (platform === 'windows-latest' && engine === 'ruby') { if (platform.startsWith('windows-') && engine === 'ruby') {
installer = require('./windows') installer = require('./windows')
} else { } else {
installer = require('./ruby-builder') installer = require('./ruby-builder')
@@ -223,9 +223,9 @@ async function installBundler(bundlerVersionInput, lockFile, platform, rubyPrefi
bundlerVersion = '1' bundlerVersion = '1'
} }
if (engine === 'ruby' && common.isHeadVersion(rubyVersion) && bundlerVersion === '2') { if ((engine === 'ruby' || engine === 'truffleruby') && common.isHeadVersion(rubyVersion) && bundlerVersion === '2') {
console.log(`Using Bundler 2 shipped with ${engine}-${rubyVersion}`) console.log(`Using Bundler 2 shipped with ${engine}-${rubyVersion}`)
} else if (engine === 'truffleruby' && bundlerVersion === '1') { } else if (engine === 'truffleruby' && !common.isHeadVersion(rubyVersion) && bundlerVersion === '1') {
console.log(`Using Bundler 1 shipped with ${engine}`) console.log(`Using Bundler 1 shipped with ${engine}`)
} else { } else {
const gem = path.join(rubyPrefix, 'bin', 'gem') const gem = path.join(rubyPrefix, 'bin', 'gem')
+1 -1
View File
@@ -23,7 +23,7 @@ export async function install(platform, engine, version) {
async function downloadAndExtract(platform, engine, version) { async function downloadAndExtract(platform, engine, version) {
let rubyPrefix let rubyPrefix
if (common.shouldExtractInToolCache(engine, version)) { if (common.shouldExtractInToolCache(engine, version)) {
rubyPrefix = common.getToolCacheRubyPrefix(version) rubyPrefix = common.getToolCacheRubyPrefix(platform, version)
} else if (windows) { } else if (windows) {
rubyPrefix = path.join(`${common.drive}:`, `${engine}-${version}`) rubyPrefix = path.join(`${common.drive}:`, `${engine}-${version}`)
} else { } else {
+1 -1
View File
@@ -38,7 +38,7 @@ export async function install(platform, engine, version) {
let rubyPrefix let rubyPrefix
if (common.shouldExtractInToolCache(engine, version)) { if (common.shouldExtractInToolCache(engine, version)) {
rubyPrefix = common.getToolCacheRubyPrefix(version) rubyPrefix = common.getToolCacheRubyPrefix(platform, version)
} else { } else {
rubyPrefix = `${drive}:\\${base}` rubyPrefix = `${drive}:\\${base}`
} }