mirror of
https://github.com/ruby/setup-ruby.git
synced 2026-09-13 22:44:20 +02:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
77fe3b48b7 | ||
|
|
8df78e5576 | ||
|
|
b8e62b879e | ||
|
|
d60780f6b6 | ||
|
|
8aa012b56d | ||
|
|
628be4e0e4 | ||
|
|
ee26e27437 | ||
|
|
93287a1fa8 | ||
|
|
3190662165 | ||
|
|
eb7f94ffae | ||
|
|
ad718faf7a | ||
|
|
09c10210cc | ||
|
|
f78d71faf4 | ||
|
|
fe42d0e73b | ||
|
|
8a6667e214 | ||
|
|
03b78bdda2 | ||
|
|
5fe1a6694c | ||
|
|
bb3a0553d5 | ||
|
|
02c9cccf0e | ||
|
|
8d6236c5db |
@@ -18,7 +18,12 @@ jobs:
|
|||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
os: [ ubuntu-18.04, ubuntu-20.04, ubuntu-22.04, macos-10.15, macos-11, macos-12, windows-2019, windows-2022 ]
|
os: [ ubuntu-18.04, ubuntu-20.04, ubuntu-22.04, macos-10.15, macos-11, macos-12, windows-2019, windows-2022 ]
|
||||||
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', ruby-head, jruby, jruby-head, truffleruby, truffleruby-head, truffleruby+graalvm, truffleruby+graalvm-head ]
|
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', ruby-head,
|
||||||
|
jruby, jruby-head,
|
||||||
|
truffleruby, truffleruby-head,
|
||||||
|
truffleruby+graalvm, truffleruby+graalvm-head
|
||||||
|
]
|
||||||
include:
|
include:
|
||||||
- { os: windows-2019, ruby: mingw }
|
- { os: windows-2019, ruby: mingw }
|
||||||
- { os: windows-2019, ruby: mswin }
|
- { os: windows-2019, ruby: mswin }
|
||||||
@@ -27,14 +32,12 @@ jobs:
|
|||||||
- { os: windows-2022, ruby: ucrt }
|
- { os: windows-2022, ruby: ucrt }
|
||||||
exclude:
|
exclude:
|
||||||
- { os: windows-2019, ruby: '1.9' }
|
- { os: windows-2019, ruby: '1.9' }
|
||||||
- { os: windows-2019, ruby: '3.2' }
|
|
||||||
- { os: windows-2019, ruby: debug }
|
- { os: windows-2019, ruby: debug }
|
||||||
- { os: windows-2019, ruby: truffleruby }
|
- { os: windows-2019, ruby: truffleruby }
|
||||||
- { os: windows-2019, ruby: truffleruby-head }
|
- { os: windows-2019, ruby: truffleruby-head }
|
||||||
- { os: windows-2019, ruby: truffleruby+graalvm }
|
- { os: windows-2019, ruby: truffleruby+graalvm }
|
||||||
- { os: windows-2019, ruby: truffleruby+graalvm-head }
|
- { os: windows-2019, ruby: truffleruby+graalvm-head }
|
||||||
- { os: windows-2022, ruby: '1.9' }
|
- { os: windows-2022, ruby: '1.9' }
|
||||||
- { os: windows-2022, ruby: '3.2' }
|
|
||||||
- { os: windows-2022, ruby: debug }
|
- { os: windows-2022, ruby: debug }
|
||||||
- { os: windows-2022, ruby: truffleruby }
|
- { os: windows-2022, ruby: truffleruby }
|
||||||
- { os: windows-2022, ruby: truffleruby-head }
|
- { os: windows-2022, ruby: truffleruby-head }
|
||||||
@@ -186,17 +189,16 @@ jobs:
|
|||||||
- run: gem --version | grep -F "3.3.3"
|
- run: gem --version | grep -F "3.3.3"
|
||||||
|
|
||||||
testUseBundlerFromRubyGemsUpdate:
|
testUseBundlerFromRubyGemsUpdate:
|
||||||
if: false # https://github.com/ruby/setup-ruby/issues/405
|
|
||||||
name: "Test rubygems: version uses the Bundler installed by the rubygems update"
|
name: "Test rubygems: version uses the Bundler installed by the rubygems update"
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- uses: ./
|
- uses: ./
|
||||||
with:
|
with:
|
||||||
ruby-version: '2.2'
|
ruby-version: '3.1.0'
|
||||||
rubygems: 2.7.11
|
rubygems: 3.4.0
|
||||||
- run: gem --version | grep -F "2.7.11"
|
- run: gem --version | grep -F "3.4.0"
|
||||||
- run: bundle --version | grep -F "1.16.6"
|
- run: bundle --version | grep -F "2.4.0"
|
||||||
|
|
||||||
testFixedBundlerVersionForOldRuby:
|
testFixedBundlerVersionForOldRuby:
|
||||||
name: "Test bundler: 1.x for old Ruby"
|
name: "Test bundler: 1.x for old Ruby"
|
||||||
@@ -242,6 +244,17 @@ jobs:
|
|||||||
bundler: 2.2.3
|
bundler: 2.2.3
|
||||||
- run: bundle --version | grep -F "Bundler version 2.2.3"
|
- run: bundle --version | grep -F "Bundler version 2.2.3"
|
||||||
|
|
||||||
|
testBundlerPre:
|
||||||
|
name: "Test with a Bundler pre/rc version"
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- uses: ./
|
||||||
|
with:
|
||||||
|
ruby-version: '2.6'
|
||||||
|
bundler: 2.2.0.rc.2
|
||||||
|
- run: bundle --version | grep -F "Bundler version 2.2.0.rc.2"
|
||||||
|
|
||||||
testBundlerDev:
|
testBundlerDev:
|
||||||
name: "Test BUNDLED WITH Bundler dev"
|
name: "Test BUNDLED WITH Bundler dev"
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|||||||
@@ -15,10 +15,10 @@ This action currently supports these versions of MRI, JRuby and TruffleRuby:
|
|||||||
|
|
||||||
| Interpreter | Versions |
|
| Interpreter | Versions |
|
||||||
| ----------- | -------- |
|
| ----------- | -------- |
|
||||||
| `ruby` | 1.9.3, 2.0.0, 2.1.9, 2.2, all versions from 2.3.0 until 3.2.0-rc1, head, debug, mingw, mswin, ucrt |
|
| `ruby` | 1.9.3, 2.0.0, 2.1.9, 2.2, all versions from 2.3.0 until 3.2.0, head, debug, mingw, mswin, ucrt |
|
||||||
| `jruby` | 9.1.17.0 - 9.4.0.0, head |
|
| `jruby` | 9.1.17.0 - 9.4.1.0, head |
|
||||||
| `truffleruby` | 19.3.0 - 22.3.0, head |
|
| `truffleruby` | 19.3.0 - 22.3.1, head |
|
||||||
| `truffleruby+graalvm` | 21.2.0 - 22.3.0, head |
|
| `truffleruby+graalvm` | 21.2.0 - 22.3.1, head |
|
||||||
|
|
||||||
`ruby-debug` is the same as `ruby-head` but with assertions enabled (`-DRUBY_DEBUG=1`).
|
`ruby-debug` is the same as `ruby-head` but with assertions enabled (`-DRUBY_DEBUG=1`).
|
||||||
|
|
||||||
|
|||||||
+20
-4
@@ -6,7 +6,10 @@ const cache = require('@actions/cache')
|
|||||||
const common = require('./common')
|
const common = require('./common')
|
||||||
|
|
||||||
export const DEFAULT_CACHE_VERSION = '0'
|
export const DEFAULT_CACHE_VERSION = '0'
|
||||||
export const BUNDLER_VERSION_REGEXP = /^\d+(?:\.\d+){0,2}$/
|
|
||||||
|
function isValidBundlerVersion(bundlerVersion) {
|
||||||
|
return /^\d+(?:\.\d+){0,2}/.test(bundlerVersion) && !bundlerVersion.endsWith('.dev')
|
||||||
|
}
|
||||||
|
|
||||||
// The returned gemfile is guaranteed to exist, the lockfile might not exist
|
// The returned gemfile is guaranteed to exist, the lockfile might not exist
|
||||||
export function detectGemfiles() {
|
export function detectGemfiles() {
|
||||||
@@ -33,7 +36,7 @@ function readBundledWithFromGemfileLock(lockFile) {
|
|||||||
const nextLine = lines[bundledWithLine+1]
|
const nextLine = lines[bundledWithLine+1]
|
||||||
if (nextLine) {
|
if (nextLine) {
|
||||||
const bundlerVersion = nextLine.trim()
|
const bundlerVersion = nextLine.trim()
|
||||||
if (BUNDLER_VERSION_REGEXP.test(bundlerVersion)) {
|
if (isValidBundlerVersion(bundlerVersion)) {
|
||||||
console.log(`Using Bundler ${bundlerVersion} from ${lockFile} BUNDLED WITH ${bundlerVersion}`)
|
console.log(`Using Bundler ${bundlerVersion} from ${lockFile} BUNDLED WITH ${bundlerVersion}`)
|
||||||
return bundlerVersion
|
return bundlerVersion
|
||||||
} else {
|
} else {
|
||||||
@@ -100,7 +103,7 @@ export async function installBundler(bundlerVersionInput, rubygemsInputSet, lock
|
|||||||
bundlerVersion = '2'
|
bundlerVersion = '2'
|
||||||
}
|
}
|
||||||
|
|
||||||
if (BUNDLER_VERSION_REGEXP.test(bundlerVersion)) {
|
if (isValidBundlerVersion(bundlerVersion)) {
|
||||||
// OK - input is a 1, 2, or 3 part version number
|
// OK - input is a 1, 2, or 3 part version number
|
||||||
} else {
|
} else {
|
||||||
throw new Error(`Cannot parse bundler input: ${bundlerVersion}`)
|
throw new Error(`Cannot parse bundler input: ${bundlerVersion}`)
|
||||||
@@ -120,13 +123,26 @@ export async function installBundler(bundlerVersionInput, rubygemsInputSet, lock
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const targetRubyVersion = common.targetRubyVersion(engine, rubyVersion)
|
||||||
|
// 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
|
||||||
|
if (bundlerVersion == '2') {
|
||||||
|
if (targetRubyVersion <= 2.5) { // < 2.3.2 already handled above
|
||||||
|
console.log('Ruby 2.3.2 - 2.5 only works with Bundler 2.3')
|
||||||
|
bundlerVersion = '2.3'
|
||||||
|
} else if (targetRubyVersion <= 2.7) {
|
||||||
|
console.log('Ruby 2.6-2.7 only works with Bundler 2.4')
|
||||||
|
bundlerVersion = '2.4'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const gem = path.join(rubyPrefix, 'bin', 'gem')
|
const gem = path.join(rubyPrefix, 'bin', 'gem')
|
||||||
// Workaround for https://github.com/rubygems/rubygems/issues/5245
|
// Workaround for https://github.com/rubygems/rubygems/issues/5245
|
||||||
// and for https://github.com/oracle/truffleruby/issues/2780
|
// and for https://github.com/oracle/truffleruby/issues/2780
|
||||||
const force = ((platform.startsWith('windows-') && engine === 'ruby' && floatVersion >= 3.1) || (engine === 'truffleruby')) ? ['--force'] : []
|
const force = ((platform.startsWith('windows-') && engine === 'ruby' && floatVersion >= 3.1) || (engine === 'truffleruby')) ? ['--force'] : []
|
||||||
|
|
||||||
const versionParts = [...bundlerVersion.matchAll(/\d+/g)].length
|
const versionParts = [...bundlerVersion.matchAll(/\d+/g)].length
|
||||||
const bundlerVersionConstraint = versionParts === 3 ? bundlerVersion : `~> ${bundlerVersion}.0`
|
const bundlerVersionConstraint = versionParts >= 3 ? bundlerVersion : `~> ${bundlerVersion}.0`
|
||||||
|
|
||||||
await exec.exec(gem, ['install', 'bundler', ...force, '-v', bundlerVersionConstraint])
|
await exec.exec(gem, ['install', 'bundler', ...force, '-v', bundlerVersionConstraint])
|
||||||
|
|
||||||
|
|||||||
@@ -95,6 +95,31 @@ export function isBundler2dot2Default(engine, rubyVersion) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function targetRubyVersion(engine, rubyVersion) {
|
||||||
|
const version = floatVersion(rubyVersion)
|
||||||
|
if (engine === 'ruby') {
|
||||||
|
return version
|
||||||
|
} else if (engine === 'jruby') {
|
||||||
|
if (version === 9.1) {
|
||||||
|
return 2.3
|
||||||
|
} else if (version === 9.2) {
|
||||||
|
return 2.5
|
||||||
|
} else if (version === 9.3) {
|
||||||
|
return 2.6
|
||||||
|
}
|
||||||
|
} else if (engine.startsWith('truffleruby')) {
|
||||||
|
if (version < 21.0) {
|
||||||
|
return 2.6
|
||||||
|
} else if (version < 22.0) {
|
||||||
|
return 2.7
|
||||||
|
} else if (version < 23.0) {
|
||||||
|
return 3.0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return 9.9 // unknown, assume recent
|
||||||
|
}
|
||||||
|
|
||||||
export function floatVersion(rubyVersion) {
|
export function floatVersion(rubyVersion) {
|
||||||
const match = rubyVersion.match(/^\d+\.\d+/)
|
const match = rubyVersion.match(/^\d+\.\d+/)
|
||||||
if (match) {
|
if (match) {
|
||||||
|
|||||||
+67
-13
File diff suppressed because one or more lines are too long
+43
-46
@@ -1,65 +1,62 @@
|
|||||||
versions = ARGV.fetch(0).split(',').map(&:strip)
|
versions = ARGV.fetch(0).split(',').map(&:strip)
|
||||||
versions.each do |engine_version|
|
p versions
|
||||||
engine_input, version = engine_version.split('-', 2)
|
|
||||||
|
|
||||||
if engine_input == 'windows'
|
versions.each do |engine_version|
|
||||||
|
puts engine_version
|
||||||
|
engine, version = engine_version.split('-', 2)
|
||||||
|
p [engine, version]
|
||||||
|
|
||||||
|
if engine == 'windows'
|
||||||
require_relative 'generate-windows-versions'
|
require_relative 'generate-windows-versions'
|
||||||
exit
|
exit
|
||||||
end
|
end
|
||||||
|
|
||||||
MATCH = case engine_input
|
match = case engine
|
||||||
when 'ruby', 'jruby'
|
when 'ruby', 'jruby'
|
||||||
/^\d+\.\d+\./
|
/^\d+\.\d+\./
|
||||||
when 'truffleruby'
|
when 'truffleruby', 'truffleruby+graalvm'
|
||||||
/^\d+\./
|
/^\d+\./
|
||||||
end
|
end
|
||||||
|
|
||||||
raise unless version[MATCH]
|
raise engine_version unless version[match]
|
||||||
|
|
||||||
engines = [engine_input]
|
# Update ruby-builder-versions.json
|
||||||
engines << 'truffleruby+graalvm' if engine_input == 'truffleruby'
|
file = "#{__dir__}/ruby-builder-versions.json"
|
||||||
|
lines = File.readlines(file, chomp: true)
|
||||||
|
|
||||||
engines.each do |engine|
|
from = lines.index { |line| line.include?(%{"#{engine}": [}) }
|
||||||
puts engine
|
raise "Could not find start of #{engine}" unless from
|
||||||
|
to = from
|
||||||
|
to += 1 until lines[to].include?(']')
|
||||||
|
|
||||||
# Update ruby-builder-versions.json
|
from += 1 # [
|
||||||
file = "#{__dir__}/ruby-builder-versions.json"
|
to -= 2 # head, ]
|
||||||
lines = File.readlines(file, chomp: true)
|
|
||||||
|
|
||||||
from = lines.index { |line| line.include?(%{"#{engine}": [}) }
|
puts lines[from..to]
|
||||||
raise "Could not find start of #{engine}" unless from
|
|
||||||
to = from
|
|
||||||
to += 1 until lines[to].include?(']')
|
|
||||||
|
|
||||||
from += 1 # [
|
release_line = lines[from..to].find { |line|
|
||||||
to -= 2 # head, ]
|
v = line[/"([^"]+)"/, 1] and v[match] == version[match]
|
||||||
|
}
|
||||||
|
|
||||||
puts lines[from..to]
|
if release_line
|
||||||
|
append = " #{version.inspect},"
|
||||||
release_line = lines[from..to].find { |line|
|
release_line << append unless release_line.end_with?(append)
|
||||||
v = line[/"([^"]+)"/, 1] and v[MATCH] == version[MATCH]
|
else
|
||||||
}
|
lines.insert to+1, " #{version.inspect},"
|
||||||
|
|
||||||
if release_line
|
|
||||||
append = " #{version.inspect},"
|
|
||||||
release_line << append unless release_line.end_with?(append)
|
|
||||||
else
|
|
||||||
lines.insert to+1, " #{version.inspect},"
|
|
||||||
end
|
|
||||||
|
|
||||||
File.write(file, lines.join("\n") + "\n")
|
|
||||||
|
|
||||||
# Update README.md
|
|
||||||
file = "#{__dir__}/README.md"
|
|
||||||
lines = File.readlines(file)
|
|
||||||
engine_line = lines.find { |line| line.start_with?("| `#{engine}`") }
|
|
||||||
engine_line.sub!(/(.+ (?:-|until)) (\d+(?:\.\d+)+(?:-\w+)?)/) do
|
|
||||||
if Gem::Version.new(version) > Gem::Version.new($2)
|
|
||||||
"#{$1} #{version}"
|
|
||||||
else
|
|
||||||
$&
|
|
||||||
end
|
|
||||||
end
|
|
||||||
File.write(file, lines.join)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
File.write(file, lines.join("\n") + "\n")
|
||||||
|
|
||||||
|
# Update README.md
|
||||||
|
file = "#{__dir__}/README.md"
|
||||||
|
lines = File.readlines(file)
|
||||||
|
engine_line = lines.find { |line| line.start_with?("| `#{engine}`") }
|
||||||
|
engine_line.sub!(/(.+ (?:-|until)) (\d+(?:\.\d+)+(?:-\w+)?)/) do
|
||||||
|
if Gem::Version.new(version) > Gem::Version.new($2)
|
||||||
|
"#{$1} #{version}"
|
||||||
|
else
|
||||||
|
$&
|
||||||
|
end
|
||||||
|
end
|
||||||
|
File.write(file, lines.join)
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -11,26 +11,26 @@
|
|||||||
"2.7.0", "2.7.1", "2.7.2", "2.7.3", "2.7.4", "2.7.5", "2.7.6", "2.7.7",
|
"2.7.0", "2.7.1", "2.7.2", "2.7.3", "2.7.4", "2.7.5", "2.7.6", "2.7.7",
|
||||||
"3.0.0-preview1", "3.0.0-preview2", "3.0.0-rc1", "3.0.0", "3.0.1", "3.0.2", "3.0.3", "3.0.4", "3.0.5",
|
"3.0.0-preview1", "3.0.0-preview2", "3.0.0-rc1", "3.0.0", "3.0.1", "3.0.2", "3.0.3", "3.0.4", "3.0.5",
|
||||||
"3.1.0-preview1", "3.1.0", "3.1.1", "3.1.2", "3.1.3",
|
"3.1.0-preview1", "3.1.0", "3.1.1", "3.1.2", "3.1.3",
|
||||||
"3.2.0-preview1", "3.2.0-preview2", "3.2.0-preview3", "3.2.0-rc1",
|
"3.2.0-preview1", "3.2.0-preview2", "3.2.0-preview3", "3.2.0-rc1", "3.2.0",
|
||||||
"head", "debug"
|
"head", "debug"
|
||||||
],
|
],
|
||||||
"jruby": [
|
"jruby": [
|
||||||
"9.1.17.0",
|
"9.1.17.0",
|
||||||
"9.2.9.0", "9.2.10.0", "9.2.11.0", "9.2.11.1", "9.2.12.0", "9.2.13.0", "9.2.14.0", "9.2.15.0", "9.2.16.0", "9.2.17.0", "9.2.18.0", "9.2.19.0", "9.2.20.0", "9.2.20.1", "9.2.21.0",
|
"9.2.9.0", "9.2.10.0", "9.2.11.0", "9.2.11.1", "9.2.12.0", "9.2.13.0", "9.2.14.0", "9.2.15.0", "9.2.16.0", "9.2.17.0", "9.2.18.0", "9.2.19.0", "9.2.20.0", "9.2.20.1", "9.2.21.0",
|
||||||
"9.3.0.0", "9.3.1.0", "9.3.2.0", "9.3.3.0", "9.3.4.0", "9.3.6.0", "9.3.7.0", "9.3.8.0", "9.3.9.0",
|
"9.3.0.0", "9.3.1.0", "9.3.2.0", "9.3.3.0", "9.3.4.0", "9.3.6.0", "9.3.7.0", "9.3.8.0", "9.3.9.0", "9.3.10.0",
|
||||||
"9.4.0.0",
|
"9.4.0.0", "9.4.1.0",
|
||||||
"head"
|
"head"
|
||||||
],
|
],
|
||||||
"truffleruby": [
|
"truffleruby": [
|
||||||
"19.3.0", "19.3.1",
|
"19.3.0", "19.3.1",
|
||||||
"20.0.0", "20.1.0", "20.2.0", "20.3.0",
|
"20.0.0", "20.1.0", "20.2.0", "20.3.0",
|
||||||
"21.0.0", "21.1.0", "21.2.0", "21.2.0.1", "21.3.0",
|
"21.0.0", "21.1.0", "21.2.0", "21.2.0.1", "21.3.0",
|
||||||
"22.0.0.2", "22.1.0", "22.2.0", "22.3.0",
|
"22.0.0.2", "22.1.0", "22.2.0", "22.3.0", "22.3.1",
|
||||||
"head"
|
"head"
|
||||||
],
|
],
|
||||||
"truffleruby+graalvm": [
|
"truffleruby+graalvm": [
|
||||||
"21.2.0", "21.3.0",
|
"21.2.0", "21.3.0",
|
||||||
"22.0.0.2", "22.1.0", "22.2.0", "22.3.0",
|
"22.0.0.2", "22.1.0", "22.2.0", "22.3.0", "22.3.1",
|
||||||
"head"
|
"head"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -51,6 +51,7 @@
|
|||||||
"3.1.1": "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-3.1.1-1/rubyinstaller-3.1.1-1-x64.7z",
|
"3.1.1": "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-3.1.1-1/rubyinstaller-3.1.1-1-x64.7z",
|
||||||
"3.1.2": "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-3.1.2-1/rubyinstaller-3.1.2-1-x64.7z",
|
"3.1.2": "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-3.1.2-1/rubyinstaller-3.1.2-1-x64.7z",
|
||||||
"3.1.3": "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-3.1.3-1/rubyinstaller-3.1.3-1-x64.7z",
|
"3.1.3": "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-3.1.3-1/rubyinstaller-3.1.3-1-x64.7z",
|
||||||
|
"3.2.0": "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-3.2.0-1/rubyinstaller-3.2.0-1-x64.7z",
|
||||||
"head": "https://github.com/oneclick/rubyinstaller2/releases/download/rubyinstaller-head/rubyinstaller-head-x64.7z",
|
"head": "https://github.com/oneclick/rubyinstaller2/releases/download/rubyinstaller-head/rubyinstaller-head-x64.7z",
|
||||||
"mingw": "https://github.com/MSP-Greg/ruby-loco/releases/download/ruby-master/ruby-mingw.7z",
|
"mingw": "https://github.com/MSP-Greg/ruby-loco/releases/download/ruby-master/ruby-mingw.7z",
|
||||||
"mswin": "https://github.com/MSP-Greg/ruby-loco/releases/download/ruby-master/ruby-mswin.7z",
|
"mswin": "https://github.com/MSP-Greg/ruby-loco/releases/download/ruby-master/ruby-mswin.7z",
|
||||||
|
|||||||
+19
-6
@@ -1,6 +1,8 @@
|
|||||||
// 7z arguments
|
// 7z arguments
|
||||||
// -aoa overwrite existing, -bd disable progress indicator
|
// -aoa overwrite existing, -bd disable progress indicator
|
||||||
|
|
||||||
|
// OpenSSL version detection is needed in installGCCTools and installJRubyTools
|
||||||
|
|
||||||
const fs = require('fs')
|
const fs = require('fs')
|
||||||
const path = require('path')
|
const path = require('path')
|
||||||
const cp = require('child_process')
|
const cp = require('child_process')
|
||||||
@@ -80,7 +82,7 @@ export async function install(platform, engine, version) {
|
|||||||
// windows 2016 and 2019 need ucrt64 installed, 2022 and future images need
|
// windows 2016 and 2019 need ucrt64 installed, 2022 and future images need
|
||||||
// ucrt64 or mingw64 installed, depending on Ruby version
|
// ucrt64 or mingw64 installed, depending on Ruby version
|
||||||
if (((msys2Type === 'ucrt64') || !hasMSYS2PreInstalled) && common.floatVersion(version) >= 2.4) {
|
if (((msys2Type === 'ucrt64') || !hasMSYS2PreInstalled) && common.floatVersion(version) >= 2.4) {
|
||||||
await installGCCTools(msys2Type)
|
await installGCCTools(msys2Type, version)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (version === 'mswin') {
|
if (version === 'mswin') {
|
||||||
@@ -97,14 +99,24 @@ export async function install(platform, engine, version) {
|
|||||||
|
|
||||||
// Actions windows-2022 image does not contain any mingw or ucrt build tools. Install tools for it,
|
// Actions windows-2022 image does not contain any mingw or ucrt build tools. Install tools for it,
|
||||||
// and also install ucrt tools on earlier versions, which have msys2 and mingw tools preinstalled.
|
// and also install ucrt tools on earlier versions, which have msys2 and mingw tools preinstalled.
|
||||||
async function installGCCTools(type) {
|
async function installGCCTools(type, version) {
|
||||||
const downloadPath = await common.measure(`Downloading ${type} build tools`, async () => {
|
// 2022-Dec ruby/msys2-gcc-pkgs now uses a suffix to delineate different archive versions.
|
||||||
let url = `${msys2GCCReleaseURI}/msys2-gcc-pkgs/${type}.7z`
|
// 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
|
||||||
|
// OpenSSL 3.0.x. Note that the mswin archive uses OpenSSL 3.
|
||||||
|
// 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 = ''
|
||||||
|
if (common.isHeadVersion(version) || common.floatVersion(version) >= 3.2) {
|
||||||
|
suffix = '-3.0'
|
||||||
|
}
|
||||||
|
const downloadPath = await common.measure(`Downloading ${type}${suffix} build tools`, async () => {
|
||||||
|
let url = `${msys2GCCReleaseURI}/msys2-gcc-pkgs/${type}${suffix}.7z`
|
||||||
console.log(url)
|
console.log(url)
|
||||||
return await tc.downloadTool(url)
|
return await tc.downloadTool(url)
|
||||||
})
|
})
|
||||||
|
|
||||||
await common.measure(`Extracting ${type} build tools`, async () =>
|
await common.measure(`Extracting ${type}${suffix} build tools`, async () =>
|
||||||
exec.exec('7z', ['x', downloadPath, '-aoa', '-bd', `-o${msys2BasePath}`], { silent: true }))
|
exec.exec('7z', ['x', downloadPath, '-aoa', '-bd', `-o${msys2BasePath}`], { silent: true }))
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -129,7 +141,8 @@ async function installMSYS2Tools() {
|
|||||||
// windows-2022 and later images
|
// windows-2022 and later images
|
||||||
export async function installJRubyTools() {
|
export async function installJRubyTools() {
|
||||||
await installMSYS2Tools()
|
await installMSYS2Tools()
|
||||||
await installGCCTools('mingw64')
|
// Will need to add OpenSSL version detection when JRuby uses OpenSSL 3.0 ?
|
||||||
|
await installGCCTools('mingw64', '2.7')
|
||||||
}
|
}
|
||||||
|
|
||||||
// Install vcpkg files needed to build mswin Ruby
|
// Install vcpkg files needed to build mswin Ruby
|
||||||
|
|||||||
Reference in New Issue
Block a user