Compare commits

...
3 Commits
Author SHA1 Message Date
Benoit Daloze 11238a2c00 Install Bundler at runtime if not already part of the stdlib
* This gives more flexibility to choose the Bundler version.
2020-03-31 22:23:11 +02:00
Benoit Daloze 1e2e6e19e3 Add the latest CRuby releases 2020-03-31 22:16:34 +02:00
Benoit Daloze a1c5b2a66c Switch to builds with --enable-shared and without Bundler pre-installed 2020-03-31 22:14:53 +02:00
6 changed files with 35 additions and 21 deletions
+1 -1
View File
@@ -17,7 +17,7 @@ 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.9, 2.5.0 - 2.5.7, 2.6.0 - 2.6.5, 2.7.0, head, mingw, mswin |
| 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, mingw, mswin |
| JRuby | 9.1.17.0, 9.2.9.0 - 9.2.11.1, head |
| TruffleRuby | 19.3.0 - 20.0.0, head |
| Rubinius | 4.14 |
Generated Vendored
+17 -10
View File
@@ -960,6 +960,7 @@ const os = __webpack_require__(87)
const fs = __webpack_require__(747)
const path = __webpack_require__(622)
const core = __webpack_require__(470)
const exec = __webpack_require__(986)
async function run() {
try {
@@ -981,6 +982,9 @@ async function run() {
const [rubyPrefix, newPathEntries] = await installer.install(platform, ruby)
setupPath(ruby, newPathEntries)
await installBundler(platform, rubyPrefix)
core.setOutput('ruby-prefix', rubyPrefix)
} catch (error) {
core.setFailed(error.message)
@@ -1065,6 +1069,14 @@ function setupPath(ruby, newPathEntries) {
core.exportVariable('PATH', [...newPathEntries, ...cleanPath].join(path.delimiter))
}
async function installBundler(platform, rubyPrefix) {
const bundle_exe = platform === 'windows-latest' ? 'bundle.cmd' : 'bundle'
// Install Bundler if not already part of the stdlib
if (!fs.existsSync(path.join(rubyPrefix, 'bin', bundle_exe))) {
await exec.exec(path.join(rubyPrefix, 'bin', 'gem'), ['install', 'bundler', '-v', '~> 1', '--no-document'])
}
}
function getVirtualEnvironmentName() {
const platform = os.platform()
if (platform === 'linux') {
@@ -1398,10 +1410,10 @@ function getVersions(platform) {
"ruby": [
"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.5.0", "2.5.1", "2.5.2", "2.5.3", "2.5.4", "2.5.5", "2.5.6", "2.5.7",
"2.6.0", "2.6.1", "2.6.2", "2.6.3", "2.6.4", "2.6.5",
"2.7.0",
"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.6.0", "2.6.1", "2.6.2", "2.6.3", "2.6.4", "2.6.5", "2.6.6",
"2.7.0", "2.7.1",
"head"
],
"jruby": [
@@ -3415,7 +3427,7 @@ const io = __webpack_require__(1)
const tc = __webpack_require__(533)
const rubyBuilderVersions = __webpack_require__(156)
const builderReleaseTag = 'builds-no-warn'
const builderReleaseTag = 'enable-shared'
const releasesURL = 'https://github.com/ruby/ruby-builder/releases'
function getAvailableVersions(platform, engine) {
@@ -4858,11 +4870,6 @@ async function install(platform, ruby) {
await setupMSWin() : await setupMingw(version)
const newPathEntries = [`${rubyPrefix}\\bin`, ...toolchainPaths]
// Install Bundler if needed
if (!fs.existsSync(`${rubyPrefix}\\bin\\bundle.cmd`)) {
await exec.exec(`${rubyPrefix}\\bin\\gem install bundler -v "~> 1" --no-document`)
}
return [rubyPrefix, newPathEntries]
}
+12
View File
@@ -2,6 +2,7 @@ const os = require('os')
const fs = require('fs')
const path = require('path')
const core = require('@actions/core')
const exec = require('@actions/exec')
export async function run() {
try {
@@ -23,6 +24,9 @@ export async function run() {
const [rubyPrefix, newPathEntries] = await installer.install(platform, ruby)
setupPath(ruby, newPathEntries)
await installBundler(platform, rubyPrefix)
core.setOutput('ruby-prefix', rubyPrefix)
} catch (error) {
core.setFailed(error.message)
@@ -107,6 +111,14 @@ function setupPath(ruby, newPathEntries) {
core.exportVariable('PATH', [...newPathEntries, ...cleanPath].join(path.delimiter))
}
async function installBundler(platform, rubyPrefix) {
const bundle_exe = platform === 'windows-latest' ? 'bundle.cmd' : 'bundle'
// Install Bundler if not already part of the stdlib
if (!fs.existsSync(path.join(rubyPrefix, 'bin', bundle_exe))) {
await exec.exec(path.join(rubyPrefix, 'bin', 'gem'), ['install', 'bundler', '-v', '~> 1', '--no-document'])
}
}
function getVirtualEnvironmentName() {
const platform = os.platform()
if (platform === 'linux') {
+4 -4
View File
@@ -3,10 +3,10 @@ export function getVersions(platform) {
"ruby": [
"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.5.0", "2.5.1", "2.5.2", "2.5.3", "2.5.4", "2.5.5", "2.5.6", "2.5.7",
"2.6.0", "2.6.1", "2.6.2", "2.6.3", "2.6.4", "2.6.5",
"2.7.0",
"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.6.0", "2.6.1", "2.6.2", "2.6.3", "2.6.4", "2.6.5", "2.6.6",
"2.7.0", "2.7.1",
"head"
],
"jruby": [
+1 -1
View File
@@ -5,7 +5,7 @@ const io = require('@actions/io')
const tc = require('@actions/tool-cache')
const rubyBuilderVersions = require('./ruby-builder-versions')
const builderReleaseTag = 'builds-no-warn'
const builderReleaseTag = 'enable-shared'
const releasesURL = 'https://github.com/ruby/ruby-builder/releases'
export function getAvailableVersions(platform, engine) {
-5
View File
@@ -50,11 +50,6 @@ export async function install(platform, ruby) {
await setupMSWin() : await setupMingw(version)
const newPathEntries = [`${rubyPrefix}\\bin`, ...toolchainPaths]
// Install Bundler if needed
if (!fs.existsSync(`${rubyPrefix}\\bin\\bundle.cmd`)) {
await exec.exec(`${rubyPrefix}\\bin\\gem install bundler -v "~> 1" --no-document`)
}
return [rubyPrefix, newPathEntries]
}