mirror of
https://github.com/ruby/setup-ruby.git
synced 2026-09-13 14:34:21 +02:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fe983d22a1 | ||
|
|
517a3b1b36 | ||
|
|
4406a4131e | ||
|
|
1328335dba | ||
|
|
ea774f6ee1 | ||
|
|
77ca66ce27 | ||
|
|
fd1a6a00ca | ||
|
|
01144718b5 | ||
|
|
b161cb92f0 | ||
|
|
fa2182b2a4 | ||
|
|
2eb6adbfb1 | ||
|
|
6f2028eda5 |
@@ -16,7 +16,7 @@ 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.1, 2.2, 2.3, 2.4, 2.5, 2.6, 2.7, '3.0', ruby-head, jruby, jruby-head, truffleruby, truffleruby-head ]
|
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 ]
|
||||||
include:
|
include:
|
||||||
- { os: windows-2016, ruby: mingw }
|
- { os: windows-2016, ruby: mingw }
|
||||||
- { os: windows-2019, ruby: mingw }
|
- { os: windows-2019, ruby: mingw }
|
||||||
@@ -70,6 +70,7 @@ jobs:
|
|||||||
- 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
|
||||||
- name: C extension test
|
- name: C extension test
|
||||||
run: gem install json:2.2.0 --no-document
|
run: gem install json:2.2.0 --no-document
|
||||||
- run: bundle --version
|
- run: bundle --version
|
||||||
@@ -94,10 +95,9 @@ jobs:
|
|||||||
- name: bash test
|
- name: bash test
|
||||||
shell: bash
|
shell: bash
|
||||||
run: echo ~
|
run: echo ~
|
||||||
# Disabled until https://github.com/jruby/jruby/issues/6648 is fixed
|
- name: Windows JRuby
|
||||||
# - name: Windows JRuby
|
if: startsWith(matrix.os, 'windows') && startsWith(matrix.ruby, 'jruby')
|
||||||
# if: startsWith(matrix.os, 'windows') && startsWith(matrix.ruby, 'jruby')
|
run: gem install sassc
|
||||||
# run: gem install sassc -N
|
|
||||||
|
|
||||||
testExactBundlerVersion:
|
testExactBundlerVersion:
|
||||||
name: "Test with an exact Bundler version"
|
name: "Test with an exact Bundler version"
|
||||||
|
|||||||
@@ -14,9 +14,9 @@ This action currently supports these versions of MRI, JRuby and TruffleRuby:
|
|||||||
|
|
||||||
| Interpreter | Versions |
|
| Interpreter | Versions |
|
||||||
| ----------- | -------- |
|
| ----------- | -------- |
|
||||||
| `ruby` | 2.1.9, 2.2, all versions from 2.3.0 until 3.0.1, head, debug, mingw, mswin |
|
| `ruby` | 2.0.0, 2.1.9, 2.2, all versions from 2.3.0 until 3.0.1, head, debug, mingw, mswin |
|
||||||
| `jruby` | 9.1.17.0, 9.2.9.0 - 9.2.17.0, head |
|
| `jruby` | 9.1.17.0, 9.2.9.0 - 9.2.19.0, head |
|
||||||
| `truffleruby` | 19.3.0 - 21.0.0, head |
|
| `truffleruby` | 19.3.0 - 21.1.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.
|
||||||
@@ -180,6 +180,20 @@ When there is no lockfile, one is generated with `bundle lock`, which is the sam
|
|||||||
In other words, it works exactly like `bundle install`.
|
In other words, it works exactly like `bundle install`.
|
||||||
The hash of the generated lockfile is then used for caching, which is the only correct approach.
|
The hash of the generated lockfile is then used for caching, which is the only correct approach.
|
||||||
|
|
||||||
|
#### Dealing with a corrupted cache
|
||||||
|
|
||||||
|
In some rare scenarios (like using gems with C extensions whose functionality depends on libraries found on the system
|
||||||
|
at the time of the gem's build) it may be necessary to ignore contents of the cache and get and build all the gems anew.
|
||||||
|
In order to achieve this, set the `cache-version` option to any value other than `0` (or change it to a new unique value
|
||||||
|
if you have already used it before.)
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
- uses: ruby/setup-ruby@v1
|
||||||
|
with:
|
||||||
|
bundler-cache: true
|
||||||
|
cache-version: 1
|
||||||
|
```
|
||||||
|
|
||||||
#### Caching `bundle install` manually
|
#### Caching `bundle install` manually
|
||||||
|
|
||||||
It is also possible to cache gems manually, but this is not recommended because it is verbose and *very difficult* to do correctly.
|
It is also possible to cache gems manually, but this is not recommended because it is verbose and *very difficult* to do correctly.
|
||||||
|
|||||||
@@ -24,6 +24,12 @@ inputs:
|
|||||||
description: 'The working directory to use for resolving paths for .ruby-version, .tool-versions and Gemfile.lock.'
|
description: 'The working directory to use for resolving paths for .ruby-version, .tool-versions and Gemfile.lock.'
|
||||||
required: false
|
required: false
|
||||||
default: '.'
|
default: '.'
|
||||||
|
cache-version:
|
||||||
|
description: |
|
||||||
|
Arbitrary string that will be added to the cache key of the bundler cache. Set or change it if you need
|
||||||
|
to invalidate the cache.
|
||||||
|
required: false
|
||||||
|
default: '0'
|
||||||
outputs:
|
outputs:
|
||||||
ruby-prefix:
|
ruby-prefix:
|
||||||
description: 'The prefix of the installed ruby'
|
description: 'The prefix of the installed ruby'
|
||||||
|
|||||||
+7
-4
@@ -5,6 +5,8 @@ const exec = require('@actions/exec')
|
|||||||
const cache = require('@actions/cache')
|
const cache = require('@actions/cache')
|
||||||
const common = require('./common')
|
const common = require('./common')
|
||||||
|
|
||||||
|
export const DEFAULT_CACHE_VERSION = '0'
|
||||||
|
|
||||||
// The returned gemfile is guaranteed to exist, the lockfile might not exist
|
// The returned gemfile is guaranteed to exist, the lockfile might not exist
|
||||||
export function detectGemfiles() {
|
export function detectGemfiles() {
|
||||||
const gemfilePath = process.env['BUNDLE_GEMFILE'] || 'Gemfile'
|
const gemfilePath = process.env['BUNDLE_GEMFILE'] || 'Gemfile'
|
||||||
@@ -95,7 +97,7 @@ export async function installBundler(bundlerVersionInput, lockFile, platform, ru
|
|||||||
return bundlerVersion
|
return bundlerVersion
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function bundleInstall(gemfile, lockFile, platform, engine, rubyVersion, bundlerVersion) {
|
export async function bundleInstall(gemfile, lockFile, platform, engine, rubyVersion, bundlerVersion, cacheVersion) {
|
||||||
if (gemfile === null) {
|
if (gemfile === null) {
|
||||||
console.log('Could not determine gemfile path, skipping "bundle install" and caching')
|
console.log('Could not determine gemfile path, skipping "bundle install" and caching')
|
||||||
return false
|
return false
|
||||||
@@ -128,7 +130,7 @@ export async function bundleInstall(gemfile, lockFile, platform, engine, rubyVer
|
|||||||
|
|
||||||
// cache key
|
// cache key
|
||||||
const paths = [cachePath]
|
const paths = [cachePath]
|
||||||
const baseKey = await computeBaseKey(platform, engine, rubyVersion, lockFile)
|
const baseKey = await computeBaseKey(platform, engine, rubyVersion, lockFile, cacheVersion)
|
||||||
const key = `${baseKey}-${await common.hashFile(lockFile)}`
|
const key = `${baseKey}-${await common.hashFile(lockFile)}`
|
||||||
// If only Gemfile.lock changes we can reuse part of the cache, and clean old gem versions below
|
// If only Gemfile.lock changes we can reuse part of the cache, and clean old gem versions below
|
||||||
const restoreKeys = [`${baseKey}-`]
|
const restoreKeys = [`${baseKey}-`]
|
||||||
@@ -177,8 +179,9 @@ export async function bundleInstall(gemfile, lockFile, platform, engine, rubyVer
|
|||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
async function computeBaseKey(platform, engine, version, lockFile) {
|
async function computeBaseKey(platform, engine, version, lockFile, cacheVersion) {
|
||||||
let key = `setup-ruby-bundler-cache-v3-${platform}-${engine}-${version}`
|
const cacheVersionSuffix = DEFAULT_CACHE_VERSION === cacheVersion ? '' : `-cachever:${cacheVersion}`
|
||||||
|
let key = `setup-ruby-bundler-cache-v3-${platform}-${engine}-${version}${cacheVersionSuffix}`
|
||||||
|
|
||||||
if (engine !== 'jruby' && common.isHeadVersion(version)) {
|
if (engine !== 'jruby' && common.isHeadVersion(version)) {
|
||||||
let revision = '';
|
let revision = '';
|
||||||
|
|||||||
+24
-17
@@ -27753,10 +27753,10 @@ const rubyInstallerVersions = __webpack_require__(223).versions
|
|||||||
|
|
||||||
const drive = common.drive
|
const drive = common.drive
|
||||||
|
|
||||||
// needed for 2.1, 2.2, 2.3, and mswin, cert file used by Git for Windows
|
// needed for 2.0-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'
|
||||||
|
|
||||||
// location & path for old RubyInstaller DevKit (MSYS), Ruby 2.1, 2.2 and 2.3
|
// location & path for old RubyInstaller DevKit (MSYS), Ruby 2.0-2.3
|
||||||
const msys = `${drive}:\\DevKit64`
|
const msys = `${drive}:\\DevKit64`
|
||||||
const msysPathEntries = [`${msys}\\mingw\\x86_64-w64-mingw32\\bin`, `${msys}\\mingw\\bin`, `${msys}\\bin`]
|
const msysPathEntries = [`${msys}\\mingw\\x86_64-w64-mingw32\\bin`, `${msys}\\mingw\\bin`, `${msys}\\bin`]
|
||||||
|
|
||||||
@@ -27822,7 +27822,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\.[123]/)) {
|
if (version.match(/^2\.[0123]/)) {
|
||||||
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
|
||||||
@@ -27831,9 +27831,9 @@ async function setupMingw(version) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Ruby 2.1, 2.2 and 2.3
|
// Ruby 2.0, 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://github.com/oneclick/rubyinstaller/releases/download/devkit-4.7.2/DevKit-mingw64-64-4.7.2-20130224-1432-sfx.exe'
|
||||||
const downloadPath = await tc.downloadTool(url)
|
const downloadPath = await tc.downloadTool(url)
|
||||||
await exec.exec('7z', ['x', downloadPath, `-o${msys}`], { silent: true })
|
await exec.exec('7z', ['x', downloadPath, `-o${msys}`], { silent: true })
|
||||||
|
|
||||||
@@ -28202,11 +28202,12 @@ exports.debug = debug; // for test
|
|||||||
__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.0.0": "https://github.com/oneclick/rubyinstaller/releases/download/ruby-2.0.0-p648/ruby-2.0.0-p648-x64-mingw32.7z",
|
||||||
"2.2.6": "https://dl.bintray.com/oneclick/rubyinstaller/ruby-2.2.6-x64-mingw32.7z",
|
"2.1.9": "https://github.com/oneclick/rubyinstaller/releases/download/ruby-2.1.9/ruby-2.1.9-x64-mingw32.7z",
|
||||||
"2.3.0": "https://dl.bintray.com/oneclick/rubyinstaller/ruby-2.3.0-x64-mingw32.7z",
|
"2.2.6": "https://github.com/oneclick/rubyinstaller/releases/download/ruby-2.2.6/ruby-2.2.6-x64-mingw32.7z",
|
||||||
"2.3.1": "https://dl.bintray.com/oneclick/rubyinstaller/ruby-2.3.1-x64-mingw32.7z",
|
"2.3.0": "https://github.com/oneclick/rubyinstaller/releases/download/ruby-2.3.0/ruby-2.3.0-x64-mingw32.7z",
|
||||||
"2.3.3": "https://dl.bintray.com/oneclick/rubyinstaller/ruby-2.3.3-x64-mingw32.7z",
|
"2.3.1": "https://github.com/oneclick/rubyinstaller/releases/download/ruby-2.3.1/ruby-2.3.1-x64-mingw32.7z",
|
||||||
|
"2.3.3": "https://github.com/oneclick/rubyinstaller/releases/download/ruby-2.3.3/ruby-2.3.3-x64-mingw32.7z",
|
||||||
"2.4.1": "https://github.com/oneclick/rubyinstaller2/releases/download/2.4.1-2/rubyinstaller-2.4.1-2-x64.7z",
|
"2.4.1": "https://github.com/oneclick/rubyinstaller2/releases/download/2.4.1-2/rubyinstaller-2.4.1-2-x64.7z",
|
||||||
"2.4.2": "https://github.com/oneclick/rubyinstaller2/releases/download/rubyinstaller-2.4.2-2/rubyinstaller-2.4.2-2-x64.7z",
|
"2.4.2": "https://github.com/oneclick/rubyinstaller2/releases/download/rubyinstaller-2.4.2-2/rubyinstaller-2.4.2-2-x64.7z",
|
||||||
"2.4.3": "https://github.com/oneclick/rubyinstaller2/releases/download/rubyinstaller-2.4.3-2/rubyinstaller-2.4.3-2-x64.7z",
|
"2.4.3": "https://github.com/oneclick/rubyinstaller2/releases/download/rubyinstaller-2.4.3-2/rubyinstaller-2.4.3-2-x64.7z",
|
||||||
@@ -44537,6 +44538,7 @@ module.exports = require("net");
|
|||||||
|
|
||||||
"use strict";
|
"use strict";
|
||||||
__webpack_require__.r(__webpack_exports__);
|
__webpack_require__.r(__webpack_exports__);
|
||||||
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DEFAULT_CACHE_VERSION", function() { return DEFAULT_CACHE_VERSION; });
|
||||||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "detectGemfiles", function() { return detectGemfiles; });
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "detectGemfiles", function() { return detectGemfiles; });
|
||||||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "installBundler", function() { return installBundler; });
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "installBundler", function() { return installBundler; });
|
||||||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "bundleInstall", function() { return bundleInstall; });
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "bundleInstall", function() { return bundleInstall; });
|
||||||
@@ -44547,6 +44549,8 @@ const exec = __webpack_require__(514)
|
|||||||
const cache = __webpack_require__(799)
|
const cache = __webpack_require__(799)
|
||||||
const common = __webpack_require__(390)
|
const common = __webpack_require__(390)
|
||||||
|
|
||||||
|
const DEFAULT_CACHE_VERSION = '0'
|
||||||
|
|
||||||
// The returned gemfile is guaranteed to exist, the lockfile might not exist
|
// The returned gemfile is guaranteed to exist, the lockfile might not exist
|
||||||
function detectGemfiles() {
|
function detectGemfiles() {
|
||||||
const gemfilePath = process.env['BUNDLE_GEMFILE'] || 'Gemfile'
|
const gemfilePath = process.env['BUNDLE_GEMFILE'] || 'Gemfile'
|
||||||
@@ -44637,7 +44641,7 @@ async function installBundler(bundlerVersionInput, lockFile, platform, rubyPrefi
|
|||||||
return bundlerVersion
|
return bundlerVersion
|
||||||
}
|
}
|
||||||
|
|
||||||
async function bundleInstall(gemfile, lockFile, platform, engine, rubyVersion, bundlerVersion) {
|
async function bundleInstall(gemfile, lockFile, platform, engine, rubyVersion, bundlerVersion, cacheVersion) {
|
||||||
if (gemfile === null) {
|
if (gemfile === null) {
|
||||||
console.log('Could not determine gemfile path, skipping "bundle install" and caching')
|
console.log('Could not determine gemfile path, skipping "bundle install" and caching')
|
||||||
return false
|
return false
|
||||||
@@ -44670,7 +44674,7 @@ async function bundleInstall(gemfile, lockFile, platform, engine, rubyVersion, b
|
|||||||
|
|
||||||
// cache key
|
// cache key
|
||||||
const paths = [cachePath]
|
const paths = [cachePath]
|
||||||
const baseKey = await computeBaseKey(platform, engine, rubyVersion, lockFile)
|
const baseKey = await computeBaseKey(platform, engine, rubyVersion, lockFile, cacheVersion)
|
||||||
const key = `${baseKey}-${await common.hashFile(lockFile)}`
|
const key = `${baseKey}-${await common.hashFile(lockFile)}`
|
||||||
// If only Gemfile.lock changes we can reuse part of the cache, and clean old gem versions below
|
// If only Gemfile.lock changes we can reuse part of the cache, and clean old gem versions below
|
||||||
const restoreKeys = [`${baseKey}-`]
|
const restoreKeys = [`${baseKey}-`]
|
||||||
@@ -44719,8 +44723,9 @@ async function bundleInstall(gemfile, lockFile, platform, engine, rubyVersion, b
|
|||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
async function computeBaseKey(platform, engine, version, lockFile) {
|
async function computeBaseKey(platform, engine, version, lockFile, cacheVersion) {
|
||||||
let key = `setup-ruby-bundler-cache-v3-${platform}-${engine}-${version}`
|
const cacheVersionSuffix = DEFAULT_CACHE_VERSION === cacheVersion ? '' : `-cachever:${cacheVersion}`
|
||||||
|
let key = `setup-ruby-bundler-cache-v3-${platform}-${engine}-${version}${cacheVersionSuffix}`
|
||||||
|
|
||||||
if (engine !== 'jruby' && common.isHeadVersion(version)) {
|
if (engine !== 'jruby' && common.isHeadVersion(version)) {
|
||||||
let revision = '';
|
let revision = '';
|
||||||
@@ -45350,6 +45355,7 @@ __webpack_require__.r(__webpack_exports__);
|
|||||||
function getVersions(platform) {
|
function getVersions(platform) {
|
||||||
const versions = {
|
const versions = {
|
||||||
"ruby": [
|
"ruby": [
|
||||||
|
"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",
|
||||||
@@ -45362,13 +45368,13 @@ 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.13.0", "9.2.14.0", "9.2.15.0", "9.2.16.0", "9.2.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",
|
||||||
"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.0.0", "21.1.0",
|
||||||
"head"
|
"head"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@@ -52071,6 +52077,7 @@ const inputDefaults = {
|
|||||||
'bundler': 'default',
|
'bundler': 'default',
|
||||||
'bundler-cache': 'true',
|
'bundler-cache': 'true',
|
||||||
'working-directory': '.',
|
'working-directory': '.',
|
||||||
|
'cache-version': bundler.DEFAULT_CACHE_VERSION,
|
||||||
}
|
}
|
||||||
|
|
||||||
// entry point when this action is run on its own
|
// entry point when this action is run on its own
|
||||||
@@ -52126,7 +52133,7 @@ async function setupRuby(options = {}) {
|
|||||||
|
|
||||||
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))
|
bundler.bundleInstall(gemfile, lockFile, platform, engine, version, bundlerVersion, inputs['cache-version']))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ require 'net/http'
|
|||||||
require 'yaml'
|
require 'yaml'
|
||||||
require 'json'
|
require 'json'
|
||||||
|
|
||||||
min_requirements = ['~> 2.1.9', '>= 2.2.6'].map { |req| Gem::Requirement.new(req) }
|
min_requirements = ['~> 2.0.0', '~> 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)
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ const inputDefaults = {
|
|||||||
'bundler': 'default',
|
'bundler': 'default',
|
||||||
'bundler-cache': 'true',
|
'bundler-cache': 'true',
|
||||||
'working-directory': '.',
|
'working-directory': '.',
|
||||||
|
'cache-version': bundler.DEFAULT_CACHE_VERSION,
|
||||||
}
|
}
|
||||||
|
|
||||||
// entry point when this action is run on its own
|
// entry point when this action is run on its own
|
||||||
@@ -67,7 +68,7 @@ export async function setupRuby(options = {}) {
|
|||||||
|
|
||||||
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))
|
bundler.bundleInstall(gemfile, lockFile, platform, engine, version, bundlerVersion, inputs['cache-version']))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
export function getVersions(platform) {
|
export function getVersions(platform) {
|
||||||
const versions = {
|
const versions = {
|
||||||
"ruby": [
|
"ruby": [
|
||||||
|
"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",
|
||||||
@@ -13,13 +14,13 @@ 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.13.0", "9.2.14.0", "9.2.15.0", "9.2.16.0", "9.2.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",
|
||||||
"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.0.0", "21.1.0",
|
||||||
"head"
|
"head"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
+6
-5
@@ -1,9 +1,10 @@
|
|||||||
export const versions = {
|
export const versions = {
|
||||||
"2.1.9": "https://dl.bintray.com/oneclick/rubyinstaller/ruby-2.1.9-x64-mingw32.7z",
|
"2.0.0": "https://github.com/oneclick/rubyinstaller/releases/download/ruby-2.0.0-p648/ruby-2.0.0-p648-x64-mingw32.7z",
|
||||||
"2.2.6": "https://dl.bintray.com/oneclick/rubyinstaller/ruby-2.2.6-x64-mingw32.7z",
|
"2.1.9": "https://github.com/oneclick/rubyinstaller/releases/download/ruby-2.1.9/ruby-2.1.9-x64-mingw32.7z",
|
||||||
"2.3.0": "https://dl.bintray.com/oneclick/rubyinstaller/ruby-2.3.0-x64-mingw32.7z",
|
"2.2.6": "https://github.com/oneclick/rubyinstaller/releases/download/ruby-2.2.6/ruby-2.2.6-x64-mingw32.7z",
|
||||||
"2.3.1": "https://dl.bintray.com/oneclick/rubyinstaller/ruby-2.3.1-x64-mingw32.7z",
|
"2.3.0": "https://github.com/oneclick/rubyinstaller/releases/download/ruby-2.3.0/ruby-2.3.0-x64-mingw32.7z",
|
||||||
"2.3.3": "https://dl.bintray.com/oneclick/rubyinstaller/ruby-2.3.3-x64-mingw32.7z",
|
"2.3.1": "https://github.com/oneclick/rubyinstaller/releases/download/ruby-2.3.1/ruby-2.3.1-x64-mingw32.7z",
|
||||||
|
"2.3.3": "https://github.com/oneclick/rubyinstaller/releases/download/ruby-2.3.3/ruby-2.3.3-x64-mingw32.7z",
|
||||||
"2.4.1": "https://github.com/oneclick/rubyinstaller2/releases/download/2.4.1-2/rubyinstaller-2.4.1-2-x64.7z",
|
"2.4.1": "https://github.com/oneclick/rubyinstaller2/releases/download/2.4.1-2/rubyinstaller-2.4.1-2-x64.7z",
|
||||||
"2.4.2": "https://github.com/oneclick/rubyinstaller2/releases/download/rubyinstaller-2.4.2-2/rubyinstaller-2.4.2-2-x64.7z",
|
"2.4.2": "https://github.com/oneclick/rubyinstaller2/releases/download/rubyinstaller-2.4.2-2/rubyinstaller-2.4.2-2-x64.7z",
|
||||||
"2.4.3": "https://github.com/oneclick/rubyinstaller2/releases/download/rubyinstaller-2.4.3-2/rubyinstaller-2.4.3-2-x64.7z",
|
"2.4.3": "https://github.com/oneclick/rubyinstaller2/releases/download/rubyinstaller-2.4.3-2/rubyinstaller-2.4.3-2-x64.7z",
|
||||||
|
|||||||
+5
-5
@@ -13,10 +13,10 @@ const rubyInstallerVersions = require('./windows-versions').versions
|
|||||||
|
|
||||||
const drive = common.drive
|
const drive = common.drive
|
||||||
|
|
||||||
// needed for 2.1, 2.2, 2.3, and mswin, cert file used by Git for Windows
|
// needed for 2.0-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'
|
||||||
|
|
||||||
// location & path for old RubyInstaller DevKit (MSYS), Ruby 2.1, 2.2 and 2.3
|
// location & path for old RubyInstaller DevKit (MSYS), Ruby 2.0-2.3
|
||||||
const msys = `${drive}:\\DevKit64`
|
const msys = `${drive}:\\DevKit64`
|
||||||
const msysPathEntries = [`${msys}\\mingw\\x86_64-w64-mingw32\\bin`, `${msys}\\mingw\\bin`, `${msys}\\bin`]
|
const msysPathEntries = [`${msys}\\mingw\\x86_64-w64-mingw32\\bin`, `${msys}\\mingw\\bin`, `${msys}\\bin`]
|
||||||
|
|
||||||
@@ -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\.[123]/)) {
|
if (version.match(/^2\.[0123]/)) {
|
||||||
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
|
||||||
@@ -91,9 +91,9 @@ async function setupMingw(version) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Ruby 2.1, 2.2 and 2.3
|
// Ruby 2.0, 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://github.com/oneclick/rubyinstaller/releases/download/devkit-4.7.2/DevKit-mingw64-64-4.7.2-20130224-1432-sfx.exe'
|
||||||
const downloadPath = await tc.downloadTool(url)
|
const downloadPath = await tc.downloadTool(url)
|
||||||
await exec.exec('7z', ['x', downloadPath, `-o${msys}`], { silent: true })
|
await exec.exec('7z', ['x', downloadPath, `-o${msys}`], { silent: true })
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user