mirror of
https://github.com/ruby/setup-ruby.git
synced 2026-09-13 22:44:20 +02:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
312f3d08ba | ||
|
|
273e7443b6 | ||
|
|
33cc6f7238 | ||
|
|
7ac926d65e | ||
|
|
1682e5e389 | ||
|
|
25388a3d11 | ||
|
|
aa7df8d81f | ||
|
|
162161eab5 | ||
|
|
c233f78bee | ||
|
|
5a76bd6a5f |
@@ -17,7 +17,7 @@ jobs:
|
|||||||
matrix:
|
matrix:
|
||||||
os: [ ubuntu-16.04, ubuntu-18.04, ubuntu-20.04, macos-10.15, windows-2016, windows-2019 ]
|
os: [ ubuntu-16.04, ubuntu-18.04, ubuntu-20.04, macos-10.15, windows-2016, windows-2019 ]
|
||||||
# Use various version syntax here for testing
|
# Use various version syntax here for testing
|
||||||
ruby: [ 2.2, 2.3, 2.4, 2.5, 2.6.6, 2.7, ruby-head, debug, jruby-9.1, jruby, jruby-head, truffleruby, truffleruby-head ]
|
ruby: [ 2.1, 2.2, 2.3, 2.4, 2.5, 2.6.6, 2.7, ruby-head, debug, jruby-9.1, jruby, jruby-head, truffleruby, truffleruby-head ]
|
||||||
include:
|
include:
|
||||||
- { os: ubuntu-18.04, ruby: rubinius }
|
- { os: ubuntu-18.04, ruby: rubinius }
|
||||||
- { os: windows-2016, ruby: mingw }
|
- { os: windows-2016, ruby: mingw }
|
||||||
|
|||||||
@@ -14,8 +14,8 @@ This action currently supports these versions of MRI, JRuby and TruffleRuby:
|
|||||||
|
|
||||||
| Interpreter | Versions |
|
| Interpreter | Versions |
|
||||||
| ----------- | -------- |
|
| ----------- | -------- |
|
||||||
| Ruby | 2.2, 2.3.0 - 2.3.8, 2.4.0 - 2.4.10, 2.5.0 - 2.5.8, 2.6.0 - 2.6.6, 2.7.1, head, debug, mingw, mswin |
|
| Ruby | 2.1.9, 2.2, 2.3.0 - 2.3.8, 2.4.0 - 2.4.10, 2.5.0 - 2.5.8, 2.6.0 - 2.6.6, 2.7.1, head, debug, mingw, mswin |
|
||||||
| JRuby | 9.1.17.0, 9.2.9.0 - 9.2.12.0, head |
|
| JRuby | 9.1.17.0, 9.2.9.0 - 9.2.13.0, head |
|
||||||
| TruffleRuby | 19.3.0 - 20.1.0, head |
|
| TruffleRuby | 19.3.0 - 20.1.0, head |
|
||||||
| Rubinius | 4.14 |
|
| Rubinius | 4.14 |
|
||||||
|
|
||||||
@@ -108,11 +108,16 @@ and the [condition and expression syntax](https://help.github.com/en/actions/ref
|
|||||||
* `.tool-versions` reads from the project's `.tool-versions` file
|
* `.tool-versions` reads from the project's `.tool-versions` file
|
||||||
* If the `ruby-version` input is not specified, `.ruby-version` is tried first, followed by `.tool-versions`
|
* If the `ruby-version` input is not specified, `.ruby-version` is tried first, followed by `.tool-versions`
|
||||||
|
|
||||||
|
### Working Directory
|
||||||
|
|
||||||
|
The `working-directory` input can be set to resolve `.ruby-version`, `.tool-versions` and `Gemfile.lock`
|
||||||
|
if they are not at the root of the repository, see [action.yml](action.yml) for details.
|
||||||
|
|
||||||
### Bundler
|
### Bundler
|
||||||
|
|
||||||
By default, if there is a `Gemfile.lock` file with a `BUNDLED WITH` section,
|
By default, if there is a `Gemfile.lock` file (or `$BUNDLE_GEMFILE.lock` if `$BUNDLE_GEMFILE` is set) with a `BUNDLED WITH` section,
|
||||||
the latest version of Bundler with the same major version will be installed.
|
the latest version of Bundler with the same major version will be installed.
|
||||||
Otherwise, the latest Bundler version is installed (except for Ruby 2.2 and 2.3 where only Bundler 1 is supported).
|
Otherwise, the latest compatible Bundler version is installed (Bundler 2 on Ruby >= 2.4, Bundler 1 on Ruby < 2.4).
|
||||||
|
|
||||||
This behavior can be customized, see [action.yml](action.yml) for details about the `bundler` input.
|
This behavior can be customized, see [action.yml](action.yml) for details about the `bundler` input.
|
||||||
|
|
||||||
@@ -126,7 +131,7 @@ This action provides a way to automatically run `bundle install` and cache the r
|
|||||||
```
|
```
|
||||||
|
|
||||||
This caching speeds up installing gems significantly and avoids too many requests to RubyGems.org.
|
This caching speeds up installing gems significantly and avoids too many requests to RubyGems.org.
|
||||||
It needs a `Gemfile` under the [`working-directory`](#working-directory).
|
It needs a `Gemfile` (or `$BUNDLE_GEMFILE`) under the [`working-directory`](#working-directory).
|
||||||
The caching works whether there is a `Gemfile.lock` or not.
|
The caching works whether there is a `Gemfile.lock` or not.
|
||||||
If there is a `Gemfile.lock`, `bundle config --local deployment true` is used.
|
If there is a `Gemfile.lock`, `bundle config --local deployment true` is used.
|
||||||
|
|
||||||
@@ -159,15 +164,9 @@ When using `.ruby-version`, replace `${{ matrix.ruby }}` with `${{ hashFiles('.r
|
|||||||
When using `.tool-versions`, replace `${{ matrix.ruby }}` with `${{ hashFiles('.tool-versions') }}`.
|
When using `.tool-versions`, replace `${{ matrix.ruby }}` with `${{ hashFiles('.tool-versions') }}`.
|
||||||
|
|
||||||
This uses the [cache action](https://github.com/actions/cache).
|
This uses the [cache action](https://github.com/actions/cache).
|
||||||
The code above is a more complete version of the [Ruby - Bundler example](https://github.com/actions/cache/blob/master/examples.md#ruby---\
|
The code above is a more complete version of the [Ruby - Bundler example](https://github.com/actions/cache/blob/master/examples.md#ruby---bundler).
|
||||||
bundler).
|
|
||||||
Make sure to include `use-ruby` in the `key` to avoid conflicting with previous caches.
|
Make sure to include `use-ruby` in the `key` to avoid conflicting with previous caches.
|
||||||
|
|
||||||
### Working Directory
|
|
||||||
|
|
||||||
The `working-directory` input can be set to resolve `.ruby-version`, `.tool-versions` and `Gemfile.lock`
|
|
||||||
if they are not at the root of the repository, see [action.yml](action.yml) for details.
|
|
||||||
|
|
||||||
## Windows
|
## Windows
|
||||||
|
|
||||||
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.
|
||||||
@@ -192,9 +191,7 @@ Make sure to always use the latest release before reporting an issue on GitHub.
|
|||||||
This action follows semantic versioning with a moving `v1` branch.
|
This action follows semantic versioning with a moving `v1` branch.
|
||||||
This follows the [recommendations](https://github.com/actions/toolkit/blob/master/docs/action-versioning.md) of GitHub Actions.
|
This follows the [recommendations](https://github.com/actions/toolkit/blob/master/docs/action-versioning.md) of GitHub Actions.
|
||||||
|
|
||||||
## Limitations
|
## Using self-hosted runners
|
||||||
|
|
||||||
### Using self-hosted runners
|
|
||||||
You must meet the following parameters to use this action with self-hosted runners:
|
You must meet the following parameters to use this action with self-hosted runners:
|
||||||
|
|
||||||
* Make sure that the operating system has `libyaml-0` installed
|
* Make sure that the operating system has `libyaml-0` installed
|
||||||
|
|||||||
+4
-1
@@ -10,7 +10,10 @@ inputs:
|
|||||||
required: false
|
required: false
|
||||||
default: 'default'
|
default: 'default'
|
||||||
bundler:
|
bundler:
|
||||||
description: 'The version of Bundler to install. Either none, 1, 2, latest or Gemfile.lock. The default tries Gemfile.lock and otherwise uses latest.'
|
description: |
|
||||||
|
The version of Bundler to install. Either 'none', 1, 2, 'latest' or 'Gemfile.lock'.
|
||||||
|
For 'Gemfile.lock', the version is determined based on the BUNDLED WITH section from the file ($BUNDLE_GEMFILE || Gemfile).lock.
|
||||||
|
Defaults to 'Gemfile.lock' if it exists and 'latest' otherwise.
|
||||||
required: false
|
required: false
|
||||||
default: 'default'
|
default: 'default'
|
||||||
bundler-cache:
|
bundler-cache:
|
||||||
|
|||||||
+15
-12
@@ -2339,9 +2339,9 @@ function setupPath(newPathEntries) {
|
|||||||
core.exportVariable('PATH', [...newPathEntries, ...cleanPath].join(path.delimiter))
|
core.exportVariable('PATH', [...newPathEntries, ...cleanPath].join(path.delimiter))
|
||||||
}
|
}
|
||||||
|
|
||||||
function readBundledWithFromGemfileLock() {
|
function readBundledWithFromGemfileLock(path) {
|
||||||
if (fs.existsSync('Gemfile.lock')) {
|
if (fs.existsSync(path)) {
|
||||||
const contents = fs.readFileSync('Gemfile.lock', 'utf8')
|
const contents = fs.readFileSync(path, 'utf8')
|
||||||
const lines = contents.split(/\r?\n/)
|
const lines = contents.split(/\r?\n/)
|
||||||
const bundledWithLine = lines.findIndex(line => /^BUNDLED WITH$/.test(line.trim()))
|
const bundledWithLine = lines.findIndex(line => /^BUNDLED WITH$/.test(line.trim()))
|
||||||
if (bundledWithLine !== -1) {
|
if (bundledWithLine !== -1) {
|
||||||
@@ -2349,7 +2349,7 @@ function readBundledWithFromGemfileLock() {
|
|||||||
if (nextLine && /^\d+/.test(nextLine.trim())) {
|
if (nextLine && /^\d+/.test(nextLine.trim())) {
|
||||||
const bundlerVersion = nextLine.trim()
|
const bundlerVersion = nextLine.trim()
|
||||||
const majorVersion = bundlerVersion.match(/^\d+/)[0]
|
const majorVersion = bundlerVersion.match(/^\d+/)[0]
|
||||||
console.log(`Using Bundler ${majorVersion} from Gemfile.lock BUNDLED WITH ${bundlerVersion}`)
|
console.log(`Using Bundler ${majorVersion} from ${path} BUNDLED WITH ${bundlerVersion}`)
|
||||||
return majorVersion
|
return majorVersion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2361,7 +2361,8 @@ async function installBundler(bundlerVersionInput, platform, rubyPrefix, engine,
|
|||||||
var bundlerVersion = bundlerVersionInput
|
var bundlerVersion = bundlerVersionInput
|
||||||
|
|
||||||
if (bundlerVersion === 'default' || bundlerVersion === 'Gemfile.lock') {
|
if (bundlerVersion === 'default' || bundlerVersion === 'Gemfile.lock') {
|
||||||
bundlerVersion = readBundledWithFromGemfileLock()
|
const gemfilePath = `${process.env['BUNDLE_GEMFILE'] || 'Gemfile'}.lock`
|
||||||
|
bundlerVersion = readBundledWithFromGemfileLock(gemfilePath)
|
||||||
if (!bundlerVersion) {
|
if (!bundlerVersion) {
|
||||||
bundlerVersion = 'latest'
|
bundlerVersion = 'latest'
|
||||||
}
|
}
|
||||||
@@ -2377,8 +2378,8 @@ async function installBundler(bundlerVersionInput, platform, rubyPrefix, engine,
|
|||||||
throw new Error(`Cannot parse bundler input: ${bundlerVersion}`)
|
throw new Error(`Cannot parse bundler input: ${bundlerVersion}`)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (rubyVersion.startsWith('2.2')) {
|
if (rubyVersion.match(/^2\.[12]/)) {
|
||||||
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 (rubyVersion.startsWith('2.3')) {
|
} else if (rubyVersion.startsWith('2.3')) {
|
||||||
console.log('Ruby 2.3 has a bug with Bundler 2 (https://github.com/rubygems/rubygems/issues/3570), using Bundler 1 instead on Ruby 2.3')
|
console.log('Ruby 2.3 has a bug with Bundler 2 (https://github.com/rubygems/rubygems/issues/3570), using Bundler 1 instead on Ruby 2.3')
|
||||||
@@ -3093,6 +3094,7 @@ __webpack_require__.r(__webpack_exports__);
|
|||||||
function getVersions(platform) {
|
function getVersions(platform) {
|
||||||
const versions = {
|
const versions = {
|
||||||
"ruby": [
|
"ruby": [
|
||||||
|
"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",
|
||||||
@@ -3103,7 +3105,7 @@ function getVersions(platform) {
|
|||||||
],
|
],
|
||||||
"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.9.0", "9.2.10.0", "9.2.11.0", "9.2.11.1", "9.2.12.0", "9.2.13.0",
|
||||||
"head"
|
"head"
|
||||||
],
|
],
|
||||||
"truffleruby": [
|
"truffleruby": [
|
||||||
@@ -5923,6 +5925,7 @@ exports.getState = getState;
|
|||||||
__webpack_require__.r(__webpack_exports__);
|
__webpack_require__.r(__webpack_exports__);
|
||||||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "versions", function() { return versions; });
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "versions", function() { return versions; });
|
||||||
const versions = {
|
const versions = {
|
||||||
|
"2.1.9": "https://dl.bintray.com/oneclick/rubyinstaller/ruby-2.1.9-x64-mingw32.7z",
|
||||||
"2.2.6": "https://dl.bintray.com/oneclick/rubyinstaller/ruby-2.2.6-x64-mingw32.7z",
|
"2.2.6": "https://dl.bintray.com/oneclick/rubyinstaller/ruby-2.2.6-x64-mingw32.7z",
|
||||||
"2.3.0": "https://dl.bintray.com/oneclick/rubyinstaller/ruby-2.3.0-x64-mingw32.7z",
|
"2.3.0": "https://dl.bintray.com/oneclick/rubyinstaller/ruby-2.3.0-x64-mingw32.7z",
|
||||||
"2.3.1": "https://dl.bintray.com/oneclick/rubyinstaller/ruby-2.3.1-x64-mingw32.7z",
|
"2.3.1": "https://dl.bintray.com/oneclick/rubyinstaller/ruby-2.3.1-x64-mingw32.7z",
|
||||||
@@ -7549,14 +7552,14 @@ const rubyInstallerVersions = __webpack_require__(471).versions
|
|||||||
// Extract to SSD, see https://github.com/ruby/setup-ruby/pull/14
|
// Extract to SSD, see https://github.com/ruby/setup-ruby/pull/14
|
||||||
const drive = (process.env['GITHUB_WORKSPACE'] || 'C')[0]
|
const drive = (process.env['GITHUB_WORKSPACE'] || 'C')[0]
|
||||||
|
|
||||||
// needed for 2.2, 2.3, and mswin, cert file used by Git for Windows
|
// needed for 2.1, 2.2, 2.3, and mswin, cert file used by Git for Windows
|
||||||
const certFile = 'C:\\Program Files\\Git\\mingw64\\ssl\\cert.pem'
|
const certFile = 'C:\\Program Files\\Git\\mingw64\\ssl\\cert.pem'
|
||||||
|
|
||||||
// standard MSYS2 location, found by 'devkit.rb'
|
// standard MSYS2 location, found by 'devkit.rb'
|
||||||
const msys2 = 'C:\\msys64'
|
const msys2 = 'C:\\msys64'
|
||||||
const msys2PathEntries = [`${msys2}\\mingw64\\bin`, `${msys2}\\usr\\bin`]
|
const msys2PathEntries = [`${msys2}\\mingw64\\bin`, `${msys2}\\usr\\bin`]
|
||||||
|
|
||||||
// location & path for old RubyInstaller DevKit (MSYS), Ruby 2.2 and 2.3
|
// location & path for old RubyInstaller DevKit (MSYS), Ruby 2.1, 2.2 and 2.3
|
||||||
const msys = `${drive}:\\DevKit64`
|
const msys = `${drive}:\\DevKit64`
|
||||||
const msysPathEntries = [`${msys}\\mingw\\x86_64-w64-mingw32\\bin`,
|
const msysPathEntries = [`${msys}\\mingw\\x86_64-w64-mingw32\\bin`,
|
||||||
`${msys}\\mingw\\bin`, `${msys}\\bin`]
|
`${msys}\\mingw\\bin`, `${msys}\\bin`]
|
||||||
@@ -7609,7 +7612,7 @@ async function symLinkToEmbeddedMSYS2() {
|
|||||||
async function setupMingw(version) {
|
async function setupMingw(version) {
|
||||||
core.exportVariable('MAKE', 'make.exe')
|
core.exportVariable('MAKE', 'make.exe')
|
||||||
|
|
||||||
if (version.startsWith('2.2') || version.startsWith('2.3')) {
|
if (version.match(/^2\.[123]/)) {
|
||||||
core.exportVariable('SSL_CERT_FILE', certFile)
|
core.exportVariable('SSL_CERT_FILE', certFile)
|
||||||
await common.measure('Installing MSYS1', async () =>
|
await common.measure('Installing MSYS1', async () =>
|
||||||
installMSYS(version))
|
installMSYS(version))
|
||||||
@@ -7625,7 +7628,7 @@ async function setupMingw(version) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Ruby 2.2 and 2.3
|
// Ruby 2.1, 2.2 and 2.3
|
||||||
async function installMSYS(version) {
|
async function installMSYS(version) {
|
||||||
const url = 'https://dl.bintray.com/oneclick/rubyinstaller/DevKit-mingw64-64-4.7.2-20130224-1432-sfx.exe'
|
const url = 'https://dl.bintray.com/oneclick/rubyinstaller/DevKit-mingw64-64-4.7.2-20130224-1432-sfx.exe'
|
||||||
const downloadPath = await tc.downloadTool(url)
|
const downloadPath = await tc.downloadTool(url)
|
||||||
|
|||||||
@@ -2,7 +2,8 @@ require 'net/http'
|
|||||||
require 'yaml'
|
require 'yaml'
|
||||||
require 'json'
|
require 'json'
|
||||||
|
|
||||||
min_version = '2.2.6'
|
min_requirements = ['~> 2.1.9', '>= 2.2.6'].map { |req| Gem::Requirement.new(req) }
|
||||||
|
|
||||||
url = 'https://raw.githubusercontent.com/oneclick/rubyinstaller.org-website/master/_data/downloads.yaml'
|
url = 'https://raw.githubusercontent.com/oneclick/rubyinstaller.org-website/master/_data/downloads.yaml'
|
||||||
entries = YAML.load(Net::HTTP.get(URI(url)), symbolize_names: true)
|
entries = YAML.load(Net::HTTP.get(URI(url)), symbolize_names: true)
|
||||||
|
|
||||||
@@ -19,7 +20,7 @@ versions = entries.select { |entry|
|
|||||||
}.sort_by { |version, entry|
|
}.sort_by { |version, entry|
|
||||||
Gem::Version.new(version)
|
Gem::Version.new(version)
|
||||||
}.select { |version, entry|
|
}.select { |version, entry|
|
||||||
Gem::Version.new(version) >= Gem::Version.new(min_version)
|
min_requirements.any? { |req| req.satisfied_by?(Gem::Version.new(version)) }
|
||||||
}.map { |version, entry|
|
}.map { |version, entry|
|
||||||
[version, entry[:href]]
|
[version, entry[:href]]
|
||||||
}.to_h
|
}.to_h
|
||||||
|
|||||||
@@ -153,9 +153,9 @@ function setupPath(newPathEntries) {
|
|||||||
core.exportVariable('PATH', [...newPathEntries, ...cleanPath].join(path.delimiter))
|
core.exportVariable('PATH', [...newPathEntries, ...cleanPath].join(path.delimiter))
|
||||||
}
|
}
|
||||||
|
|
||||||
function readBundledWithFromGemfileLock() {
|
function readBundledWithFromGemfileLock(path) {
|
||||||
if (fs.existsSync('Gemfile.lock')) {
|
if (fs.existsSync(path)) {
|
||||||
const contents = fs.readFileSync('Gemfile.lock', 'utf8')
|
const contents = fs.readFileSync(path, 'utf8')
|
||||||
const lines = contents.split(/\r?\n/)
|
const lines = contents.split(/\r?\n/)
|
||||||
const bundledWithLine = lines.findIndex(line => /^BUNDLED WITH$/.test(line.trim()))
|
const bundledWithLine = lines.findIndex(line => /^BUNDLED WITH$/.test(line.trim()))
|
||||||
if (bundledWithLine !== -1) {
|
if (bundledWithLine !== -1) {
|
||||||
@@ -163,7 +163,7 @@ function readBundledWithFromGemfileLock() {
|
|||||||
if (nextLine && /^\d+/.test(nextLine.trim())) {
|
if (nextLine && /^\d+/.test(nextLine.trim())) {
|
||||||
const bundlerVersion = nextLine.trim()
|
const bundlerVersion = nextLine.trim()
|
||||||
const majorVersion = bundlerVersion.match(/^\d+/)[0]
|
const majorVersion = bundlerVersion.match(/^\d+/)[0]
|
||||||
console.log(`Using Bundler ${majorVersion} from Gemfile.lock BUNDLED WITH ${bundlerVersion}`)
|
console.log(`Using Bundler ${majorVersion} from ${path} BUNDLED WITH ${bundlerVersion}`)
|
||||||
return majorVersion
|
return majorVersion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -175,7 +175,8 @@ async function installBundler(bundlerVersionInput, platform, rubyPrefix, engine,
|
|||||||
var bundlerVersion = bundlerVersionInput
|
var bundlerVersion = bundlerVersionInput
|
||||||
|
|
||||||
if (bundlerVersion === 'default' || bundlerVersion === 'Gemfile.lock') {
|
if (bundlerVersion === 'default' || bundlerVersion === 'Gemfile.lock') {
|
||||||
bundlerVersion = readBundledWithFromGemfileLock()
|
const gemfilePath = `${process.env['BUNDLE_GEMFILE'] || 'Gemfile'}.lock`
|
||||||
|
bundlerVersion = readBundledWithFromGemfileLock(gemfilePath)
|
||||||
if (!bundlerVersion) {
|
if (!bundlerVersion) {
|
||||||
bundlerVersion = 'latest'
|
bundlerVersion = 'latest'
|
||||||
}
|
}
|
||||||
@@ -191,8 +192,8 @@ async function installBundler(bundlerVersionInput, platform, rubyPrefix, engine,
|
|||||||
throw new Error(`Cannot parse bundler input: ${bundlerVersion}`)
|
throw new Error(`Cannot parse bundler input: ${bundlerVersion}`)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (rubyVersion.startsWith('2.2')) {
|
if (rubyVersion.match(/^2\.[12]/)) {
|
||||||
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 (rubyVersion.startsWith('2.3')) {
|
} else if (rubyVersion.startsWith('2.3')) {
|
||||||
console.log('Ruby 2.3 has a bug with Bundler 2 (https://github.com/rubygems/rubygems/issues/3570), using Bundler 1 instead on Ruby 2.3')
|
console.log('Ruby 2.3 has a bug with Bundler 2 (https://github.com/rubygems/rubygems/issues/3570), using Bundler 1 instead on Ruby 2.3')
|
||||||
|
|||||||
@@ -4,7 +4,6 @@
|
|||||||
"description": "Download a prebuilt Ruby and add it to the PATH in 5 seconds",
|
"description": "Download a prebuilt Ruby and add it to the PATH in 5 seconds",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"lint": "eslint *.js",
|
|
||||||
"package": "ncc build index.js -o dist"
|
"package": "ncc build index.js -o dist"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
export function getVersions(platform) {
|
export function getVersions(platform) {
|
||||||
const versions = {
|
const versions = {
|
||||||
"ruby": [
|
"ruby": [
|
||||||
|
"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",
|
||||||
@@ -11,7 +12,7 @@ export function getVersions(platform) {
|
|||||||
],
|
],
|
||||||
"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.9.0", "9.2.10.0", "9.2.11.0", "9.2.11.1", "9.2.12.0", "9.2.13.0",
|
||||||
"head"
|
"head"
|
||||||
],
|
],
|
||||||
"truffleruby": [
|
"truffleruby": [
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ versions = eval hash
|
|||||||
|
|
||||||
by_minor = versions[:ruby].group_by { |v| v[/^\d\.\d/] }
|
by_minor = versions[:ruby].group_by { |v| v[/^\d\.\d/] }
|
||||||
|
|
||||||
|
p by_minor['2.1']
|
||||||
p by_minor['2.2']
|
p by_minor['2.2']
|
||||||
p by_minor['2.3']
|
p by_minor['2.3']
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
export const versions = {
|
export const versions = {
|
||||||
|
"2.1.9": "https://dl.bintray.com/oneclick/rubyinstaller/ruby-2.1.9-x64-mingw32.7z",
|
||||||
"2.2.6": "https://dl.bintray.com/oneclick/rubyinstaller/ruby-2.2.6-x64-mingw32.7z",
|
"2.2.6": "https://dl.bintray.com/oneclick/rubyinstaller/ruby-2.2.6-x64-mingw32.7z",
|
||||||
"2.3.0": "https://dl.bintray.com/oneclick/rubyinstaller/ruby-2.3.0-x64-mingw32.7z",
|
"2.3.0": "https://dl.bintray.com/oneclick/rubyinstaller/ruby-2.3.0-x64-mingw32.7z",
|
||||||
"2.3.1": "https://dl.bintray.com/oneclick/rubyinstaller/ruby-2.3.1-x64-mingw32.7z",
|
"2.3.1": "https://dl.bintray.com/oneclick/rubyinstaller/ruby-2.3.1-x64-mingw32.7z",
|
||||||
|
|||||||
+4
-4
@@ -13,14 +13,14 @@ const rubyInstallerVersions = require('./windows-versions').versions
|
|||||||
// Extract to SSD, see https://github.com/ruby/setup-ruby/pull/14
|
// Extract to SSD, see https://github.com/ruby/setup-ruby/pull/14
|
||||||
const drive = (process.env['GITHUB_WORKSPACE'] || 'C')[0]
|
const drive = (process.env['GITHUB_WORKSPACE'] || 'C')[0]
|
||||||
|
|
||||||
// needed for 2.2, 2.3, and mswin, cert file used by Git for Windows
|
// needed for 2.1, 2.2, 2.3, and mswin, cert file used by Git for Windows
|
||||||
const certFile = 'C:\\Program Files\\Git\\mingw64\\ssl\\cert.pem'
|
const certFile = 'C:\\Program Files\\Git\\mingw64\\ssl\\cert.pem'
|
||||||
|
|
||||||
// standard MSYS2 location, found by 'devkit.rb'
|
// standard MSYS2 location, found by 'devkit.rb'
|
||||||
const msys2 = 'C:\\msys64'
|
const msys2 = 'C:\\msys64'
|
||||||
const msys2PathEntries = [`${msys2}\\mingw64\\bin`, `${msys2}\\usr\\bin`]
|
const msys2PathEntries = [`${msys2}\\mingw64\\bin`, `${msys2}\\usr\\bin`]
|
||||||
|
|
||||||
// location & path for old RubyInstaller DevKit (MSYS), Ruby 2.2 and 2.3
|
// location & path for old RubyInstaller DevKit (MSYS), Ruby 2.1, 2.2 and 2.3
|
||||||
const msys = `${drive}:\\DevKit64`
|
const msys = `${drive}:\\DevKit64`
|
||||||
const msysPathEntries = [`${msys}\\mingw\\x86_64-w64-mingw32\\bin`,
|
const msysPathEntries = [`${msys}\\mingw\\x86_64-w64-mingw32\\bin`,
|
||||||
`${msys}\\mingw\\bin`, `${msys}\\bin`]
|
`${msys}\\mingw\\bin`, `${msys}\\bin`]
|
||||||
@@ -73,7 +73,7 @@ async function symLinkToEmbeddedMSYS2() {
|
|||||||
async function setupMingw(version) {
|
async function setupMingw(version) {
|
||||||
core.exportVariable('MAKE', 'make.exe')
|
core.exportVariable('MAKE', 'make.exe')
|
||||||
|
|
||||||
if (version.startsWith('2.2') || version.startsWith('2.3')) {
|
if (version.match(/^2\.[123]/)) {
|
||||||
core.exportVariable('SSL_CERT_FILE', certFile)
|
core.exportVariable('SSL_CERT_FILE', certFile)
|
||||||
await common.measure('Installing MSYS1', async () =>
|
await common.measure('Installing MSYS1', async () =>
|
||||||
installMSYS(version))
|
installMSYS(version))
|
||||||
@@ -89,7 +89,7 @@ async function setupMingw(version) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Ruby 2.2 and 2.3
|
// Ruby 2.1, 2.2 and 2.3
|
||||||
async function installMSYS(version) {
|
async function installMSYS(version) {
|
||||||
const url = 'https://dl.bintray.com/oneclick/rubyinstaller/DevKit-mingw64-64-4.7.2-20130224-1432-sfx.exe'
|
const url = 'https://dl.bintray.com/oneclick/rubyinstaller/DevKit-mingw64-64-4.7.2-20130224-1432-sfx.exe'
|
||||||
const downloadPath = await tc.downloadTool(url)
|
const downloadPath = await tc.downloadTool(url)
|
||||||
|
|||||||
Reference in New Issue
Block a user