mirror of
https://github.com/ruby/setup-ruby.git
synced 2026-09-13 22:44:20 +02:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ee26e27437 | ||
|
|
93287a1fa8 |
+12
-12
@@ -126,7 +126,7 @@ export async function installBundler(bundlerVersionInput, rubygemsInputSet, lock
|
|||||||
const targetRubyVersion = common.targetRubyVersion(engine, rubyVersion)
|
const targetRubyVersion = common.targetRubyVersion(engine, rubyVersion)
|
||||||
// Use Bundler 2.3 when we use Ruby 2.3.2 - 2.5
|
// Use Bundler 2.3 when we use Ruby 2.3.2 - 2.5
|
||||||
// Use Bundler 2.4 when we use Ruby 2.6-2.7
|
// Use Bundler 2.4 when we use Ruby 2.6-2.7
|
||||||
if (bundlerVersion === '2') {
|
if (bundlerVersion == '2') {
|
||||||
if (targetRubyVersion <= 2.5) { // < 2.3.2 already handled above
|
if (targetRubyVersion <= 2.5) { // < 2.3.2 already handled above
|
||||||
console.log('Ruby 2.3.2 - 2.5 only works with Bundler 2.3')
|
console.log('Ruby 2.3.2 - 2.5 only works with Bundler 2.3')
|
||||||
bundlerVersion = '2.3'
|
bundlerVersion = '2.3'
|
||||||
@@ -146,14 +146,6 @@ export async function installBundler(bundlerVersionInput, rubygemsInputSet, lock
|
|||||||
|
|
||||||
await exec.exec(gem, ['install', 'bundler', ...force, '-v', bundlerVersionConstraint])
|
await exec.exec(gem, ['install', 'bundler', ...force, '-v', bundlerVersionConstraint])
|
||||||
|
|
||||||
if (bundlerVersion.startsWith('1') && common.isBundler2Default(engine, rubyVersion)) {
|
|
||||||
// If Bundler 1 is specified on Rubies which ship with Bundler 2,
|
|
||||||
// we need to specify which Bundler version to use explicitly until the lockfile exists.
|
|
||||||
// We actually set it globally for the case of bundler-cache: false with manual bundler install later.
|
|
||||||
console.log(`Setting BUNDLER_VERSION=${bundlerVersion} to ensure Bundler 1 is used`)
|
|
||||||
core.exportVariable('BUNDLER_VERSION', bundlerVersion)
|
|
||||||
}
|
|
||||||
|
|
||||||
return bundlerVersion
|
return bundlerVersion
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -163,19 +155,27 @@ export async function bundleInstall(gemfile, lockFile, platform, engine, rubyVer
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let envOptions = {}
|
||||||
|
if (bundlerVersion.startsWith('1') && common.isBundler2Default(engine, rubyVersion)) {
|
||||||
|
// If Bundler 1 is specified on Rubies which ship with Bundler 2,
|
||||||
|
// we need to specify which Bundler version to use explicitly until the lockfile exists.
|
||||||
|
console.log(`Setting BUNDLER_VERSION=${bundlerVersion} for "bundle config|lock" commands below to ensure Bundler 1 is used`)
|
||||||
|
envOptions = { env: { ...process.env, BUNDLER_VERSION: bundlerVersion } }
|
||||||
|
}
|
||||||
|
|
||||||
// config
|
// config
|
||||||
const cachePath = 'vendor/bundle'
|
const cachePath = 'vendor/bundle'
|
||||||
// An absolute path, so it is reliably under $PWD/vendor/bundle, and not relative to the gemfile's directory
|
// An absolute path, so it is reliably under $PWD/vendor/bundle, and not relative to the gemfile's directory
|
||||||
const bundleCachePath = path.join(process.cwd(), cachePath)
|
const bundleCachePath = path.join(process.cwd(), cachePath)
|
||||||
|
|
||||||
await exec.exec('bundle', ['config', '--local', 'path', bundleCachePath])
|
await exec.exec('bundle', ['config', '--local', 'path', bundleCachePath], envOptions)
|
||||||
|
|
||||||
if (fs.existsSync(lockFile)) {
|
if (fs.existsSync(lockFile)) {
|
||||||
await exec.exec('bundle', ['config', '--local', 'deployment', 'true'])
|
await exec.exec('bundle', ['config', '--local', 'deployment', 'true'], envOptions)
|
||||||
} else {
|
} else {
|
||||||
// Generate the lockfile so we can use it to compute the cache key.
|
// Generate the lockfile so we can use it to compute the cache key.
|
||||||
// This will also automatically pick up the latest gem versions compatible with the Gemfile.
|
// This will also automatically pick up the latest gem versions compatible with the Gemfile.
|
||||||
await exec.exec('bundle', ['lock'])
|
await exec.exec('bundle', ['lock'], envOptions)
|
||||||
}
|
}
|
||||||
|
|
||||||
await afterLockFile(lockFile, platform, engine, rubyVersion)
|
await afterLockFile(lockFile, platform, engine, rubyVersion)
|
||||||
|
|||||||
+16
-15
@@ -140,7 +140,7 @@ async function installBundler(bundlerVersionInput, rubygemsInputSet, lockFile, p
|
|||||||
const targetRubyVersion = common.targetRubyVersion(engine, rubyVersion)
|
const targetRubyVersion = common.targetRubyVersion(engine, rubyVersion)
|
||||||
// Use Bundler 2.3 when we use Ruby 2.3.2 - 2.5
|
// Use Bundler 2.3 when we use Ruby 2.3.2 - 2.5
|
||||||
// Use Bundler 2.4 when we use Ruby 2.6-2.7
|
// Use Bundler 2.4 when we use Ruby 2.6-2.7
|
||||||
if (bundlerVersion === '2') {
|
if (bundlerVersion == '2') {
|
||||||
if (targetRubyVersion <= 2.5) { // < 2.3.2 already handled above
|
if (targetRubyVersion <= 2.5) { // < 2.3.2 already handled above
|
||||||
console.log('Ruby 2.3.2 - 2.5 only works with Bundler 2.3')
|
console.log('Ruby 2.3.2 - 2.5 only works with Bundler 2.3')
|
||||||
bundlerVersion = '2.3'
|
bundlerVersion = '2.3'
|
||||||
@@ -160,14 +160,6 @@ async function installBundler(bundlerVersionInput, rubygemsInputSet, lockFile, p
|
|||||||
|
|
||||||
await exec.exec(gem, ['install', 'bundler', ...force, '-v', bundlerVersionConstraint])
|
await exec.exec(gem, ['install', 'bundler', ...force, '-v', bundlerVersionConstraint])
|
||||||
|
|
||||||
if (bundlerVersion.startsWith('1') && common.isBundler2Default(engine, rubyVersion)) {
|
|
||||||
// If Bundler 1 is specified on Rubies which ship with Bundler 2,
|
|
||||||
// we need to specify which Bundler version to use explicitly until the lockfile exists.
|
|
||||||
// We actually set it globally for the case of bundler-cache: false with manual bundler install later.
|
|
||||||
console.log(`Setting BUNDLER_VERSION=${bundlerVersion} to ensure Bundler 1 is used`)
|
|
||||||
core.exportVariable('BUNDLER_VERSION', bundlerVersion)
|
|
||||||
}
|
|
||||||
|
|
||||||
return bundlerVersion
|
return bundlerVersion
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -177,19 +169,27 @@ async function bundleInstall(gemfile, lockFile, platform, engine, rubyVersion, b
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let envOptions = {}
|
||||||
|
if (bundlerVersion.startsWith('1') && common.isBundler2Default(engine, rubyVersion)) {
|
||||||
|
// If Bundler 1 is specified on Rubies which ship with Bundler 2,
|
||||||
|
// we need to specify which Bundler version to use explicitly until the lockfile exists.
|
||||||
|
console.log(`Setting BUNDLER_VERSION=${bundlerVersion} for "bundle config|lock" commands below to ensure Bundler 1 is used`)
|
||||||
|
envOptions = { env: { ...process.env, BUNDLER_VERSION: bundlerVersion } }
|
||||||
|
}
|
||||||
|
|
||||||
// config
|
// config
|
||||||
const cachePath = 'vendor/bundle'
|
const cachePath = 'vendor/bundle'
|
||||||
// An absolute path, so it is reliably under $PWD/vendor/bundle, and not relative to the gemfile's directory
|
// An absolute path, so it is reliably under $PWD/vendor/bundle, and not relative to the gemfile's directory
|
||||||
const bundleCachePath = path.join(process.cwd(), cachePath)
|
const bundleCachePath = path.join(process.cwd(), cachePath)
|
||||||
|
|
||||||
await exec.exec('bundle', ['config', '--local', 'path', bundleCachePath])
|
await exec.exec('bundle', ['config', '--local', 'path', bundleCachePath], envOptions)
|
||||||
|
|
||||||
if (fs.existsSync(lockFile)) {
|
if (fs.existsSync(lockFile)) {
|
||||||
await exec.exec('bundle', ['config', '--local', 'deployment', 'true'])
|
await exec.exec('bundle', ['config', '--local', 'deployment', 'true'], envOptions)
|
||||||
} else {
|
} else {
|
||||||
// Generate the lockfile so we can use it to compute the cache key.
|
// Generate the lockfile so we can use it to compute the cache key.
|
||||||
// This will also automatically pick up the latest gem versions compatible with the Gemfile.
|
// This will also automatically pick up the latest gem versions compatible with the Gemfile.
|
||||||
await exec.exec('bundle', ['lock'])
|
await exec.exec('bundle', ['lock'], envOptions)
|
||||||
}
|
}
|
||||||
|
|
||||||
await afterLockFile(lockFile, platform, engine, rubyVersion)
|
await afterLockFile(lockFile, platform, engine, rubyVersion)
|
||||||
@@ -68238,10 +68238,11 @@ async function installGCCTools(type, version) {
|
|||||||
// 2022-Dec ruby/msys2-gcc-pkgs now uses a suffix to delineate different archive versions.
|
// 2022-Dec ruby/msys2-gcc-pkgs now uses a suffix to delineate different archive versions.
|
||||||
// At present, the only use is to indicate the included OpenSSL version.
|
// At present, the only use is to indicate the included OpenSSL version.
|
||||||
// With no suffix, archives include OpenSSL 1.1.1, with a '-3.0' suffix, they include
|
// With no suffix, archives include OpenSSL 1.1.1, with a '-3.0' suffix, they include
|
||||||
// OpenSSL 3.0.x.
|
// OpenSSL 3.0.x. Note that the mswin archive uses OpenSSL 3.
|
||||||
// Currently, OpenSSL 3 is used in Ruby 3.2 & 'head', both use a custom RubyInstaller2 package.
|
// As of Jan-2023, OpenSSL 3 is used in Ruby 3.2 & all head versions. MSYS2 updated
|
||||||
|
// to OpenSSL 3 on 14-Jan-2023.
|
||||||
let suffix = ''
|
let suffix = ''
|
||||||
if ((version === 'head') || (!common.isHeadVersion(version) && common.floatVersion(version) >= 3.2)) {
|
if (common.isHeadVersion(version) || common.floatVersion(version) >= 3.2) {
|
||||||
suffix = '-3.0'
|
suffix = '-3.0'
|
||||||
}
|
}
|
||||||
const downloadPath = await common.measure(`Downloading ${type}${suffix} build tools`, async () => {
|
const downloadPath = await common.measure(`Downloading ${type}${suffix} build tools`, async () => {
|
||||||
|
|||||||
+4
-3
@@ -103,10 +103,11 @@ async function installGCCTools(type, version) {
|
|||||||
// 2022-Dec ruby/msys2-gcc-pkgs now uses a suffix to delineate different archive versions.
|
// 2022-Dec ruby/msys2-gcc-pkgs now uses a suffix to delineate different archive versions.
|
||||||
// At present, the only use is to indicate the included OpenSSL version.
|
// At present, the only use is to indicate the included OpenSSL version.
|
||||||
// With no suffix, archives include OpenSSL 1.1.1, with a '-3.0' suffix, they include
|
// With no suffix, archives include OpenSSL 1.1.1, with a '-3.0' suffix, they include
|
||||||
// OpenSSL 3.0.x.
|
// OpenSSL 3.0.x. Note that the mswin archive uses OpenSSL 3.
|
||||||
// Currently, OpenSSL 3 is used in Ruby 3.2 & 'head', both use a custom RubyInstaller2 package.
|
// As of Jan-2023, OpenSSL 3 is used in Ruby 3.2 & all head versions. MSYS2 updated
|
||||||
|
// to OpenSSL 3 on 14-Jan-2023.
|
||||||
let suffix = ''
|
let suffix = ''
|
||||||
if ((version === 'head') || (!common.isHeadVersion(version) && common.floatVersion(version) >= 3.2)) {
|
if (common.isHeadVersion(version) || common.floatVersion(version) >= 3.2) {
|
||||||
suffix = '-3.0'
|
suffix = '-3.0'
|
||||||
}
|
}
|
||||||
const downloadPath = await common.measure(`Downloading ${type}${suffix} build tools`, async () => {
|
const downloadPath = await common.measure(`Downloading ${type}${suffix} build tools`, async () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user