Compare commits

..
8 Commits
Author SHA1 Message Date
Benoit Daloze 30011b6444 Cleanup PATH for JRuby on Windows
* That way we remove the default Ruby in PATH which was confusing.
2020-02-08 22:14:50 +01:00
Benoit Daloze f422c055c3 Add support for Ruby 2.2
* Use Ruby 2.2.6 from RubyInstaller on Windows since there is no more
  recent release of Ruby 2.2.
2020-02-06 15:20:13 +01:00
Benoit Daloze a01ba37375 Follow builder repositories transfers 2020-02-06 13:21:29 +01:00
Benoit Daloze fdfc519f55 Clarify the maintainer now that the repo moved 2020-02-06 13:18:40 +01:00
Benoit Daloze 480f78f4b6 Compare with actions/setup-ruby 2020-02-06 13:15:21 +01:00
Benoit Daloze 48efd73814 Follow repository transfer and rename 2020-02-06 13:09:38 +01:00
Benoit Daloze 5478747ea7 Add a line about the move and rename 2020-02-06 13:02:38 +01:00
Samuel Williams 8a173f1bc2 Change title to reflect new home. 2020-02-07 01:00:48 +13:00
10 changed files with 67 additions and 42 deletions
+2 -2
View File
@@ -14,7 +14,7 @@ jobs:
matrix: matrix:
os: [ ubuntu-16.04, ubuntu-18.04, macos-latest, windows-latest ] os: [ ubuntu-16.04, ubuntu-18.04, macos-latest, windows-latest ]
# Use various version syntaxes here for testing # Use various version syntaxes here for testing
ruby: [ .ruby-version, 2.3, 2.7.0, ruby-head, jruby, truffleruby, truffleruby-head, rubinius ] ruby: [ .ruby-version, 2.2, 2.3, 2.7.0, ruby-head, jruby, truffleruby, truffleruby-head, rubinius ]
exclude: exclude:
- os: windows-latest - os: windows-latest
ruby: truffleruby ruby: truffleruby
@@ -34,7 +34,7 @@ jobs:
ruby-version: ${{ matrix.ruby }} ruby-version: ${{ matrix.ruby }}
- run: ruby --version - run: ruby --version
- run: ridk version - run: ridk version
if: matrix.os == 'windows-latest' && !startsWith(matrix.ruby, '2.3') if: matrix.os == 'windows-latest' && !startsWith(matrix.ruby, 'jruby') && !startsWith(matrix.ruby, '2.3') && !startsWith(matrix.ruby, '2.2')
- name: Subprocess test - name: Subprocess test
run: ruby test_subprocess.rb run: ruby test_subprocess.rb
- name: OpenSSL version - name: OpenSSL version
+15 -8
View File
@@ -1,24 +1,30 @@
# use-ruby-action # setup-ruby
Note: this action used to be at `eregon/use-ruby-action` and was moved to the `ruby` organization.
This action downloads a prebuilt ruby and adds it to the `PATH`. This action downloads a prebuilt ruby and adds it to the `PATH`.
It is very efficient and takes about 5 seconds to download, extract and add the given Ruby to the `PATH`. It is very efficient and takes about 5 seconds to download, extract and add the given Ruby to the `PATH`.
No extra packages need to be installed. No extra packages need to be installed.
Compared to [actions/setup-ruby](https://github.com/actions/setup-ruby),
this actions supports many more versions and features.
### Supported Versions ### Supported Versions
This action currently supports these versions of MRI, JRuby and TruffleRuby: This action currently supports these versions of MRI, JRuby and TruffleRuby:
| Interpreter | Versions | | Interpreter | Versions |
| ----------- | -------- | | ----------- | -------- |
| Ruby | 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 | | 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 |
| JRuby | 9.2.9.0 | | JRuby | 9.2.9.0 |
| TruffleRuby | 19.3.0, 19.3.1, head | | TruffleRuby | 19.3.0, 19.3.1, head |
| Rubinius | 4.14 | | Rubinius | 4.14 |
Note that Ruby 2.3 and the OpenSSL version it needs (1.0.2) are both end-of-life, Note that Ruby 2.3 and the OpenSSL version it needs (1.0.2) are both end-of-life,
which means Ruby 2.3 is unmaintained and considered insecure. which means Ruby 2.3 is unmaintained and considered insecure.
On Windows, Ruby 2.4 uses OpenSSL 1.0.2, which is no longer maintained. On Windows, Ruby 2.4 uses OpenSSL 1.0.2, which is no longer maintained.
Ruby 2.2 resolves to 2.2.6 on Windows (last build from RubyInstaller) and 2.2.10 otherwise.
### Supported Platforms ### Supported Platforms
@@ -32,9 +38,9 @@ The action works for all [GitHub-hosted runners](https://help.github.com/en/acti
Rubinius is only available on `ubuntu-latest`. Rubinius is only available on `ubuntu-latest`.
The prebuilt releases are generated by [ruby-builder](https://github.com/eregon/ruby-builder) The prebuilt releases are generated by [ruby-builder](https://github.com/ruby/ruby-builder)
and on Windows by [RubyInstaller2](https://github.com/oneclick/rubyinstaller2). and on Windows by [RubyInstaller2](https://github.com/oneclick/rubyinstaller2).
`ruby-head` is generated by [ruby-dev-builder](https://github.com/eregon/ruby-dev-builder) and `truffleruby-head` is generated by [truffleruby-dev-builder](https://github.com/eregon/truffleruby-dev-builder). `ruby-head` is generated by [ruby-dev-builder](https://github.com/ruby/ruby-dev-builder) and `truffleruby-head` is generated by [truffleruby-dev-builder](https://github.com/ruby/truffleruby-dev-builder).
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.
@@ -50,7 +56,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- uses: eregon/use-ruby-action@v1 - uses: ruby/setup-ruby@v1
with: with:
ruby-version: 2.6 ruby-version: 2.6
- run: ruby -v - run: ruby -v
@@ -73,7 +79,7 @@ jobs:
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- uses: eregon/use-ruby-action@v1 - uses: ruby/setup-ruby@v1
with: with:
ruby-version: ${{ matrix.ruby }} ruby-version: ${{ matrix.ruby }}
- run: ruby -v - run: ruby -v
@@ -128,5 +134,6 @@ This follows the [recommendations](https://github.com/actions/toolkit/blob/maste
## Credits ## Credits
The current maintainer of this action is @eregon.
Most of the Windows logic is from https://github.com/MSP-Greg/actions-ruby by MSP-Greg. Most of the Windows logic is from https://github.com/MSP-Greg/actions-ruby by MSP-Greg.
Many thanks to MSP-Greg and Lars Kanis for the help with Ruby Installer. Many thanks to MSP-Greg and Lars Kanis for the help with Ruby Installer.
Generated Vendored
+22 -13
View File
@@ -1448,7 +1448,7 @@ function validateRubyEngineAndVersion(platform, engineVersions, engine, version)
} else { } else {
throw new Error(`Unknown version ${version} for ${engine} on ${platform} throw new Error(`Unknown version ${version} for ${engine} on ${platform}
available versions for ${engine} on ${platform}: ${engineVersions.join(', ')} available versions for ${engine} on ${platform}: ${engineVersions.join(', ')}
File an issue at https://github.com/eregon/use-ruby-action/issues if would like support for a new version`) File an issue at https://github.com/ruby/setup-ruby/issues if would like support for a new version`)
} }
} }
@@ -2145,6 +2145,7 @@ __webpack_require__.r(__webpack_exports__);
function getVersions(platform) { function getVersions(platform) {
const versions = { const versions = {
"ruby": [ "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.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.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.5.0", "2.5.1", "2.5.2", "2.5.3", "2.5.4", "2.5.5", "2.5.6", "2.5.7",
@@ -5103,6 +5104,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.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",
"2.3.3": "https://dl.bintray.com/oneclick/rubyinstaller/ruby-2.3.3-x64-mingw32.7z", "2.3.3": "https://dl.bintray.com/oneclick/rubyinstaller/ruby-2.3.3-x64-mingw32.7z",
@@ -5149,7 +5151,7 @@ const rubyBuilderVersions = __webpack_require__(156)
const axios = __webpack_require__(53) const axios = __webpack_require__(53)
const builderReleaseTag = 'builds-no-warn' const builderReleaseTag = 'builds-no-warn'
const releasesURL = 'https://github.com/eregon/ruby-builder/releases' const releasesURL = 'https://github.com/ruby/ruby-builder/releases'
function getAvailableVersions(platform, engine) { function getAvailableVersions(platform, engine) {
return rubyBuilderVersions.getVersions(platform)[engine] return rubyBuilderVersions.getVersions(platform)[engine]
@@ -5158,9 +5160,13 @@ function getAvailableVersions(platform, engine) {
async function install(platform, ruby) { async function install(platform, ruby) {
const rubyPrefix = await downloadAndExtract(platform, ruby) const rubyPrefix = await downloadAndExtract(platform, ruby)
core.addPath(path.join(rubyPrefix, 'bin')) if (platform === 'windows-latest') {
if (ruby.startsWith('rubinius')) { __webpack_require__(826).setupPath(undefined, rubyPrefix)
core.addPath(path.join(rubyPrefix, 'gems', 'bin')) } else {
core.addPath(path.join(rubyPrefix, 'bin'))
if (ruby.startsWith('rubinius')) {
core.addPath(path.join(rubyPrefix, 'gems', 'bin'))
}
} }
return rubyPrefix return rubyPrefix
@@ -5189,7 +5195,7 @@ async function getDownloadURL(platform, ruby) {
async function getLatestHeadBuildURL(platform, ruby) { async function getLatestHeadBuildURL(platform, ruby) {
const engine = ruby.split('-')[0] const engine = ruby.split('-')[0]
const repository = `eregon/${engine}-dev-builder` const repository = `ruby/${engine}-dev-builder`
const metadataURL = `https://raw.githubusercontent.com/${repository}/metadata/latest_build.tag` const metadataURL = `https://raw.githubusercontent.com/${repository}/metadata/latest_build.tag`
const releasesURL = `https://github.com/${repository}/releases/download` const releasesURL = `https://github.com/${repository}/releases/download`
@@ -7858,6 +7864,7 @@ module.exports = function mergeConfig(config1, config2) {
__webpack_require__.r(__webpack_exports__); __webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getAvailableVersions", function() { return getAvailableVersions; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getAvailableVersions", function() { return getAvailableVersions; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "install", function() { return install; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "install", function() { return install; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setupPath", function() { return setupPath; });
// Most of this logic is from // Most of this logic is from
// https://github.com/MSP-Greg/actions-ruby/blob/master/lib/main.js // https://github.com/MSP-Greg/actions-ruby/blob/master/lib/main.js
@@ -7885,7 +7892,7 @@ async function install(platform, ruby) {
} }
const base = url.slice(url.lastIndexOf('/') + 1, url.length - '.7z'.length) const base = url.slice(url.lastIndexOf('/') + 1, url.length - '.7z'.length)
// Extract to SSD, see https://github.com/eregon/use-ruby-action/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]
const downloadPath = await tc.downloadTool(url) const downloadPath = await tc.downloadTool(url)
@@ -7893,10 +7900,9 @@ async function install(platform, ruby) {
const rubyPrefix = `${drive}:\\${base}` const rubyPrefix = `${drive}:\\${base}`
const [hostedRuby, msys2] = await linkMSYS2() const [hostedRuby, msys2] = await linkMSYS2()
const newPath = setupPath(msys2, rubyPrefix) setupPath(msys2, rubyPrefix)
core.exportVariable('PATH', newPath)
if (version.startsWith('2.3')) { if (version.startsWith('2.2') || version.startsWith('2.3')) {
core.exportVariable('SSL_CERT_FILE', `${hostedRuby}\\ssl\\cert.pem`) core.exportVariable('SSL_CERT_FILE', `${hostedRuby}\\ssl\\cert.pem`)
} }
@@ -7931,13 +7937,16 @@ function setupPath(msys2, rubyPrefix) {
// Remove default Ruby in PATH // Remove default Ruby in PATH
path = path.filter(e => !e.match(/\bRuby\b/)) path = path.filter(e => !e.match(/\bRuby\b/))
// Add MSYS2 in PATH if (msys2) {
path.unshift(`${msys2}\\mingw64\\bin`, `${msys2}\\usr\\bin`) // Add MSYS2 in PATH
path.unshift(`${msys2}\\mingw64\\bin`, `${msys2}\\usr\\bin`)
}
// Add the downloaded Ruby in PATH // Add the downloaded Ruby in PATH
path.unshift(`${rubyPrefix}\\bin`) path.unshift(`${rubyPrefix}\\bin`)
return path.join(';') const newPath = path.join(';')
core.exportVariable('PATH', newPath)
} }
+2 -1
View File
@@ -2,6 +2,7 @@ require 'net/http'
require 'yaml' require 'yaml'
require 'json' require 'json'
min_version = '2.2.6'
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)
@@ -18,7 +19,7 @@ versions = entries.select { |entry|
}.sort_by { |version, entry| }.sort_by { |version, entry|
version version
}.select { |version, entry| }.select { |version, entry|
version >= "2.3" Gem::Version.new(version) >= Gem::Version.new(min_version)
}.map { |version, entry| }.map { |version, entry|
[version, entry[:href]] [version, entry[:href]]
}.to_h }.to_h
+1 -1
View File
@@ -57,7 +57,7 @@ function validateRubyEngineAndVersion(platform, engineVersions, engine, version)
} else { } else {
throw new Error(`Unknown version ${version} for ${engine} on ${platform} throw new Error(`Unknown version ${version} for ${engine} on ${platform}
available versions for ${engine} on ${platform}: ${engineVersions.join(', ')} available versions for ${engine} on ${platform}: ${engineVersions.join(', ')}
File an issue at https://github.com/eregon/use-ruby-action/issues if would like support for a new version`) File an issue at https://github.com/ruby/setup-ruby/issues if would like support for a new version`)
} }
} }
+4 -4
View File
@@ -1,5 +1,5 @@
{ {
"name": "use-ruby-action", "name": "setup-ruby",
"version": "0.1.0", "version": "0.1.0",
"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",
@@ -9,7 +9,7 @@
}, },
"repository": { "repository": {
"type": "git", "type": "git",
"url": "git+https://github.com/eregon/use-ruby-action.git" "url": "git+https://github.com/ruby/setup-ruby.git"
}, },
"keywords": [ "keywords": [
"GitHub", "GitHub",
@@ -19,9 +19,9 @@
"author": "Benoit Daloze", "author": "Benoit Daloze",
"license": "MIT", "license": "MIT",
"bugs": { "bugs": {
"url": "https://github.com/eregon/use-ruby-action/issues" "url": "https://github.com/ruby/setup-ruby/issues"
}, },
"homepage": "https://github.com/eregon/use-ruby-action", "homepage": "https://github.com/ruby/setup-ruby",
"dependencies": { "dependencies": {
"@actions/core": "^1.1.1", "@actions/core": "^1.1.1",
"@actions/exec": "^1.0.1", "@actions/exec": "^1.0.1",
+1
View File
@@ -1,6 +1,7 @@
export function getVersions(platform) { export function getVersions(platform) {
const versions = { const versions = {
"ruby": [ "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.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.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.5.0", "2.5.1", "2.5.2", "2.5.3", "2.5.4", "2.5.5", "2.5.6", "2.5.7",
+9 -5
View File
@@ -7,7 +7,7 @@ const rubyBuilderVersions = require('./ruby-builder-versions')
const axios = require('axios') const axios = require('axios')
const builderReleaseTag = 'builds-no-warn' const builderReleaseTag = 'builds-no-warn'
const releasesURL = 'https://github.com/eregon/ruby-builder/releases' const releasesURL = 'https://github.com/ruby/ruby-builder/releases'
export function getAvailableVersions(platform, engine) { export function getAvailableVersions(platform, engine) {
return rubyBuilderVersions.getVersions(platform)[engine] return rubyBuilderVersions.getVersions(platform)[engine]
@@ -16,9 +16,13 @@ export function getAvailableVersions(platform, engine) {
export async function install(platform, ruby) { export async function install(platform, ruby) {
const rubyPrefix = await downloadAndExtract(platform, ruby) const rubyPrefix = await downloadAndExtract(platform, ruby)
core.addPath(path.join(rubyPrefix, 'bin')) if (platform === 'windows-latest') {
if (ruby.startsWith('rubinius')) { require('./windows').setupPath(undefined, rubyPrefix)
core.addPath(path.join(rubyPrefix, 'gems', 'bin')) } else {
core.addPath(path.join(rubyPrefix, 'bin'))
if (ruby.startsWith('rubinius')) {
core.addPath(path.join(rubyPrefix, 'gems', 'bin'))
}
} }
return rubyPrefix return rubyPrefix
@@ -47,7 +51,7 @@ async function getDownloadURL(platform, ruby) {
async function getLatestHeadBuildURL(platform, ruby) { async function getLatestHeadBuildURL(platform, ruby) {
const engine = ruby.split('-')[0] const engine = ruby.split('-')[0]
const repository = `eregon/${engine}-dev-builder` const repository = `ruby/${engine}-dev-builder`
const metadataURL = `https://raw.githubusercontent.com/${repository}/metadata/latest_build.tag` const metadataURL = `https://raw.githubusercontent.com/${repository}/metadata/latest_build.tag`
const releasesURL = `https://github.com/${repository}/releases/download` const releasesURL = `https://github.com/${repository}/releases/download`
+1
View File
@@ -1,4 +1,5 @@
export const versions = { export const versions = {
"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",
"2.3.3": "https://dl.bintray.com/oneclick/rubyinstaller/ruby-2.3.3-x64-mingw32.7z", "2.3.3": "https://dl.bintray.com/oneclick/rubyinstaller/ruby-2.3.3-x64-mingw32.7z",
+10 -8
View File
@@ -25,7 +25,7 @@ export async function install(platform, ruby) {
} }
const base = url.slice(url.lastIndexOf('/') + 1, url.length - '.7z'.length) const base = url.slice(url.lastIndexOf('/') + 1, url.length - '.7z'.length)
// Extract to SSD, see https://github.com/eregon/use-ruby-action/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]
const downloadPath = await tc.downloadTool(url) const downloadPath = await tc.downloadTool(url)
@@ -33,10 +33,9 @@ export async function install(platform, ruby) {
const rubyPrefix = `${drive}:\\${base}` const rubyPrefix = `${drive}:\\${base}`
const [hostedRuby, msys2] = await linkMSYS2() const [hostedRuby, msys2] = await linkMSYS2()
const newPath = setupPath(msys2, rubyPrefix) setupPath(msys2, rubyPrefix)
core.exportVariable('PATH', newPath)
if (version.startsWith('2.3')) { if (version.startsWith('2.2') || version.startsWith('2.3')) {
core.exportVariable('SSL_CERT_FILE', `${hostedRuby}\\ssl\\cert.pem`) core.exportVariable('SSL_CERT_FILE', `${hostedRuby}\\ssl\\cert.pem`)
} }
@@ -62,7 +61,7 @@ async function linkMSYS2() {
return [latestHostedRuby, msys2] return [latestHostedRuby, msys2]
} }
function setupPath(msys2, rubyPrefix) { export function setupPath(msys2, rubyPrefix) {
let path = process.env['PATH'].split(';') let path = process.env['PATH'].split(';')
// Remove conflicting dev tools from PATH // Remove conflicting dev tools from PATH
@@ -71,11 +70,14 @@ function setupPath(msys2, rubyPrefix) {
// Remove default Ruby in PATH // Remove default Ruby in PATH
path = path.filter(e => !e.match(/\bRuby\b/)) path = path.filter(e => !e.match(/\bRuby\b/))
// Add MSYS2 in PATH if (msys2) {
path.unshift(`${msys2}\\mingw64\\bin`, `${msys2}\\usr\\bin`) // Add MSYS2 in PATH
path.unshift(`${msys2}\\mingw64\\bin`, `${msys2}\\usr\\bin`)
}
// Add the downloaded Ruby in PATH // Add the downloaded Ruby in PATH
path.unshift(`${rubyPrefix}\\bin`) path.unshift(`${rubyPrefix}\\bin`)
return path.join(';') const newPath = path.join(';')
core.exportVariable('PATH', newPath)
} }