Compare commits

..
18 Commits
Author SHA1 Message Date
Benoit Daloze 6c10c0bae0 Add TruffleRuby 20.2.0 2020-08-19 16:33:37 +02:00
Benoit Daloze 312f3d08ba Improve the README, move the working directory section, mention $BUNDLE_GEMFILE 2020-08-13 20:34:29 +02:00
Attila Večerek 273e7443b6 Move further explanation over to the README 2020-08-13 20:18:19 +02:00
Attila Večerek 33cc6f7238 Shorten the description in action.yml 2020-08-13 20:18:19 +02:00
Attila Večerek 7ac926d65e Update description of bundler input in action.yml 2020-08-13 20:18:19 +02:00
Attila Večerek 1682e5e389 Read path to gemfile from env variable 2020-08-13 20:18:19 +02:00
Attila Večerek 25388a3d11 Accept a path in readBundledWithFromGemfileLock 2020-08-13 20:18:19 +02:00
Jakob Krigovsky aa7df8d81f Fix broken Markdown link 2020-08-13 19:50:42 +02:00
Benoit Daloze 162161eab5 Remove lint command
* eslint has been removed.
2020-08-12 10:58:59 +02:00
Gregory Huczynski c233f78bee Add JRuby 9.2.13.0 2020-08-12 10:58:05 +02:00
Holger Just 5a76bd6a5f Add support for Ruby 2.1 (#71) 2020-07-16 22:23:31 +02:00
Benoit Daloze 40bbc5ec66 Also include the commit in the cache key for truffleruby-head
* That way new caches can be created if the previous cache is for a different commit.
2020-07-11 16:08:35 +02:00
Benoit DalozeandEliza Brock Marcum 1bb7de255b Treat error from restoring the cache as a cache miss (#68)
* Don't retry or error out on restore cache errors

Co-authored-by: Eliza Brock Marcum <eliza@elizamarcum.com>
2020-07-11 16:02:33 +02:00
M. Adam Kendall 973b1baf94 Update README to reflect conditions for self-hosted runners 2020-07-09 01:07:29 +02:00
Benoit Daloze ef4b00fd12 Mention JRuby 9.2.12.0 in the README 2020-07-02 11:35:41 +02:00
MSP-Greg 271876da60 Allow running external function before 'bundle install'
External actions may use setup-ruby, and some actions make changes/additions to the build environment. These may be needed for dependencies.

Hence, allow those external actions to run code before 'bundle install'. This is done by passing a function as a parameter to setupRuby().
2020-07-01 21:22:43 +02:00
Benoit Daloze 5c4fc21c57 Add JRuby 9.2.12.0 2020-07-01 21:16:36 +02:00
Benoit Daloze c8a88df157 Refactor how to call setup-ruby from other actions
* Automatically use inputs if available, use defaults otherwise.
2020-06-14 16:51:29 +02:00
11 changed files with 117 additions and 66 deletions
+1 -1
View File
@@ -17,7 +17,7 @@ jobs:
matrix:
os: [ ubuntu-16.04, ubuntu-18.04, ubuntu-20.04, macos-10.15, windows-2016, windows-2019 ]
# 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:
- { os: ubuntu-18.04, ruby: rubinius }
- { os: windows-2016, ruby: mingw }
+18 -17
View File
@@ -14,9 +14,9 @@ This action currently supports these versions of MRI, JRuby and TruffleRuby:
| 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 |
| JRuby | 9.1.17.0, 9.2.9.0 - 9.2.11.1, head |
| TruffleRuby | 19.3.0 - 20.1.0, head |
| 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.13.0, head |
| TruffleRuby | 19.3.0 - 20.2.0, head |
| Rubinius | 4.14 |
`ruby-debug` is the same as `ruby-head` but with assertions enabled (`-DRUBY_DEBUG=1`).
@@ -31,7 +31,7 @@ On Windows, Ruby 2.4 uses OpenSSL 1.0.2, which is no longer maintained.
### Supported Platforms
The action works for all [GitHub-hosted runners](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/virtual-environments-for-github-hosted-runners).
The action works for all [GitHub-hosted runners](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/virtual-environments-for-github-hosted-runners), and [self-hosted runners](https://docs.github.com/en/actions/hosting-your-own-runners/about-self-hosted-runners), under [certain conditions](#limitations)
| Operating System | Recommended | Other Supported Versions |
| ----------- | -------- | -------- |
@@ -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
* 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
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.
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.
@@ -126,10 +131,10 @@ 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.
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.
If there is a `Gemfile.lock`, `bundle config --local deployment true` is used.
To perform caching, this action will use `bundle config --local path vendor/bundle`.
Therefore, the Bundler `path` should not be changed in your workflow for the cache to work.
@@ -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') }}`.
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---\
bundler).
The code above is a more complete version of the [Ruby - Bundler example](https://github.com/actions/cache/blob/master/examples.md#ruby---bundler).
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
Note that running CI on Windows can be quite challenging if you are not very familiar with Windows.
@@ -192,9 +191,11 @@ 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 follows the [recommendations](https://github.com/actions/toolkit/blob/master/docs/action-versioning.md) of GitHub Actions.
## Limitations
## Using self-hosted runners
You must meet the following parameters to use this action with self-hosted runners:
* This action currently only works with GitHub-hosted runners, not private runners.
* Make sure that the operating system has `libyaml-0` installed
* The runner software is running as user `runner` with a home directory of `/home/runner`, or you have created a symlink for the home directory of whatever user that the runner is running as to `/home/runner`.
## History
+4 -1
View File
@@ -10,7 +10,10 @@ inputs:
required: false
default: 'default'
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
default: 'default'
bundler-cache:
Generated Vendored
+45 -22
View File
@@ -2199,20 +2199,23 @@ const inputDefaults = {
'working-directory': '.',
}
// entry point when this action is run on its own
async function run() {
try {
const options = {}
for (const key in inputDefaults) {
options[key] = core.getInput(key)
}
await setupRuby(options)
await setupRuby()
} catch (error) {
core.setFailed(error.message)
}
}
async function setupRuby(options) {
const inputs = { ...inputDefaults, ...options }
// entry point when this action is run from other actions
async function setupRuby(options = {}) {
const inputs = { ...options }
for (const key in inputDefaults) {
if (!inputs.hasOwnProperty(key)) {
inputs[key] = core.getInput(key) || inputDefaults[key]
}
}
process.chdir(inputs['working-directory'])
@@ -2235,6 +2238,13 @@ async function setupRuby(options) {
setupPath(newPathEntries)
// When setup-ruby is used by other actions, this allows code in them to run
// before 'bundle install'. Installed dependencies may require additional
// libraries & headers, build tools, etc.
if (inputs['afterSetupPathHook'] instanceof Function) {
await inputs['afterSetupPathHook']({ platform, rubyPrefix, engine, version })
}
if (inputs['bundler'] !== 'none') {
await common.measure('Installing Bundler', async () =>
installBundler(inputs['bundler'], platform, rubyPrefix, engine, version))
@@ -2329,9 +2339,9 @@ function setupPath(newPathEntries) {
core.exportVariable('PATH', [...newPathEntries, ...cleanPath].join(path.delimiter))
}
function readBundledWithFromGemfileLock() {
if (fs.existsSync('Gemfile.lock')) {
const contents = fs.readFileSync('Gemfile.lock', 'utf8')
function readBundledWithFromGemfileLock(path) {
if (fs.existsSync(path)) {
const contents = fs.readFileSync(path, 'utf8')
const lines = contents.split(/\r?\n/)
const bundledWithLine = lines.findIndex(line => /^BUNDLED WITH$/.test(line.trim()))
if (bundledWithLine !== -1) {
@@ -2339,7 +2349,7 @@ function readBundledWithFromGemfileLock() {
if (nextLine && /^\d+/.test(nextLine.trim())) {
const bundlerVersion = nextLine.trim()
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
}
}
@@ -2351,7 +2361,8 @@ async function installBundler(bundlerVersionInput, platform, rubyPrefix, engine,
var bundlerVersion = bundlerVersionInput
if (bundlerVersion === 'default' || bundlerVersion === 'Gemfile.lock') {
bundlerVersion = readBundledWithFromGemfileLock()
const gemfilePath = `${process.env['BUNDLE_GEMFILE'] || 'Gemfile'}.lock`
bundlerVersion = readBundledWithFromGemfileLock(gemfilePath)
if (!bundlerVersion) {
bundlerVersion = 'latest'
}
@@ -2367,8 +2378,8 @@ async function installBundler(bundlerVersionInput, platform, rubyPrefix, engine,
throw new Error(`Cannot parse bundler input: ${bundlerVersion}`)
}
if (rubyVersion.startsWith('2.2')) {
console.log('Bundler 2 requires Ruby 2.3+, using Bundler 1 on Ruby 2.2')
if (rubyVersion.match(/^2\.[12]/)) {
console.log('Bundler 2 requires Ruby 2.3+, using Bundler 1 on Ruby <= 2.2')
bundlerVersion = '1'
} 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')
@@ -2417,7 +2428,17 @@ async function bundleInstall(platform, engine, version) {
console.log(`Cache key: ${key}`)
// restore cache & install
const cachedKey = await cache.restoreCache(paths, key, restoreKeys)
let cachedKey = null
try {
cachedKey = await cache.restoreCache(paths, key, restoreKeys)
} catch (error) {
if (error.name === cache.ValidationError.name) {
throw error;
} else {
core.info(`[warning] There was an error restoring the cache ${error.message}`)
}
}
if (cachedKey) {
console.log(`Found cache for key: ${cachedKey}`)
}
@@ -2449,7 +2470,7 @@ async function bundleInstall(platform, engine, version) {
async function computeBaseKey(platform, engine, version) {
let baseKey = `setup-ruby-bundle-install-${platform}-${engine}-${version}`
if (engine === 'ruby' && common.isHeadVersion(version)) {
if (engine !== 'jruby' && common.isHeadVersion(version)) {
let revision = '';
await exec.exec('ruby', ['-e', 'print RUBY_REVISION'], {
silent: true,
@@ -3073,6 +3094,7 @@ __webpack_require__.r(__webpack_exports__);
function getVersions(platform) {
const versions = {
"ruby": [
"2.1.9",
"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.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",
@@ -3083,12 +3105,12 @@ function getVersions(platform) {
],
"jruby": [
"9.1.17.0",
"9.2.9.0", "9.2.10.0", "9.2.11.0", "9.2.11.1",
"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"
],
"truffleruby": [
"19.3.0", "19.3.1",
"20.0.0", "20.1.0",
"20.0.0", "20.1.0", "20.2.0",
"head"
]
}
@@ -5903,6 +5925,7 @@ exports.getState = getState;
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "versions", function() { return 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.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",
@@ -7529,14 +7552,14 @@ const rubyInstallerVersions = __webpack_require__(471).versions
// Extract to SSD, see https://github.com/ruby/setup-ruby/pull/14
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'
// standard MSYS2 location, found by 'devkit.rb'
const msys2 = 'C:\\msys64'
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 msysPathEntries = [`${msys}\\mingw\\x86_64-w64-mingw32\\bin`,
`${msys}\\mingw\\bin`, `${msys}\\bin`]
@@ -7589,7 +7612,7 @@ async function symLinkToEmbeddedMSYS2() {
async function setupMingw(version) {
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)
await common.measure('Installing MSYS1', async () =>
installMSYS(version))
@@ -7605,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) {
const url = 'https://dl.bintray.com/oneclick/rubyinstaller/DevKit-mingw64-64-4.7.2-20130224-1432-sfx.exe'
const downloadPath = await tc.downloadTool(url)
+3 -2
View File
@@ -2,7 +2,8 @@ require 'net/http'
require 'yaml'
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'
entries = YAML.load(Net::HTTP.get(URI(url)), symbolize_names: true)
@@ -19,7 +20,7 @@ versions = entries.select { |entry|
}.sort_by { |version, entry|
Gem::Version.new(version)
}.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|
[version, entry[:href]]
}.to_h
+37 -16
View File
@@ -13,20 +13,23 @@ const inputDefaults = {
'working-directory': '.',
}
// entry point when this action is run on its own
export async function run() {
try {
const options = {}
for (const key in inputDefaults) {
options[key] = core.getInput(key)
}
await setupRuby(options)
await setupRuby()
} catch (error) {
core.setFailed(error.message)
}
}
export async function setupRuby(options) {
const inputs = { ...inputDefaults, ...options }
// entry point when this action is run from other actions
export async function setupRuby(options = {}) {
const inputs = { ...options }
for (const key in inputDefaults) {
if (!inputs.hasOwnProperty(key)) {
inputs[key] = core.getInput(key) || inputDefaults[key]
}
}
process.chdir(inputs['working-directory'])
@@ -49,6 +52,13 @@ export async function setupRuby(options) {
setupPath(newPathEntries)
// When setup-ruby is used by other actions, this allows code in them to run
// before 'bundle install'. Installed dependencies may require additional
// libraries & headers, build tools, etc.
if (inputs['afterSetupPathHook'] instanceof Function) {
await inputs['afterSetupPathHook']({ platform, rubyPrefix, engine, version })
}
if (inputs['bundler'] !== 'none') {
await common.measure('Installing Bundler', async () =>
installBundler(inputs['bundler'], platform, rubyPrefix, engine, version))
@@ -143,9 +153,9 @@ function setupPath(newPathEntries) {
core.exportVariable('PATH', [...newPathEntries, ...cleanPath].join(path.delimiter))
}
function readBundledWithFromGemfileLock() {
if (fs.existsSync('Gemfile.lock')) {
const contents = fs.readFileSync('Gemfile.lock', 'utf8')
function readBundledWithFromGemfileLock(path) {
if (fs.existsSync(path)) {
const contents = fs.readFileSync(path, 'utf8')
const lines = contents.split(/\r?\n/)
const bundledWithLine = lines.findIndex(line => /^BUNDLED WITH$/.test(line.trim()))
if (bundledWithLine !== -1) {
@@ -153,7 +163,7 @@ function readBundledWithFromGemfileLock() {
if (nextLine && /^\d+/.test(nextLine.trim())) {
const bundlerVersion = nextLine.trim()
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
}
}
@@ -165,7 +175,8 @@ async function installBundler(bundlerVersionInput, platform, rubyPrefix, engine,
var bundlerVersion = bundlerVersionInput
if (bundlerVersion === 'default' || bundlerVersion === 'Gemfile.lock') {
bundlerVersion = readBundledWithFromGemfileLock()
const gemfilePath = `${process.env['BUNDLE_GEMFILE'] || 'Gemfile'}.lock`
bundlerVersion = readBundledWithFromGemfileLock(gemfilePath)
if (!bundlerVersion) {
bundlerVersion = 'latest'
}
@@ -181,8 +192,8 @@ async function installBundler(bundlerVersionInput, platform, rubyPrefix, engine,
throw new Error(`Cannot parse bundler input: ${bundlerVersion}`)
}
if (rubyVersion.startsWith('2.2')) {
console.log('Bundler 2 requires Ruby 2.3+, using Bundler 1 on Ruby 2.2')
if (rubyVersion.match(/^2\.[12]/)) {
console.log('Bundler 2 requires Ruby 2.3+, using Bundler 1 on Ruby <= 2.2')
bundlerVersion = '1'
} 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')
@@ -231,7 +242,17 @@ async function bundleInstall(platform, engine, version) {
console.log(`Cache key: ${key}`)
// restore cache & install
const cachedKey = await cache.restoreCache(paths, key, restoreKeys)
let cachedKey = null
try {
cachedKey = await cache.restoreCache(paths, key, restoreKeys)
} catch (error) {
if (error.name === cache.ValidationError.name) {
throw error;
} else {
core.info(`[warning] There was an error restoring the cache ${error.message}`)
}
}
if (cachedKey) {
console.log(`Found cache for key: ${cachedKey}`)
}
@@ -263,7 +284,7 @@ async function bundleInstall(platform, engine, version) {
async function computeBaseKey(platform, engine, version) {
let baseKey = `setup-ruby-bundle-install-${platform}-${engine}-${version}`
if (engine === 'ruby' && common.isHeadVersion(version)) {
if (engine !== 'jruby' && common.isHeadVersion(version)) {
let revision = '';
await exec.exec('ruby', ['-e', 'print RUBY_REVISION'], {
silent: true,
-1
View File
@@ -4,7 +4,6 @@
"description": "Download a prebuilt Ruby and add it to the PATH in 5 seconds",
"main": "index.js",
"scripts": {
"lint": "eslint *.js",
"package": "ncc build index.js -o dist"
},
"repository": {
+3 -2
View File
@@ -1,6 +1,7 @@
export function getVersions(platform) {
const versions = {
"ruby": [
"2.1.9",
"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.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,12 +12,12 @@ export function getVersions(platform) {
],
"jruby": [
"9.1.17.0",
"9.2.9.0", "9.2.10.0", "9.2.11.0", "9.2.11.1",
"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"
],
"truffleruby": [
"19.3.0", "19.3.1",
"20.0.0", "20.1.0",
"20.0.0", "20.1.0", "20.2.0",
"head"
]
}
+1
View File
@@ -3,6 +3,7 @@ versions = eval hash
by_minor = versions[:ruby].group_by { |v| v[/^\d\.\d/] }
p by_minor['2.1']
p by_minor['2.2']
p by_minor['2.3']
+1
View File
@@ -1,4 +1,5 @@
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.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",
+4 -4
View File
@@ -13,14 +13,14 @@ const rubyInstallerVersions = require('./windows-versions').versions
// Extract to SSD, see https://github.com/ruby/setup-ruby/pull/14
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'
// standard MSYS2 location, found by 'devkit.rb'
const msys2 = 'C:\\msys64'
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 msysPathEntries = [`${msys}\\mingw\\x86_64-w64-mingw32\\bin`,
`${msys}\\mingw\\bin`, `${msys}\\bin`]
@@ -73,7 +73,7 @@ async function symLinkToEmbeddedMSYS2() {
async function setupMingw(version) {
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)
await common.measure('Installing MSYS1', async () =>
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) {
const url = 'https://dl.bintray.com/oneclick/rubyinstaller/DevKit-mingw64-64-4.7.2-20130224-1432-sfx.exe'
const downloadPath = await tc.downloadTool(url)