mirror of
https://github.com/ruby/setup-ruby.git
synced 2026-09-13 14:34:21 +02:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
be0cc84c1b | ||
|
|
e7eea4e63a | ||
|
|
bb8200704b | ||
|
|
cf1a6dd2d8 | ||
|
|
5b2e10fa5f | ||
|
|
313811148f | ||
|
|
74cfbf0614 | ||
|
|
f20f1eae72 | ||
|
|
330f7f5faa | ||
|
|
a2b2637a7c | ||
|
|
e5b2d1fb1e | ||
|
|
b00551441a | ||
|
|
f514fbcdac | ||
|
|
a6f2286594 | ||
|
|
c84889b9b9 | ||
|
|
ac03cb7d18 | ||
|
|
5e4f0a10bf | ||
|
|
57d46d78b7 | ||
|
|
7edf159e98 | ||
|
|
d9a8687ae9 | ||
|
|
ae9cb3b565 | ||
|
|
77d7ca9909 | ||
|
|
e08bf35edf | ||
|
|
0997e21bf3 |
@@ -16,18 +16,26 @@ jobs:
|
|||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
os: [ ubuntu-18.04, ubuntu-20.04, macos-10.15, macos-11.0, windows-2016, windows-2019 ]
|
os: [ ubuntu-18.04, ubuntu-20.04, macos-10.15, macos-11.0, windows-2016, windows-2019 ]
|
||||||
ruby: [ '2.0', 2.1, 2.2, 2.3, 2.4, 2.5, 2.6, 2.7, '3.0', ruby-head, jruby, jruby-head, truffleruby, truffleruby-head ]
|
ruby: [ 1.9, '2.0', 2.1, 2.2, 2.3, 2.4, 2.5, 2.6, 2.7, '3.0', 3.1, ruby-head, jruby, jruby-head, truffleruby, truffleruby-head, truffleruby+graalvm, truffleruby+graalvm-head ]
|
||||||
include:
|
include:
|
||||||
- { os: windows-2016, ruby: mingw }
|
- { os: windows-2016, ruby: mingw }
|
||||||
- { os: windows-2019, ruby: mingw }
|
- { os: windows-2019, ruby: mingw }
|
||||||
- { os: windows-2019, ruby: mswin }
|
- { os: windows-2019, ruby: mswin }
|
||||||
exclude:
|
exclude:
|
||||||
|
- { os: windows-2016, ruby: 1.9 }
|
||||||
|
- { os: windows-2016, ruby: 3.1 }
|
||||||
- { os: windows-2016, ruby: debug }
|
- { os: windows-2016, ruby: debug }
|
||||||
- { os: windows-2016, ruby: truffleruby }
|
- { os: windows-2016, ruby: truffleruby }
|
||||||
- { os: windows-2016, ruby: truffleruby-head }
|
- { os: windows-2016, ruby: truffleruby-head }
|
||||||
|
- { os: windows-2016, ruby: truffleruby+graalvm }
|
||||||
|
- { os: windows-2016, ruby: truffleruby+graalvm-head }
|
||||||
|
- { os: windows-2019, ruby: 1.9 }
|
||||||
|
- { os: windows-2019, ruby: 3.1 }
|
||||||
- { 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-head }
|
||||||
|
|
||||||
name: ${{ matrix.os }} ${{ matrix.ruby }}
|
name: ${{ matrix.os }} ${{ matrix.ruby }}
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
@@ -67,18 +75,22 @@ jobs:
|
|||||||
|
|
||||||
- name: Subprocess test
|
- name: Subprocess test
|
||||||
run: ruby test_subprocess.rb
|
run: ruby test_subprocess.rb
|
||||||
- name: OpenSSL version
|
- name: OpenSSL compiled version
|
||||||
|
run: ruby -ropenssl -e 'puts OpenSSL::OPENSSL_VERSION'
|
||||||
|
- name: OpenSSL loaded version
|
||||||
run: ruby -ropenssl -e 'puts OpenSSL::OPENSSL_LIBRARY_VERSION'
|
run: ruby -ropenssl -e 'puts OpenSSL::OPENSSL_LIBRARY_VERSION'
|
||||||
|
if: matrix.ruby != '1.9'
|
||||||
- name: OpenSSL test
|
- name: OpenSSL test
|
||||||
run: ruby -ropen-uri -e 'puts URI.send(:open, %{https://rubygems.org/}) { |f| f.read(1024) }'
|
run: ruby -ropen-uri -e 'puts URI.send(:open, %{https://rubygems.org/}) { |f| f.read(1024) }'
|
||||||
|
|
||||||
- run: gem env
|
- run: gem env
|
||||||
- name: C extension test
|
- name: C extension test
|
||||||
run: gem install json:2.2.0 --no-document
|
run: gem install json -v 2.2.0
|
||||||
- run: bundle --version
|
- run: bundle --version
|
||||||
# This step is redundant with `bundler-cache: true` but is there to check a redundant `bundle install` still works
|
# This step is redundant with `bundler-cache: true` but is there to check a redundant `bundle install` still works
|
||||||
- run: bundle install
|
- run: bundle install
|
||||||
- run: bundle exec rake --version
|
- run: bundle exec rake --version
|
||||||
|
- run: bundle exec rake
|
||||||
|
|
||||||
- name: which ruby, rake
|
- name: which ruby, rake
|
||||||
if: "!startsWith(matrix.os, 'windows')"
|
if: "!startsWith(matrix.os, 'windows')"
|
||||||
|
|||||||
@@ -19,3 +19,7 @@ It is recommended to add this as a `git` `pre-commit` hook:
|
|||||||
```bash
|
```bash
|
||||||
$ cp pre-commit .git/hooks/pre-commit
|
$ cp pre-commit .git/hooks/pre-commit
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Adding a new Ruby version
|
||||||
|
|
||||||
|
Add the new version in `ruby-builder-versions.js`, then follow the steps above in [Regenerating dist/index.js](#regenerating-distindexjs) to update `dist/index.js`. Finally, update the "Supported Versions" section of the README if needed.
|
||||||
|
|||||||
@@ -14,9 +14,10 @@ This action currently supports these versions of MRI, JRuby and TruffleRuby:
|
|||||||
|
|
||||||
| Interpreter | Versions |
|
| Interpreter | Versions |
|
||||||
| ----------- | -------- |
|
| ----------- | -------- |
|
||||||
| `ruby` | 2.0.0, 2.1.9, 2.2, all versions from 2.3.0 until 3.0.2, head, debug, mingw, mswin |
|
| `ruby` | 1.9.3, 2.0.0, 2.1.9, 2.2, all versions from 2.3.0 until 3.1.0-preview1, head, debug, mingw, mswin |
|
||||||
| `jruby` | 9.1.17.0, 9.2.9.0 - 9.2.19.0, head |
|
| `jruby` | 9.1.17.0 - 9.3.1.0, head |
|
||||||
| `truffleruby` | 19.3.0 - 21.2.0, head |
|
| `truffleruby` | 19.3.0 - 21.3.0, head |
|
||||||
|
| `truffleruby+graalvm` | 21.2.0 - 21.3.0, 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`).
|
||||||
On Windows, `mingw` and `mswin` are `ruby-head` builds using the MSYS2/MinGW and the MSVC toolchains respectively.
|
On Windows, `mingw` and `mswin` are `ruby-head` builds using the MSYS2/MinGW and the MSVC toolchains respectively.
|
||||||
@@ -46,8 +47,9 @@ The prebuilt releases are generated by [ruby-builder](https://github.com/ruby/ru
|
|||||||
and on Windows by [RubyInstaller2](https://github.com/oneclick/rubyinstaller2).
|
and on Windows by [RubyInstaller2](https://github.com/oneclick/rubyinstaller2).
|
||||||
`mingw` and `mswin` builds are generated by [ruby-loco](https://github.com/MSP-Greg/ruby-loco).
|
`mingw` and `mswin` builds are generated by [ruby-loco](https://github.com/MSP-Greg/ruby-loco).
|
||||||
`ruby-head` is generated by [ruby-dev-builder](https://github.com/ruby/ruby-dev-builder),
|
`ruby-head` is generated by [ruby-dev-builder](https://github.com/ruby/ruby-dev-builder),
|
||||||
`jruby-head` is generated by [jruby-dev-builder](https://github.com/ruby/jruby-dev-builder)
|
`jruby-head` is generated by [jruby-dev-builder](https://github.com/ruby/jruby-dev-builder),
|
||||||
and `truffleruby-head` is generated by [truffleruby-dev-builder](https://github.com/ruby/truffleruby-dev-builder).
|
`truffleruby-head` is generated by [truffleruby-dev-builder](https://github.com/ruby/truffleruby-dev-builder)
|
||||||
|
and `truffleruby+graalvm` is generated by [graalvm-ce-dev-builds](https://github.com/graalvm/graalvm-ce-dev-builds).
|
||||||
The full list of available Ruby versions can be seen in [ruby-builder-versions.js](ruby-builder-versions.js)
|
The full list of available Ruby versions can be seen in [ruby-builder-versions.js](ruby-builder-versions.js)
|
||||||
for Ubuntu and macOS and in [windows-versions.js](windows-versions.js) for Windows.
|
for Ubuntu and macOS and in [windows-versions.js](windows-versions.js) for Windows.
|
||||||
|
|
||||||
@@ -205,6 +207,7 @@ So, please use `bundler-cache: true` instead and report any issue.
|
|||||||
Note that running CI on Windows can be quite challenging if you are not very familiar with Windows.
|
Note that running CI on Windows can be quite challenging if you are not very familiar with Windows.
|
||||||
It is recommended to first get your build working on Ubuntu and macOS before trying Windows.
|
It is recommended to first get your build working on Ubuntu and macOS before trying Windows.
|
||||||
|
|
||||||
|
* Use Bundler 2.2.18+ on Windows (older versions have [bugs](https://github.com/ruby/setup-ruby/issues/209#issuecomment-889064123)) by not setting the `bundler:` input and ensuring there is no `BUNDLED WITH 1.x.y` in a checked-in `Gemfile.lock`.
|
||||||
* The default shell on Windows is not Bash but [PowerShell](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#using-a-specific-shell).
|
* The default shell on Windows is not Bash but [PowerShell](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#using-a-specific-shell).
|
||||||
This can lead issues such as multi-line scripts [not working as expected](https://github.com/ruby/setup-ruby/issues/13).
|
This can lead issues such as multi-line scripts [not working as expected](https://github.com/ruby/setup-ruby/issues/13).
|
||||||
* The `PATH` contains [multiple compiler toolchains](https://github.com/ruby/setup-ruby/issues/19). Use `where.exe` to debug which tool is used.
|
* The `PATH` contains [multiple compiler toolchains](https://github.com/ruby/setup-ruby/issues/19). Use `where.exe` to debug which tool is used.
|
||||||
@@ -240,6 +243,8 @@ if the [virtual environment](https://github.com/actions/virtual-environments) is
|
|||||||
|
|
||||||
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.
|
||||||
|
|
||||||
|
On a self-hosted runner you need to define the `ImageOs` as an evironment variable on the host, you can do this in the `~/actions-runner/.env` file (See [#230](https://github.com/ruby/setup-ruby/issues/230)).
|
||||||
|
|
||||||
## History
|
## History
|
||||||
|
|
||||||
This action used to be at `eregon/use-ruby-action` and was moved to the `ruby` organization.
|
This action used to be at `eregon/use-ruby-action` and was moved to the `ruby` organization.
|
||||||
|
|||||||
+25
-21
@@ -40,12 +40,12 @@ function readBundledWithFromGemfileLock(lockFile) {
|
|||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
|
||||||
async function afterLockFile(lockFile, platform, engine) {
|
async function afterLockFile(lockFile, platform, engine, rubyVersion) {
|
||||||
if (engine === 'truffleruby' && platform.startsWith('ubuntu-')) {
|
if (engine.startsWith('truffleruby') && common.floatVersion(rubyVersion) < 21.1 && platform.startsWith('ubuntu-')) {
|
||||||
const contents = fs.readFileSync(lockFile, 'utf8')
|
const contents = fs.readFileSync(lockFile, 'utf8')
|
||||||
if (contents.includes('nokogiri')) {
|
if (contents.includes('nokogiri')) {
|
||||||
await common.measure('Installing libxml2-dev libxslt-dev, required to install nokogiri on TruffleRuby', async () =>
|
await common.measure('Installing libxml2-dev libxslt-dev, required to install nokogiri on TruffleRuby < 21.1', async () =>
|
||||||
exec.exec('sudo', ['apt-get', '-yqq', 'install', 'libxml2-dev', 'libxslt-dev'], { silent: true }))
|
exec.exec('sudo', ['apt-get', '-yqq', 'install', 'libxml2-dev', 'libxslt-dev'], { silent: true }))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -71,10 +71,10 @@ export async function installBundler(bundlerVersionInput, lockFile, platform, ru
|
|||||||
throw new Error(`Cannot parse bundler input: ${bundlerVersion}`)
|
throw new Error(`Cannot parse bundler input: ${bundlerVersion}`)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (engine === 'ruby' && rubyVersion.match(/^2\.[012]/)) {
|
if (engine === 'ruby' && common.floatVersion(rubyVersion) <= 2.2) {
|
||||||
console.log('Bundler 2 requires Ruby 2.3+, using Bundler 1 on Ruby <= 2.2')
|
console.log('Bundler 2 requires Ruby 2.3+, using Bundler 1 on Ruby <= 2.2')
|
||||||
bundlerVersion = '1'
|
bundlerVersion = '1'
|
||||||
} else if (engine === 'ruby' && rubyVersion.match(/^2\.3\.[01]/)) {
|
} else if (engine === 'ruby' && /^2\.3\.[01]/.test(rubyVersion)) {
|
||||||
console.log('Ruby 2.3.0 and 2.3.1 have shipped with an old rubygems that only works with Bundler 1')
|
console.log('Ruby 2.3.0 and 2.3.1 have shipped with an old rubygems that only works with Bundler 1')
|
||||||
bundlerVersion = '1'
|
bundlerVersion = '1'
|
||||||
} else if (engine === 'jruby' && rubyVersion.startsWith('9.1')) { // JRuby 9.1 targets Ruby 2.3, treat it the same
|
} else if (engine === 'jruby' && rubyVersion.startsWith('9.1')) { // JRuby 9.1 targets Ruby 2.3, treat it the same
|
||||||
@@ -86,12 +86,12 @@ export async function installBundler(bundlerVersionInput, lockFile, platform, ru
|
|||||||
// Avoid installing a newer Bundler version for head versions as it might not work.
|
// Avoid installing a newer Bundler version for head versions as it might not work.
|
||||||
// For releases, even if they ship with Bundler 2 we install the latest Bundler.
|
// For releases, even if they ship with Bundler 2 we install the latest Bundler.
|
||||||
console.log(`Using Bundler 2 shipped with ${engine}-${rubyVersion}`)
|
console.log(`Using Bundler 2 shipped with ${engine}-${rubyVersion}`)
|
||||||
} else if (engine === 'truffleruby' && !common.isHeadVersion(rubyVersion) && bundlerVersion.startsWith('1')) {
|
} else if (engine.startsWith('truffleruby') && common.isBundler1Default(engine, rubyVersion) && bundlerVersion.startsWith('1')) {
|
||||||
console.log(`Using Bundler 1 shipped with ${engine}`)
|
console.log(`Using Bundler 1 shipped with ${engine}-${rubyVersion}`)
|
||||||
} else {
|
} else {
|
||||||
const gem = path.join(rubyPrefix, 'bin', 'gem')
|
const gem = path.join(rubyPrefix, 'bin', 'gem')
|
||||||
const bundlerVersionConstraint = bundlerVersion.match(/^\d+\.\d+\.\d+/) ? bundlerVersion : `~> ${bundlerVersion}`
|
const bundlerVersionConstraint = /^\d+\.\d+\.\d+/.test(bundlerVersion) ? bundlerVersion : `~> ${bundlerVersion}`
|
||||||
await exec.exec(gem, ['install', 'bundler', '-v', bundlerVersionConstraint, '--no-document'])
|
await exec.exec(gem, ['install', 'bundler', '-v', bundlerVersionConstraint])
|
||||||
}
|
}
|
||||||
|
|
||||||
return bundlerVersion
|
return bundlerVersion
|
||||||
@@ -126,7 +126,7 @@ export async function bundleInstall(gemfile, lockFile, platform, engine, rubyVer
|
|||||||
await exec.exec('bundle', ['lock'], envOptions)
|
await exec.exec('bundle', ['lock'], envOptions)
|
||||||
}
|
}
|
||||||
|
|
||||||
await afterLockFile(lockFile, platform, engine)
|
await afterLockFile(lockFile, platform, engine, rubyVersion)
|
||||||
|
|
||||||
// cache key
|
// cache key
|
||||||
const paths = [cachePath]
|
const paths = [cachePath]
|
||||||
@@ -183,17 +183,21 @@ async function computeBaseKey(platform, engine, version, lockFile, cacheVersion)
|
|||||||
const cacheVersionSuffix = DEFAULT_CACHE_VERSION === cacheVersion ? '' : `-cachever:${cacheVersion}`
|
const cacheVersionSuffix = DEFAULT_CACHE_VERSION === cacheVersion ? '' : `-cachever:${cacheVersion}`
|
||||||
let key = `setup-ruby-bundler-cache-v3-${platform}-${engine}-${version}${cacheVersionSuffix}`
|
let key = `setup-ruby-bundler-cache-v3-${platform}-${engine}-${version}${cacheVersionSuffix}`
|
||||||
|
|
||||||
if (engine !== 'jruby' && common.isHeadVersion(version)) {
|
if (common.isHeadVersion(version)) {
|
||||||
let revision = '';
|
if (engine !== 'jruby') {
|
||||||
await exec.exec('ruby', ['-e', 'print RUBY_REVISION'], {
|
// CRuby dev versions do not change the ABI version when the ABI changes, so use the commit as the ABI version
|
||||||
silent: true,
|
let print_abi = engine === 'ruby' ? 'print RUBY_REVISION' : "print RbConfig::CONFIG['ruby_version']"
|
||||||
listeners: {
|
let abi = ''
|
||||||
stdout: (data) => {
|
await exec.exec('ruby', ['-e', print_abi], {
|
||||||
revision += data.toString();
|
silent: true,
|
||||||
|
listeners: {
|
||||||
|
stdout: (data) => {
|
||||||
|
abi += data.toString();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
});
|
key += `-ABI-${abi}`
|
||||||
key += `-revision-${revision}`
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
key += `-${lockFile}`
|
key += `-${lockFile}`
|
||||||
|
|||||||
@@ -55,13 +55,17 @@ export function isStableVersion(rubyVersion) {
|
|||||||
return /^\d+(\.\d+)*$/.test(rubyVersion)
|
return /^\d+(\.\d+)*$/.test(rubyVersion)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function isBundler1Default(engine, rubyVersion) {
|
||||||
|
return !isBundler2Default(engine, rubyVersion)
|
||||||
|
}
|
||||||
|
|
||||||
export function isBundler2Default(engine, rubyVersion) {
|
export function isBundler2Default(engine, rubyVersion) {
|
||||||
if (engine === 'ruby') {
|
if (engine === 'ruby') {
|
||||||
return isHeadVersion(rubyVersion) || floatVersion(rubyVersion) >= 2.7
|
return floatVersion(rubyVersion) >= 2.7
|
||||||
} else if (engine === 'truffleruby') {
|
} else if (engine.startsWith('truffleruby')) {
|
||||||
return isHeadVersion(rubyVersion) || floatVersion(rubyVersion) >= 21.0
|
return floatVersion(rubyVersion) >= 21.0
|
||||||
} else if (engine === 'jruby') {
|
} else if (engine === 'jruby') {
|
||||||
return isHeadVersion(rubyVersion) || floatVersion(rubyVersion) >= 9.3
|
return floatVersion(rubyVersion) >= 9.3
|
||||||
} else {
|
} else {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
@@ -71,8 +75,10 @@ export function floatVersion(rubyVersion) {
|
|||||||
const match = rubyVersion.match(/^\d+\.\d+/)
|
const match = rubyVersion.match(/^\d+\.\d+/)
|
||||||
if (match) {
|
if (match) {
|
||||||
return parseFloat(match[0])
|
return parseFloat(match[0])
|
||||||
|
} else if (isHeadVersion(rubyVersion)) {
|
||||||
|
return 999.999
|
||||||
} else {
|
} else {
|
||||||
return 0.0
|
throw new Error(`Could not convert version ${rubyVersion} to a float`)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+119
-59
@@ -54,12 +54,12 @@ function readBundledWithFromGemfileLock(lockFile) {
|
|||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
|
||||||
async function afterLockFile(lockFile, platform, engine) {
|
async function afterLockFile(lockFile, platform, engine, rubyVersion) {
|
||||||
if (engine === 'truffleruby' && platform.startsWith('ubuntu-')) {
|
if (engine.startsWith('truffleruby') && common.floatVersion(rubyVersion) < 21.1 && platform.startsWith('ubuntu-')) {
|
||||||
const contents = fs.readFileSync(lockFile, 'utf8')
|
const contents = fs.readFileSync(lockFile, 'utf8')
|
||||||
if (contents.includes('nokogiri')) {
|
if (contents.includes('nokogiri')) {
|
||||||
await common.measure('Installing libxml2-dev libxslt-dev, required to install nokogiri on TruffleRuby', async () =>
|
await common.measure('Installing libxml2-dev libxslt-dev, required to install nokogiri on TruffleRuby < 21.1', async () =>
|
||||||
exec.exec('sudo', ['apt-get', '-yqq', 'install', 'libxml2-dev', 'libxslt-dev'], { silent: true }))
|
exec.exec('sudo', ['apt-get', '-yqq', 'install', 'libxml2-dev', 'libxslt-dev'], { silent: true }))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -85,10 +85,10 @@ async function installBundler(bundlerVersionInput, lockFile, platform, rubyPrefi
|
|||||||
throw new Error(`Cannot parse bundler input: ${bundlerVersion}`)
|
throw new Error(`Cannot parse bundler input: ${bundlerVersion}`)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (engine === 'ruby' && rubyVersion.match(/^2\.[012]/)) {
|
if (engine === 'ruby' && common.floatVersion(rubyVersion) <= 2.2) {
|
||||||
console.log('Bundler 2 requires Ruby 2.3+, using Bundler 1 on Ruby <= 2.2')
|
console.log('Bundler 2 requires Ruby 2.3+, using Bundler 1 on Ruby <= 2.2')
|
||||||
bundlerVersion = '1'
|
bundlerVersion = '1'
|
||||||
} else if (engine === 'ruby' && rubyVersion.match(/^2\.3\.[01]/)) {
|
} else if (engine === 'ruby' && /^2\.3\.[01]/.test(rubyVersion)) {
|
||||||
console.log('Ruby 2.3.0 and 2.3.1 have shipped with an old rubygems that only works with Bundler 1')
|
console.log('Ruby 2.3.0 and 2.3.1 have shipped with an old rubygems that only works with Bundler 1')
|
||||||
bundlerVersion = '1'
|
bundlerVersion = '1'
|
||||||
} else if (engine === 'jruby' && rubyVersion.startsWith('9.1')) { // JRuby 9.1 targets Ruby 2.3, treat it the same
|
} else if (engine === 'jruby' && rubyVersion.startsWith('9.1')) { // JRuby 9.1 targets Ruby 2.3, treat it the same
|
||||||
@@ -100,12 +100,12 @@ async function installBundler(bundlerVersionInput, lockFile, platform, rubyPrefi
|
|||||||
// Avoid installing a newer Bundler version for head versions as it might not work.
|
// Avoid installing a newer Bundler version for head versions as it might not work.
|
||||||
// For releases, even if they ship with Bundler 2 we install the latest Bundler.
|
// For releases, even if they ship with Bundler 2 we install the latest Bundler.
|
||||||
console.log(`Using Bundler 2 shipped with ${engine}-${rubyVersion}`)
|
console.log(`Using Bundler 2 shipped with ${engine}-${rubyVersion}`)
|
||||||
} else if (engine === 'truffleruby' && !common.isHeadVersion(rubyVersion) && bundlerVersion.startsWith('1')) {
|
} else if (engine.startsWith('truffleruby') && common.isBundler1Default(engine, rubyVersion) && bundlerVersion.startsWith('1')) {
|
||||||
console.log(`Using Bundler 1 shipped with ${engine}`)
|
console.log(`Using Bundler 1 shipped with ${engine}-${rubyVersion}`)
|
||||||
} else {
|
} else {
|
||||||
const gem = path.join(rubyPrefix, 'bin', 'gem')
|
const gem = path.join(rubyPrefix, 'bin', 'gem')
|
||||||
const bundlerVersionConstraint = bundlerVersion.match(/^\d+\.\d+\.\d+/) ? bundlerVersion : `~> ${bundlerVersion}`
|
const bundlerVersionConstraint = /^\d+\.\d+\.\d+/.test(bundlerVersion) ? bundlerVersion : `~> ${bundlerVersion}`
|
||||||
await exec.exec(gem, ['install', 'bundler', '-v', bundlerVersionConstraint, '--no-document'])
|
await exec.exec(gem, ['install', 'bundler', '-v', bundlerVersionConstraint])
|
||||||
}
|
}
|
||||||
|
|
||||||
return bundlerVersion
|
return bundlerVersion
|
||||||
@@ -140,7 +140,7 @@ async function bundleInstall(gemfile, lockFile, platform, engine, rubyVersion, b
|
|||||||
await exec.exec('bundle', ['lock'], envOptions)
|
await exec.exec('bundle', ['lock'], envOptions)
|
||||||
}
|
}
|
||||||
|
|
||||||
await afterLockFile(lockFile, platform, engine)
|
await afterLockFile(lockFile, platform, engine, rubyVersion)
|
||||||
|
|
||||||
// cache key
|
// cache key
|
||||||
const paths = [cachePath]
|
const paths = [cachePath]
|
||||||
@@ -197,17 +197,21 @@ async function computeBaseKey(platform, engine, version, lockFile, cacheVersion)
|
|||||||
const cacheVersionSuffix = DEFAULT_CACHE_VERSION === cacheVersion ? '' : `-cachever:${cacheVersion}`
|
const cacheVersionSuffix = DEFAULT_CACHE_VERSION === cacheVersion ? '' : `-cachever:${cacheVersion}`
|
||||||
let key = `setup-ruby-bundler-cache-v3-${platform}-${engine}-${version}${cacheVersionSuffix}`
|
let key = `setup-ruby-bundler-cache-v3-${platform}-${engine}-${version}${cacheVersionSuffix}`
|
||||||
|
|
||||||
if (engine !== 'jruby' && common.isHeadVersion(version)) {
|
if (common.isHeadVersion(version)) {
|
||||||
let revision = '';
|
if (engine !== 'jruby') {
|
||||||
await exec.exec('ruby', ['-e', 'print RUBY_REVISION'], {
|
// CRuby dev versions do not change the ABI version when the ABI changes, so use the commit as the ABI version
|
||||||
silent: true,
|
let print_abi = engine === 'ruby' ? 'print RUBY_REVISION' : "print RbConfig::CONFIG['ruby_version']"
|
||||||
listeners: {
|
let abi = ''
|
||||||
stdout: (data) => {
|
await exec.exec('ruby', ['-e', print_abi], {
|
||||||
revision += data.toString();
|
silent: true,
|
||||||
|
listeners: {
|
||||||
|
stdout: (data) => {
|
||||||
|
abi += data.toString();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
});
|
key += `-ABI-${abi}`
|
||||||
key += `-revision-${revision}`
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
key += `-${lockFile}`
|
key += `-${lockFile}`
|
||||||
@@ -229,6 +233,7 @@ __nccwpck_require__.r(__webpack_exports__);
|
|||||||
/* harmony export */ "measure": () => (/* binding */ measure),
|
/* harmony export */ "measure": () => (/* binding */ measure),
|
||||||
/* harmony export */ "isHeadVersion": () => (/* binding */ isHeadVersion),
|
/* harmony export */ "isHeadVersion": () => (/* binding */ isHeadVersion),
|
||||||
/* harmony export */ "isStableVersion": () => (/* binding */ isStableVersion),
|
/* harmony export */ "isStableVersion": () => (/* binding */ isStableVersion),
|
||||||
|
/* harmony export */ "isBundler1Default": () => (/* binding */ isBundler1Default),
|
||||||
/* harmony export */ "isBundler2Default": () => (/* binding */ isBundler2Default),
|
/* harmony export */ "isBundler2Default": () => (/* binding */ isBundler2Default),
|
||||||
/* harmony export */ "floatVersion": () => (/* binding */ floatVersion),
|
/* harmony export */ "floatVersion": () => (/* binding */ floatVersion),
|
||||||
/* harmony export */ "hashFile": () => (/* binding */ hashFile),
|
/* harmony export */ "hashFile": () => (/* binding */ hashFile),
|
||||||
@@ -296,13 +301,17 @@ function isStableVersion(rubyVersion) {
|
|||||||
return /^\d+(\.\d+)*$/.test(rubyVersion)
|
return /^\d+(\.\d+)*$/.test(rubyVersion)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function isBundler1Default(engine, rubyVersion) {
|
||||||
|
return !isBundler2Default(engine, rubyVersion)
|
||||||
|
}
|
||||||
|
|
||||||
function isBundler2Default(engine, rubyVersion) {
|
function isBundler2Default(engine, rubyVersion) {
|
||||||
if (engine === 'ruby') {
|
if (engine === 'ruby') {
|
||||||
return isHeadVersion(rubyVersion) || floatVersion(rubyVersion) >= 2.7
|
return floatVersion(rubyVersion) >= 2.7
|
||||||
} else if (engine === 'truffleruby') {
|
} else if (engine.startsWith('truffleruby')) {
|
||||||
return isHeadVersion(rubyVersion) || floatVersion(rubyVersion) >= 21.0
|
return floatVersion(rubyVersion) >= 21.0
|
||||||
} else if (engine === 'jruby') {
|
} else if (engine === 'jruby') {
|
||||||
return isHeadVersion(rubyVersion) || floatVersion(rubyVersion) >= 9.3
|
return floatVersion(rubyVersion) >= 9.3
|
||||||
} else {
|
} else {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
@@ -312,8 +321,10 @@ function floatVersion(rubyVersion) {
|
|||||||
const match = rubyVersion.match(/^\d+\.\d+/)
|
const match = rubyVersion.match(/^\d+\.\d+/)
|
||||||
if (match) {
|
if (match) {
|
||||||
return parseFloat(match[0])
|
return parseFloat(match[0])
|
||||||
|
} else if (isHeadVersion(rubyVersion)) {
|
||||||
|
return 999.999
|
||||||
} else {
|
} else {
|
||||||
return 0.0
|
throw new Error(`Could not convert version ${rubyVersion} to a float`)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -525,7 +536,7 @@ function restoreCache(paths, primaryKey, restoreKeys, options) {
|
|||||||
if (core.isDebug()) {
|
if (core.isDebug()) {
|
||||||
yield tar_1.listTar(archivePath, compressionMethod);
|
yield tar_1.listTar(archivePath, compressionMethod);
|
||||||
}
|
}
|
||||||
const archiveFileSize = utils.getArchiveFileSizeIsBytes(archivePath);
|
const archiveFileSize = utils.getArchiveFileSizeInBytes(archivePath);
|
||||||
core.info(`Cache Size: ~${Math.round(archiveFileSize / (1024 * 1024))} MB (${archiveFileSize} B)`);
|
core.info(`Cache Size: ~${Math.round(archiveFileSize / (1024 * 1024))} MB (${archiveFileSize} B)`);
|
||||||
yield tar_1.extractTar(archivePath, compressionMethod);
|
yield tar_1.extractTar(archivePath, compressionMethod);
|
||||||
core.info('Cache restored successfully');
|
core.info('Cache restored successfully');
|
||||||
@@ -570,18 +581,29 @@ function saveCache(paths, key, options) {
|
|||||||
const archiveFolder = yield utils.createTempDirectory();
|
const archiveFolder = yield utils.createTempDirectory();
|
||||||
const archivePath = path.join(archiveFolder, utils.getCacheFileName(compressionMethod));
|
const archivePath = path.join(archiveFolder, utils.getCacheFileName(compressionMethod));
|
||||||
core.debug(`Archive Path: ${archivePath}`);
|
core.debug(`Archive Path: ${archivePath}`);
|
||||||
yield tar_1.createTar(archiveFolder, cachePaths, compressionMethod);
|
try {
|
||||||
if (core.isDebug()) {
|
yield tar_1.createTar(archiveFolder, cachePaths, compressionMethod);
|
||||||
yield tar_1.listTar(archivePath, compressionMethod);
|
if (core.isDebug()) {
|
||||||
|
yield tar_1.listTar(archivePath, compressionMethod);
|
||||||
|
}
|
||||||
|
const fileSizeLimit = 10 * 1024 * 1024 * 1024; // 10GB per repo limit
|
||||||
|
const archiveFileSize = utils.getArchiveFileSizeInBytes(archivePath);
|
||||||
|
core.debug(`File Size: ${archiveFileSize}`);
|
||||||
|
if (archiveFileSize > fileSizeLimit) {
|
||||||
|
throw new Error(`Cache size of ~${Math.round(archiveFileSize / (1024 * 1024))} MB (${archiveFileSize} B) is over the 10GB limit, not saving cache.`);
|
||||||
|
}
|
||||||
|
core.debug(`Saving Cache (ID: ${cacheId})`);
|
||||||
|
yield cacheHttpClient.saveCache(cacheId, archivePath, options);
|
||||||
}
|
}
|
||||||
const fileSizeLimit = 5 * 1024 * 1024 * 1024; // 5GB per repo limit
|
finally {
|
||||||
const archiveFileSize = utils.getArchiveFileSizeIsBytes(archivePath);
|
// Try to delete the archive to save space
|
||||||
core.debug(`File Size: ${archiveFileSize}`);
|
try {
|
||||||
if (archiveFileSize > fileSizeLimit) {
|
yield utils.unlinkFile(archivePath);
|
||||||
throw new Error(`Cache size of ~${Math.round(archiveFileSize / (1024 * 1024))} MB (${archiveFileSize} B) is over the 5GB limit, not saving cache.`);
|
}
|
||||||
|
catch (error) {
|
||||||
|
core.debug(`Failed to delete archive: ${error}`);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
core.debug(`Saving Cache (ID: ${cacheId})`);
|
|
||||||
yield cacheHttpClient.saveCache(cacheId, archivePath, options);
|
|
||||||
return cacheId;
|
return cacheId;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -749,7 +771,7 @@ function uploadChunk(httpClient, resourceUrl, openStream, start, end) {
|
|||||||
function uploadFile(httpClient, cacheId, archivePath, options) {
|
function uploadFile(httpClient, cacheId, archivePath, options) {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
// Upload Chunks
|
// Upload Chunks
|
||||||
const fileSize = fs.statSync(archivePath).size;
|
const fileSize = utils.getArchiveFileSizeInBytes(archivePath);
|
||||||
const resourceUrl = getCacheApiUrl(`caches/${cacheId.toString()}`);
|
const resourceUrl = getCacheApiUrl(`caches/${cacheId.toString()}`);
|
||||||
const fd = fs.openSync(archivePath, 'r');
|
const fd = fs.openSync(archivePath, 'r');
|
||||||
const uploadOptions = options_1.getUploadOptions(options);
|
const uploadOptions = options_1.getUploadOptions(options);
|
||||||
@@ -799,7 +821,7 @@ function saveCache(cacheId, archivePath, options) {
|
|||||||
yield uploadFile(httpClient, cacheId, archivePath, options);
|
yield uploadFile(httpClient, cacheId, archivePath, options);
|
||||||
// Commit Cache
|
// Commit Cache
|
||||||
core.debug('Commiting cache');
|
core.debug('Commiting cache');
|
||||||
const cacheSize = utils.getArchiveFileSizeIsBytes(archivePath);
|
const cacheSize = utils.getArchiveFileSizeInBytes(archivePath);
|
||||||
core.info(`Cache Size: ~${Math.round(cacheSize / (1024 * 1024))} MB (${cacheSize} B)`);
|
core.info(`Cache Size: ~${Math.round(cacheSize / (1024 * 1024))} MB (${cacheSize} B)`);
|
||||||
const commitCacheResponse = yield commitCache(httpClient, cacheId, cacheSize);
|
const commitCacheResponse = yield commitCache(httpClient, cacheId, cacheSize);
|
||||||
if (!requestUtils_1.isSuccessStatusCode(commitCacheResponse.statusCode)) {
|
if (!requestUtils_1.isSuccessStatusCode(commitCacheResponse.statusCode)) {
|
||||||
@@ -879,10 +901,10 @@ function createTempDirectory() {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
exports.createTempDirectory = createTempDirectory;
|
exports.createTempDirectory = createTempDirectory;
|
||||||
function getArchiveFileSizeIsBytes(filePath) {
|
function getArchiveFileSizeInBytes(filePath) {
|
||||||
return fs.statSync(filePath).size;
|
return fs.statSync(filePath).size;
|
||||||
}
|
}
|
||||||
exports.getArchiveFileSizeIsBytes = getArchiveFileSizeIsBytes;
|
exports.getArchiveFileSizeInBytes = getArchiveFileSizeInBytes;
|
||||||
function resolvePaths(patterns) {
|
function resolvePaths(patterns) {
|
||||||
var e_1, _a;
|
var e_1, _a;
|
||||||
var _b;
|
var _b;
|
||||||
@@ -1187,7 +1209,7 @@ function downloadCacheHttpClient(archiveLocation, archivePath) {
|
|||||||
const contentLengthHeader = downloadResponse.message.headers['content-length'];
|
const contentLengthHeader = downloadResponse.message.headers['content-length'];
|
||||||
if (contentLengthHeader) {
|
if (contentLengthHeader) {
|
||||||
const expectedLength = parseInt(contentLengthHeader);
|
const expectedLength = parseInt(contentLengthHeader);
|
||||||
const actualLength = utils.getArchiveFileSizeIsBytes(archivePath);
|
const actualLength = utils.getArchiveFileSizeInBytes(archivePath);
|
||||||
if (actualLength !== expectedLength) {
|
if (actualLength !== expectedLength) {
|
||||||
throw new Error(`Incomplete download. Expected file size: ${expectedLength}, actual file size: ${actualLength}`);
|
throw new Error(`Incomplete download. Expected file size: ${expectedLength}, actual file size: ${actualLength}`);
|
||||||
}
|
}
|
||||||
@@ -58756,26 +58778,33 @@ __nccwpck_require__.r(__webpack_exports__);
|
|||||||
function getVersions(platform) {
|
function getVersions(platform) {
|
||||||
const versions = {
|
const versions = {
|
||||||
"ruby": [
|
"ruby": [
|
||||||
|
"1.9.3-p551",
|
||||||
"2.0.0-p648",
|
"2.0.0-p648",
|
||||||
"2.1.9",
|
"2.1.9",
|
||||||
"2.2.10",
|
"2.2.10",
|
||||||
"2.3.0", "2.3.1", "2.3.2", "2.3.3", "2.3.4", "2.3.5", "2.3.6", "2.3.7", "2.3.8",
|
"2.3.0", "2.3.1", "2.3.2", "2.3.3", "2.3.4", "2.3.5", "2.3.6", "2.3.7", "2.3.8",
|
||||||
"2.4.0", "2.4.1", "2.4.2", "2.4.3", "2.4.4", "2.4.5", "2.4.6", "2.4.7", "2.4.9", "2.4.10",
|
"2.4.0", "2.4.1", "2.4.2", "2.4.3", "2.4.4", "2.4.5", "2.4.6", "2.4.7", "2.4.9", "2.4.10",
|
||||||
"2.5.0", "2.5.1", "2.5.2", "2.5.3", "2.5.4", "2.5.5", "2.5.6", "2.5.7", "2.5.8", "2.5.9",
|
"2.5.0", "2.5.1", "2.5.2", "2.5.3", "2.5.4", "2.5.5", "2.5.6", "2.5.7", "2.5.8", "2.5.9",
|
||||||
"2.6.0", "2.6.1", "2.6.2", "2.6.3", "2.6.4", "2.6.5", "2.6.6", "2.6.7", "2.6.8",
|
"2.6.0", "2.6.1", "2.6.2", "2.6.3", "2.6.4", "2.6.5", "2.6.6", "2.6.7", "2.6.8", "2.6.9",
|
||||||
"2.7.0", "2.7.1", "2.7.2", "2.7.3", "2.7.4",
|
"2.7.0", "2.7.1", "2.7.2", "2.7.3", "2.7.4", "2.7.5",
|
||||||
"3.0.0-preview1", "3.0.0-preview2", "3.0.0-rc1", "3.0.0", "3.0.1", "3.0.2",
|
"3.0.0-preview1", "3.0.0-preview2", "3.0.0-rc1", "3.0.0", "3.0.1", "3.0.2", "3.0.3",
|
||||||
"head", "debug",
|
"3.1.0-preview1",
|
||||||
|
"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.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.3.0.0", "9.3.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.0.0", "21.1.0", "21.2.0", "21.2.0.1", "21.3.0",
|
||||||
|
"head"
|
||||||
|
],
|
||||||
|
"truffleruby+graalvm": [
|
||||||
|
"21.2.0", "21.3.0",
|
||||||
"head"
|
"head"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@@ -58832,19 +58861,43 @@ async function install(platform, engine, version) {
|
|||||||
common.setupPath([path.join(rubyPrefix, 'bin')])
|
common.setupPath([path.join(rubyPrefix, 'bin')])
|
||||||
|
|
||||||
if (!inToolCache) {
|
if (!inToolCache) {
|
||||||
await downloadAndExtract(platform, engine, version, rubyPrefix);
|
await preparePrefix(rubyPrefix)
|
||||||
|
if (engine === 'truffleruby+graalvm') {
|
||||||
|
await installWithRubyBuild(engine, version, rubyPrefix)
|
||||||
|
} else {
|
||||||
|
await downloadAndExtract(platform, engine, version, rubyPrefix)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return rubyPrefix
|
return rubyPrefix
|
||||||
}
|
}
|
||||||
|
|
||||||
async function downloadAndExtract(platform, engine, version, rubyPrefix) {
|
async function preparePrefix(rubyPrefix) {
|
||||||
const parentDir = path.dirname(rubyPrefix)
|
const parentDir = path.dirname(rubyPrefix)
|
||||||
|
|
||||||
await io.rmRF(rubyPrefix)
|
await io.rmRF(rubyPrefix)
|
||||||
if (!(fs.existsSync(parentDir) && fs.statSync(parentDir).isDirectory())) {
|
if (!(fs.existsSync(parentDir) && fs.statSync(parentDir).isDirectory())) {
|
||||||
await io.mkdirP(parentDir)
|
await io.mkdirP(parentDir)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async function installWithRubyBuild(engine, version, rubyPrefix) {
|
||||||
|
const tmp = process.env['RUNNER_TEMP'] || os.tmpdir()
|
||||||
|
const rubyBuildDir = path.join(tmp, 'ruby-build-for-setup-ruby')
|
||||||
|
await common.measure('Cloning ruby-build', async () => {
|
||||||
|
await exec.exec('git', ['clone', 'https://github.com/rbenv/ruby-build.git', rubyBuildDir])
|
||||||
|
})
|
||||||
|
|
||||||
|
const rubyName = `${engine}-${version === 'head' ? 'dev' : version}`
|
||||||
|
await common.measure(`Installing ${engine}-${version} with ruby-build`, async () => {
|
||||||
|
await exec.exec(`${rubyBuildDir}/bin/ruby-build`, [rubyName, rubyPrefix])
|
||||||
|
})
|
||||||
|
|
||||||
|
await io.rmRF(rubyBuildDir)
|
||||||
|
}
|
||||||
|
|
||||||
|
async function downloadAndExtract(platform, engine, version, rubyPrefix) {
|
||||||
|
const parentDir = path.dirname(rubyPrefix)
|
||||||
|
|
||||||
const downloadPath = await common.measure('Downloading Ruby', async () => {
|
const downloadPath = await common.measure('Downloading Ruby', async () => {
|
||||||
const url = getDownloadURL(platform, engine, version)
|
const url = getDownloadURL(platform, engine, version)
|
||||||
@@ -58928,14 +58981,17 @@ const versions = {
|
|||||||
"2.6.6": "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-2.6.6-2/rubyinstaller-2.6.6-2-x64.7z",
|
"2.6.6": "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-2.6.6-2/rubyinstaller-2.6.6-2-x64.7z",
|
||||||
"2.6.7": "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-2.6.7-1/rubyinstaller-2.6.7-1-x64.7z",
|
"2.6.7": "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-2.6.7-1/rubyinstaller-2.6.7-1-x64.7z",
|
||||||
"2.6.8": "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-2.6.8-1/rubyinstaller-2.6.8-1-x64.7z",
|
"2.6.8": "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-2.6.8-1/rubyinstaller-2.6.8-1-x64.7z",
|
||||||
|
"2.6.9": "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-2.6.9-1/rubyinstaller-2.6.9-1-x64.7z",
|
||||||
"2.7.0": "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-2.7.0-1/rubyinstaller-2.7.0-1-x64.7z",
|
"2.7.0": "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-2.7.0-1/rubyinstaller-2.7.0-1-x64.7z",
|
||||||
"2.7.1": "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-2.7.1-1/rubyinstaller-2.7.1-1-x64.7z",
|
"2.7.1": "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-2.7.1-1/rubyinstaller-2.7.1-1-x64.7z",
|
||||||
"2.7.2": "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-2.7.2-1/rubyinstaller-2.7.2-1-x64.7z",
|
"2.7.2": "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-2.7.2-1/rubyinstaller-2.7.2-1-x64.7z",
|
||||||
"2.7.3": "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-2.7.3-1/rubyinstaller-2.7.3-1-x64.7z",
|
"2.7.3": "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-2.7.3-1/rubyinstaller-2.7.3-1-x64.7z",
|
||||||
"2.7.4": "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-2.7.4-1/rubyinstaller-2.7.4-1-x64.7z",
|
"2.7.4": "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-2.7.4-1/rubyinstaller-2.7.4-1-x64.7z",
|
||||||
|
"2.7.5": "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-2.7.5-1/rubyinstaller-2.7.5-1-x64.7z",
|
||||||
"3.0.0": "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-3.0.0-1/rubyinstaller-3.0.0-1-x64.7z",
|
"3.0.0": "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-3.0.0-1/rubyinstaller-3.0.0-1-x64.7z",
|
||||||
"3.0.1": "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-3.0.1-1/rubyinstaller-3.0.1-1-x64.7z",
|
"3.0.1": "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-3.0.1-1/rubyinstaller-3.0.1-1-x64.7z",
|
||||||
"3.0.2": "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-3.0.2-1/rubyinstaller-3.0.2-1-x64.7z",
|
"3.0.2": "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-3.0.2-1/rubyinstaller-3.0.2-1-x64.7z",
|
||||||
|
"3.0.3": "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-3.0.3-1/rubyinstaller-3.0.3-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"
|
||||||
@@ -59038,7 +59094,7 @@ async function downloadAndExtract(engine, version, url, base, rubyPrefix) {
|
|||||||
async function setupMingw(version) {
|
async function setupMingw(version) {
|
||||||
core.exportVariable('MAKE', 'make.exe')
|
core.exportVariable('MAKE', 'make.exe')
|
||||||
|
|
||||||
if (version.match(/^2\.[0123]/)) {
|
if (common.floatVersion(version) <= 2.3) {
|
||||||
core.exportVariable('SSL_CERT_FILE', certFile)
|
core.exportVariable('SSL_CERT_FILE', certFile)
|
||||||
await common.measure('Installing MSYS', async () => installMSYS(version))
|
await common.measure('Installing MSYS', async () => installMSYS(version))
|
||||||
return msysPathEntries
|
return msysPathEntries
|
||||||
@@ -59090,7 +59146,7 @@ function addVCVARSEnv() {
|
|||||||
let newEnv = new Map()
|
let newEnv = new Map()
|
||||||
let cmd = `cmd.exe /c "${vcVars} && set"`
|
let cmd = `cmd.exe /c "${vcVars} && set"`
|
||||||
let newSet = cp.execSync(cmd).toString().trim().split(/\r?\n/)
|
let newSet = cp.execSync(cmd).toString().trim().split(/\r?\n/)
|
||||||
newSet = newSet.filter(line => line.match(/\S=\S/))
|
newSet = newSet.filter(line => /\S=\S/.test(line))
|
||||||
newSet.forEach(s => {
|
newSet.forEach(s => {
|
||||||
let [k,v] = common.partition(s, '=')
|
let [k,v] = common.partition(s, '=')
|
||||||
newEnv.set(k,v)
|
newEnv.set(k,v)
|
||||||
@@ -59420,7 +59476,7 @@ async function setupRuby(options = {}) {
|
|||||||
const engineVersions = installer.getAvailableVersions(platform, engine)
|
const engineVersions = installer.getAvailableVersions(platform, engine)
|
||||||
const version = validateRubyEngineAndVersion(platform, engineVersions, engine, parsedVersion)
|
const version = validateRubyEngineAndVersion(platform, engineVersions, engine, parsedVersion)
|
||||||
|
|
||||||
createGemRC()
|
createGemRC(engine, version)
|
||||||
envPreInstall()
|
envPreInstall()
|
||||||
|
|
||||||
const rubyPrefix = await installer.install(platform, engine, version)
|
const rubyPrefix = await installer.install(platform, engine, version)
|
||||||
@@ -59436,11 +59492,11 @@ async function setupRuby(options = {}) {
|
|||||||
const [gemfile, lockFile] = bundler.detectGemfiles()
|
const [gemfile, lockFile] = bundler.detectGemfiles()
|
||||||
|
|
||||||
const bundlerVersion = await common.measure('Installing Bundler', async () =>
|
const bundlerVersion = await common.measure('Installing Bundler', async () =>
|
||||||
bundler.installBundler(inputs['bundler'], lockFile, platform, rubyPrefix, engine, version))
|
bundler.installBundler(inputs['bundler'], lockFile, platform, rubyPrefix, engine, version))
|
||||||
|
|
||||||
if (inputs['bundler-cache'] === 'true') {
|
if (inputs['bundler-cache'] === 'true') {
|
||||||
await common.measure('bundle install', async () =>
|
await common.measure('bundle install', async () =>
|
||||||
bundler.bundleInstall(gemfile, lockFile, platform, engine, version, bundlerVersion, inputs['cache-version']))
|
bundler.bundleInstall(gemfile, lockFile, platform, engine, version, bundlerVersion, inputs['cache-version']))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -59463,13 +59519,13 @@ function parseRubyEngineAndVersion(rubyVersion) {
|
|||||||
console.log(`Using ${rubyVersion} as input from file .ruby-version`)
|
console.log(`Using ${rubyVersion} as input from file .ruby-version`)
|
||||||
} else if (rubyVersion === '.tool-versions') { // Read from .tool-versions
|
} else if (rubyVersion === '.tool-versions') { // Read from .tool-versions
|
||||||
const toolVersions = fs.readFileSync('.tool-versions', 'utf8').trim()
|
const toolVersions = fs.readFileSync('.tool-versions', 'utf8').trim()
|
||||||
const rubyLine = toolVersions.split(/\r?\n/).filter(e => e.match(/^ruby\s/))[0]
|
const rubyLine = toolVersions.split(/\r?\n/).filter(e => /^ruby\s/.test(e))[0]
|
||||||
rubyVersion = rubyLine.match(/^ruby\s+(.+)$/)[1]
|
rubyVersion = rubyLine.match(/^ruby\s+(.+)$/)[1]
|
||||||
console.log(`Using ${rubyVersion} as input from file .tool-versions`)
|
console.log(`Using ${rubyVersion} as input from file .tool-versions`)
|
||||||
}
|
}
|
||||||
|
|
||||||
let engine, version
|
let engine, version
|
||||||
if (rubyVersion.match(/^(\d+)/) || common.isHeadVersion(rubyVersion)) { // X.Y.Z => ruby-X.Y.Z
|
if (/^(\d+)/.test(rubyVersion) || common.isHeadVersion(rubyVersion)) { // X.Y.Z => ruby-X.Y.Z
|
||||||
engine = 'ruby'
|
engine = 'ruby'
|
||||||
version = rubyVersion
|
version = rubyVersion
|
||||||
} else if (!rubyVersion.includes('-')) { // myruby -> myruby-stableVersion
|
} else if (!rubyVersion.includes('-')) { // myruby -> myruby-stableVersion
|
||||||
@@ -59510,10 +59566,14 @@ function validateRubyEngineAndVersion(platform, engineVersions, engine, parsedVe
|
|||||||
return version
|
return version
|
||||||
}
|
}
|
||||||
|
|
||||||
function createGemRC() {
|
function createGemRC(engine, version) {
|
||||||
const gemrc = path.join(os.homedir(), '.gemrc')
|
const gemrc = path.join(os.homedir(), '.gemrc')
|
||||||
if (!fs.existsSync(gemrc)) {
|
if (!fs.existsSync(gemrc)) {
|
||||||
fs.writeFileSync(gemrc, `gem: --no-document${os.EOL}`)
|
if (engine === 'ruby' && common.floatVersion(version) < 2.0) {
|
||||||
|
fs.writeFileSync(gemrc, `install: --no-rdoc --no-ri${os.EOL}update: --no-rdoc --no-ri${os.EOL}`)
|
||||||
|
} else {
|
||||||
|
fs.writeFileSync(gemrc, `gem: --no-document${os.EOL}`)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ export async function setupRuby(options = {}) {
|
|||||||
const engineVersions = installer.getAvailableVersions(platform, engine)
|
const engineVersions = installer.getAvailableVersions(platform, engine)
|
||||||
const version = validateRubyEngineAndVersion(platform, engineVersions, engine, parsedVersion)
|
const version = validateRubyEngineAndVersion(platform, engineVersions, engine, parsedVersion)
|
||||||
|
|
||||||
createGemRC()
|
createGemRC(engine, version)
|
||||||
envPreInstall()
|
envPreInstall()
|
||||||
|
|
||||||
const rubyPrefix = await installer.install(platform, engine, version)
|
const rubyPrefix = await installer.install(platform, engine, version)
|
||||||
@@ -64,11 +64,11 @@ export async function setupRuby(options = {}) {
|
|||||||
const [gemfile, lockFile] = bundler.detectGemfiles()
|
const [gemfile, lockFile] = bundler.detectGemfiles()
|
||||||
|
|
||||||
const bundlerVersion = await common.measure('Installing Bundler', async () =>
|
const bundlerVersion = await common.measure('Installing Bundler', async () =>
|
||||||
bundler.installBundler(inputs['bundler'], lockFile, platform, rubyPrefix, engine, version))
|
bundler.installBundler(inputs['bundler'], lockFile, platform, rubyPrefix, engine, version))
|
||||||
|
|
||||||
if (inputs['bundler-cache'] === 'true') {
|
if (inputs['bundler-cache'] === 'true') {
|
||||||
await common.measure('bundle install', async () =>
|
await common.measure('bundle install', async () =>
|
||||||
bundler.bundleInstall(gemfile, lockFile, platform, engine, version, bundlerVersion, inputs['cache-version']))
|
bundler.bundleInstall(gemfile, lockFile, platform, engine, version, bundlerVersion, inputs['cache-version']))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -91,13 +91,13 @@ function parseRubyEngineAndVersion(rubyVersion) {
|
|||||||
console.log(`Using ${rubyVersion} as input from file .ruby-version`)
|
console.log(`Using ${rubyVersion} as input from file .ruby-version`)
|
||||||
} else if (rubyVersion === '.tool-versions') { // Read from .tool-versions
|
} else if (rubyVersion === '.tool-versions') { // Read from .tool-versions
|
||||||
const toolVersions = fs.readFileSync('.tool-versions', 'utf8').trim()
|
const toolVersions = fs.readFileSync('.tool-versions', 'utf8').trim()
|
||||||
const rubyLine = toolVersions.split(/\r?\n/).filter(e => e.match(/^ruby\s/))[0]
|
const rubyLine = toolVersions.split(/\r?\n/).filter(e => /^ruby\s/.test(e))[0]
|
||||||
rubyVersion = rubyLine.match(/^ruby\s+(.+)$/)[1]
|
rubyVersion = rubyLine.match(/^ruby\s+(.+)$/)[1]
|
||||||
console.log(`Using ${rubyVersion} as input from file .tool-versions`)
|
console.log(`Using ${rubyVersion} as input from file .tool-versions`)
|
||||||
}
|
}
|
||||||
|
|
||||||
let engine, version
|
let engine, version
|
||||||
if (rubyVersion.match(/^(\d+)/) || common.isHeadVersion(rubyVersion)) { // X.Y.Z => ruby-X.Y.Z
|
if (/^(\d+)/.test(rubyVersion) || common.isHeadVersion(rubyVersion)) { // X.Y.Z => ruby-X.Y.Z
|
||||||
engine = 'ruby'
|
engine = 'ruby'
|
||||||
version = rubyVersion
|
version = rubyVersion
|
||||||
} else if (!rubyVersion.includes('-')) { // myruby -> myruby-stableVersion
|
} else if (!rubyVersion.includes('-')) { // myruby -> myruby-stableVersion
|
||||||
@@ -138,10 +138,14 @@ function validateRubyEngineAndVersion(platform, engineVersions, engine, parsedVe
|
|||||||
return version
|
return version
|
||||||
}
|
}
|
||||||
|
|
||||||
function createGemRC() {
|
function createGemRC(engine, version) {
|
||||||
const gemrc = path.join(os.homedir(), '.gemrc')
|
const gemrc = path.join(os.homedir(), '.gemrc')
|
||||||
if (!fs.existsSync(gemrc)) {
|
if (!fs.existsSync(gemrc)) {
|
||||||
fs.writeFileSync(gemrc, `gem: --no-document${os.EOL}`)
|
if (engine === 'ruby' && common.floatVersion(version) < 2.0) {
|
||||||
|
fs.writeFileSync(gemrc, `install: --no-rdoc --no-ri${os.EOL}update: --no-rdoc --no-ri${os.EOL}`)
|
||||||
|
} else {
|
||||||
|
fs.writeFileSync(gemrc, `gem: --no-document${os.EOL}`)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -22,7 +22,7 @@
|
|||||||
},
|
},
|
||||||
"homepage": "https://github.com/ruby/setup-ruby",
|
"homepage": "https://github.com/ruby/setup-ruby",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@actions/cache": "^1.0.7",
|
"@actions/cache": "^1.0.8",
|
||||||
"@actions/core": "^1.4.0",
|
"@actions/core": "^1.4.0",
|
||||||
"@actions/exec": "^1.1.0",
|
"@actions/exec": "^1.1.0",
|
||||||
"@actions/io": "^1.1.1",
|
"@actions/io": "^1.1.1",
|
||||||
|
|||||||
@@ -1,26 +1,33 @@
|
|||||||
export function getVersions(platform) {
|
export function getVersions(platform) {
|
||||||
const versions = {
|
const versions = {
|
||||||
"ruby": [
|
"ruby": [
|
||||||
|
"1.9.3-p551",
|
||||||
"2.0.0-p648",
|
"2.0.0-p648",
|
||||||
"2.1.9",
|
"2.1.9",
|
||||||
"2.2.10",
|
"2.2.10",
|
||||||
"2.3.0", "2.3.1", "2.3.2", "2.3.3", "2.3.4", "2.3.5", "2.3.6", "2.3.7", "2.3.8",
|
"2.3.0", "2.3.1", "2.3.2", "2.3.3", "2.3.4", "2.3.5", "2.3.6", "2.3.7", "2.3.8",
|
||||||
"2.4.0", "2.4.1", "2.4.2", "2.4.3", "2.4.4", "2.4.5", "2.4.6", "2.4.7", "2.4.9", "2.4.10",
|
"2.4.0", "2.4.1", "2.4.2", "2.4.3", "2.4.4", "2.4.5", "2.4.6", "2.4.7", "2.4.9", "2.4.10",
|
||||||
"2.5.0", "2.5.1", "2.5.2", "2.5.3", "2.5.4", "2.5.5", "2.5.6", "2.5.7", "2.5.8", "2.5.9",
|
"2.5.0", "2.5.1", "2.5.2", "2.5.3", "2.5.4", "2.5.5", "2.5.6", "2.5.7", "2.5.8", "2.5.9",
|
||||||
"2.6.0", "2.6.1", "2.6.2", "2.6.3", "2.6.4", "2.6.5", "2.6.6", "2.6.7", "2.6.8",
|
"2.6.0", "2.6.1", "2.6.2", "2.6.3", "2.6.4", "2.6.5", "2.6.6", "2.6.7", "2.6.8", "2.6.9",
|
||||||
"2.7.0", "2.7.1", "2.7.2", "2.7.3", "2.7.4",
|
"2.7.0", "2.7.1", "2.7.2", "2.7.3", "2.7.4", "2.7.5",
|
||||||
"3.0.0-preview1", "3.0.0-preview2", "3.0.0-rc1", "3.0.0", "3.0.1", "3.0.2",
|
"3.0.0-preview1", "3.0.0-preview2", "3.0.0-rc1", "3.0.0", "3.0.1", "3.0.2", "3.0.3",
|
||||||
"head", "debug",
|
"3.1.0-preview1",
|
||||||
|
"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.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.3.0.0", "9.3.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.0.0", "21.1.0", "21.2.0", "21.2.0.1", "21.3.0",
|
||||||
|
"head"
|
||||||
|
],
|
||||||
|
"truffleruby+graalvm": [
|
||||||
|
"21.2.0", "21.3.0",
|
||||||
"head"
|
"head"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
+26
-2
@@ -35,19 +35,43 @@ export async function install(platform, engine, version) {
|
|||||||
common.setupPath([path.join(rubyPrefix, 'bin')])
|
common.setupPath([path.join(rubyPrefix, 'bin')])
|
||||||
|
|
||||||
if (!inToolCache) {
|
if (!inToolCache) {
|
||||||
await downloadAndExtract(platform, engine, version, rubyPrefix);
|
await preparePrefix(rubyPrefix)
|
||||||
|
if (engine === 'truffleruby+graalvm') {
|
||||||
|
await installWithRubyBuild(engine, version, rubyPrefix)
|
||||||
|
} else {
|
||||||
|
await downloadAndExtract(platform, engine, version, rubyPrefix)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return rubyPrefix
|
return rubyPrefix
|
||||||
}
|
}
|
||||||
|
|
||||||
async function downloadAndExtract(platform, engine, version, rubyPrefix) {
|
async function preparePrefix(rubyPrefix) {
|
||||||
const parentDir = path.dirname(rubyPrefix)
|
const parentDir = path.dirname(rubyPrefix)
|
||||||
|
|
||||||
await io.rmRF(rubyPrefix)
|
await io.rmRF(rubyPrefix)
|
||||||
if (!(fs.existsSync(parentDir) && fs.statSync(parentDir).isDirectory())) {
|
if (!(fs.existsSync(parentDir) && fs.statSync(parentDir).isDirectory())) {
|
||||||
await io.mkdirP(parentDir)
|
await io.mkdirP(parentDir)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async function installWithRubyBuild(engine, version, rubyPrefix) {
|
||||||
|
const tmp = process.env['RUNNER_TEMP'] || os.tmpdir()
|
||||||
|
const rubyBuildDir = path.join(tmp, 'ruby-build-for-setup-ruby')
|
||||||
|
await common.measure('Cloning ruby-build', async () => {
|
||||||
|
await exec.exec('git', ['clone', 'https://github.com/rbenv/ruby-build.git', rubyBuildDir])
|
||||||
|
})
|
||||||
|
|
||||||
|
const rubyName = `${engine}-${version === 'head' ? 'dev' : version}`
|
||||||
|
await common.measure(`Installing ${engine}-${version} with ruby-build`, async () => {
|
||||||
|
await exec.exec(`${rubyBuildDir}/bin/ruby-build`, [rubyName, rubyPrefix])
|
||||||
|
})
|
||||||
|
|
||||||
|
await io.rmRF(rubyBuildDir)
|
||||||
|
}
|
||||||
|
|
||||||
|
async function downloadAndExtract(platform, engine, version, rubyPrefix) {
|
||||||
|
const parentDir = path.dirname(rubyPrefix)
|
||||||
|
|
||||||
const downloadPath = await common.measure('Downloading Ruby', async () => {
|
const downloadPath = await common.measure('Downloading Ruby', async () => {
|
||||||
const url = getDownloadURL(platform, engine, version)
|
const url = getDownloadURL(platform, engine, version)
|
||||||
|
|||||||
@@ -31,14 +31,17 @@ export const versions = {
|
|||||||
"2.6.6": "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-2.6.6-2/rubyinstaller-2.6.6-2-x64.7z",
|
"2.6.6": "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-2.6.6-2/rubyinstaller-2.6.6-2-x64.7z",
|
||||||
"2.6.7": "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-2.6.7-1/rubyinstaller-2.6.7-1-x64.7z",
|
"2.6.7": "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-2.6.7-1/rubyinstaller-2.6.7-1-x64.7z",
|
||||||
"2.6.8": "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-2.6.8-1/rubyinstaller-2.6.8-1-x64.7z",
|
"2.6.8": "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-2.6.8-1/rubyinstaller-2.6.8-1-x64.7z",
|
||||||
|
"2.6.9": "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-2.6.9-1/rubyinstaller-2.6.9-1-x64.7z",
|
||||||
"2.7.0": "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-2.7.0-1/rubyinstaller-2.7.0-1-x64.7z",
|
"2.7.0": "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-2.7.0-1/rubyinstaller-2.7.0-1-x64.7z",
|
||||||
"2.7.1": "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-2.7.1-1/rubyinstaller-2.7.1-1-x64.7z",
|
"2.7.1": "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-2.7.1-1/rubyinstaller-2.7.1-1-x64.7z",
|
||||||
"2.7.2": "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-2.7.2-1/rubyinstaller-2.7.2-1-x64.7z",
|
"2.7.2": "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-2.7.2-1/rubyinstaller-2.7.2-1-x64.7z",
|
||||||
"2.7.3": "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-2.7.3-1/rubyinstaller-2.7.3-1-x64.7z",
|
"2.7.3": "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-2.7.3-1/rubyinstaller-2.7.3-1-x64.7z",
|
||||||
"2.7.4": "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-2.7.4-1/rubyinstaller-2.7.4-1-x64.7z",
|
"2.7.4": "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-2.7.4-1/rubyinstaller-2.7.4-1-x64.7z",
|
||||||
|
"2.7.5": "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-2.7.5-1/rubyinstaller-2.7.5-1-x64.7z",
|
||||||
"3.0.0": "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-3.0.0-1/rubyinstaller-3.0.0-1-x64.7z",
|
"3.0.0": "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-3.0.0-1/rubyinstaller-3.0.0-1-x64.7z",
|
||||||
"3.0.1": "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-3.0.1-1/rubyinstaller-3.0.1-1-x64.7z",
|
"3.0.1": "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-3.0.1-1/rubyinstaller-3.0.1-1-x64.7z",
|
||||||
"3.0.2": "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-3.0.2-1/rubyinstaller-3.0.2-1-x64.7z",
|
"3.0.2": "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-3.0.2-1/rubyinstaller-3.0.2-1-x64.7z",
|
||||||
|
"3.0.3": "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-3.0.3-1/rubyinstaller-3.0.3-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"
|
||||||
|
|||||||
+2
-2
@@ -82,7 +82,7 @@ async function downloadAndExtract(engine, version, url, base, rubyPrefix) {
|
|||||||
async function setupMingw(version) {
|
async function setupMingw(version) {
|
||||||
core.exportVariable('MAKE', 'make.exe')
|
core.exportVariable('MAKE', 'make.exe')
|
||||||
|
|
||||||
if (version.match(/^2\.[0123]/)) {
|
if (common.floatVersion(version) <= 2.3) {
|
||||||
core.exportVariable('SSL_CERT_FILE', certFile)
|
core.exportVariable('SSL_CERT_FILE', certFile)
|
||||||
await common.measure('Installing MSYS', async () => installMSYS(version))
|
await common.measure('Installing MSYS', async () => installMSYS(version))
|
||||||
return msysPathEntries
|
return msysPathEntries
|
||||||
@@ -134,7 +134,7 @@ export function addVCVARSEnv() {
|
|||||||
let newEnv = new Map()
|
let newEnv = new Map()
|
||||||
let cmd = `cmd.exe /c "${vcVars} && set"`
|
let cmd = `cmd.exe /c "${vcVars} && set"`
|
||||||
let newSet = cp.execSync(cmd).toString().trim().split(/\r?\n/)
|
let newSet = cp.execSync(cmd).toString().trim().split(/\r?\n/)
|
||||||
newSet = newSet.filter(line => line.match(/\S=\S/))
|
newSet = newSet.filter(line => /\S=\S/.test(line))
|
||||||
newSet.forEach(s => {
|
newSet.forEach(s => {
|
||||||
let [k,v] = common.partition(s, '=')
|
let [k,v] = common.partition(s, '=')
|
||||||
newEnv.set(k,v)
|
newEnv.set(k,v)
|
||||||
|
|||||||
@@ -2,10 +2,10 @@
|
|||||||
# yarn lockfile v1
|
# yarn lockfile v1
|
||||||
|
|
||||||
|
|
||||||
"@actions/cache@^1.0.7":
|
"@actions/cache@^1.0.8":
|
||||||
version "1.0.7"
|
version "1.0.8"
|
||||||
resolved "https://registry.yarnpkg.com/@actions/cache/-/cache-1.0.7.tgz#d80b0f5ac1e1ad48a5e77c39685100bd49b56b1c"
|
resolved "https://registry.yarnpkg.com/@actions/cache/-/cache-1.0.8.tgz#426ad3a2127b35a4e21ad906e02202dc8b96663f"
|
||||||
integrity sha512-MY69kxuubqUFq84pFlu8m6Poxl5sR/xyhpC4JEvno7Yg9ASYdGizEmKgt0m8ovewpYKf15UAOcSC0hzS+DuosA==
|
integrity sha512-GWNNB67w93HGJRQXlsV56YqrdAuDoP3esK/mo5mzU8WoDCVjtQgJGsTdkYUX7brswtT7xnI30bWNo1WLKQ8FZQ==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@actions/core" "^1.2.6"
|
"@actions/core" "^1.2.6"
|
||||||
"@actions/exec" "^1.0.1"
|
"@actions/exec" "^1.0.1"
|
||||||
|
|||||||
Reference in New Issue
Block a user