mirror of
https://github.com/ruby/setup-ruby.git
synced 2026-09-13 22:44:20 +02:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a01ba37375 | ||
|
|
fdfc519f55 | ||
|
|
480f78f4b6 | ||
|
|
48efd73814 | ||
|
|
5478747ea7 | ||
|
|
8a173f1bc2 | ||
|
|
48481806ad | ||
|
|
623e527949 | ||
|
|
c933cecfdc | ||
|
|
7c15ff8590 | ||
|
|
58366f2203 | ||
|
|
f5483241db | ||
|
|
0331c8b821 | ||
|
|
818f4eeb16 | ||
|
|
052cbd8ee4 | ||
|
|
001fd1b7c7 | ||
|
|
4d7199dbd0 | ||
|
|
5dd450999e | ||
|
|
3551d3fbd4 | ||
|
|
07160f610f | ||
|
|
0449254cae | ||
|
|
689f94552b | ||
|
|
db2d09d84c | ||
|
|
8b354c238c | ||
|
|
7f4c88c00b |
@@ -14,10 +14,18 @@ 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, ruby-2.4, 2.5, ruby-2.6.5, 2.7.0, jruby, truffleruby ]
|
ruby: [ .ruby-version, 2.3, 2.7.0, ruby-head, jruby, truffleruby, truffleruby-head, rubinius ]
|
||||||
exclude:
|
exclude:
|
||||||
- os: windows-latest
|
- os: windows-latest
|
||||||
ruby: truffleruby
|
ruby: truffleruby
|
||||||
|
- os: windows-latest
|
||||||
|
ruby: truffleruby-head
|
||||||
|
- os: ubuntu-16.04
|
||||||
|
ruby: rubinius
|
||||||
|
- os: macos-latest
|
||||||
|
ruby: rubinius
|
||||||
|
- os: windows-latest
|
||||||
|
ruby: rubinius
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
@@ -27,17 +35,17 @@ jobs:
|
|||||||
- 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, '2.3')
|
||||||
|
- name: Subprocess test
|
||||||
|
run: ruby test_subprocess.rb
|
||||||
- name: OpenSSL version
|
- name: OpenSSL version
|
||||||
run: ruby -ropenssl -e 'puts OpenSSL::OPENSSL_LIBRARY_VERSION'
|
run: ruby -ropenssl -e 'puts OpenSSL::OPENSSL_LIBRARY_VERSION'
|
||||||
if: matrix.os == 'windows-latest'
|
|
||||||
- name: OpenSSL test
|
- name: OpenSSL test
|
||||||
run: ruby -ropen-uri -e 'puts open(%{https://rubygems.org/}) { |f| f.read(1024) }'
|
run: ruby -ropen-uri -e 'puts open(%{https://rubygems.org/}) { |f| f.read(1024) }'
|
||||||
- name: C extension test
|
- name: C extension test
|
||||||
run: gem install json --no-document
|
run: gem install json:2.2.0 --no-document
|
||||||
- name: Bundler version
|
- run: bundle --version
|
||||||
run: bundle --version
|
- run: bundle install
|
||||||
- name: Bundler test
|
- run: bundle exec rake --version
|
||||||
run: bundle install
|
|
||||||
|
|
||||||
lint:
|
lint:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
# Used for testing
|
# Used for testing
|
||||||
source 'https://rubygems.org'
|
source 'https://rubygems.org'
|
||||||
|
|
||||||
|
gem "rake"
|
||||||
gem "path"
|
gem "path"
|
||||||
gem "json"
|
gem "json", "2.2.0"
|
||||||
|
|||||||
@@ -1,19 +1,25 @@
|
|||||||
# 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 |
|
| 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 |
|
||||||
| JRuby | 9.2.9.0 |
|
| JRuby | 9.2.9.0 |
|
||||||
| TruffleRuby | 19.3.0, 19.3.1 |
|
| TruffleRuby | 19.3.0, 19.3.1, head |
|
||||||
|
| 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.
|
||||||
@@ -29,10 +35,13 @@ The action works for all [GitHub-hosted runners](https://help.github.com/en/acti
|
|||||||
| macOS | `macos-latest` |
|
| macOS | `macos-latest` |
|
||||||
| Windows | `windows-latest` |
|
| Windows | `windows-latest` |
|
||||||
|
|
||||||
The prebuilt rubies are generated by [eregon/ruby-install-builder](https://github.com/eregon/ruby-install-builder)
|
Rubinius is only available on `ubuntu-latest`.
|
||||||
and on Windows by [RubyInstaller2](https://github.com/oneclick/rubyinstaller2).
|
|
||||||
The full list of available Ruby versions can be seen at [versions.json](https://github.com/eregon/ruby-install-builder/blob/metadata/versions.json)
|
The prebuilt releases are generated by [ruby-builder](https://github.com/ruby/ruby-builder)
|
||||||
for Ubuntu and macOS and at [ruby-installer-versions.js](https://github.com/eregon/use-ruby-action/blob/master/ruby-installer-versions.js) for Windows.
|
and on Windows by [RubyInstaller2](https://github.com/oneclick/rubyinstaller2).
|
||||||
|
`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)
|
||||||
|
for Ubuntu and macOS and in [windows-versions.js](windows-versions.js) for Windows.
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
@@ -46,7 +55,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
|
||||||
@@ -69,7 +78,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
|
||||||
@@ -100,7 +109,7 @@ You can cache the installed gems with these two steps:
|
|||||||
key: bundle-use-ruby-${{ matrix.os }}-${{ matrix.ruby }}-${{ hashFiles('**/Gemfile.lock') }}
|
key: bundle-use-ruby-${{ matrix.os }}-${{ matrix.ruby }}-${{ hashFiles('**/Gemfile.lock') }}
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
bundle-use-ruby-${{ matrix.os }}-${{ matrix.ruby }}-
|
bundle-use-ruby-${{ matrix.os }}-${{ matrix.ruby }}-
|
||||||
- name: Bundle install
|
- name: bundle install
|
||||||
run: |
|
run: |
|
||||||
bundle config path vendor/bundle
|
bundle config path vendor/bundle
|
||||||
bundle install --jobs 4 --retry 3
|
bundle install --jobs 4 --retry 3
|
||||||
@@ -110,7 +119,7 @@ When using a single job with a Ruby version, replace `${{ matrix.ruby }}` with t
|
|||||||
When using `.ruby-version`, replace `${{ matrix.ruby }}` with `${{ hashFiles('.ruby-version') }}`.
|
When using `.ruby-version`, replace `${{ matrix.ruby }}` with `${{ hashFiles('.ruby-version') }}`.
|
||||||
|
|
||||||
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 - Gem example](https://github.com/actions/cache/blob/master/examples.md#ruby---gem).
|
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.
|
Make sure to include `use-ruby` in the `key` to avoid conflicting with previous caches.
|
||||||
|
|
||||||
## Limitations
|
## Limitations
|
||||||
@@ -124,4 +133,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.
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ branding:
|
|||||||
inputs:
|
inputs:
|
||||||
ruby-version:
|
ruby-version:
|
||||||
description: 'Engine and version to use, see the syntax in the README. Reads from .ruby-version if unset.'
|
description: 'Engine and version to use, see the syntax in the README. Reads from .ruby-version if unset.'
|
||||||
|
required: false
|
||||||
default: '.ruby-version'
|
default: '.ruby-version'
|
||||||
outputs:
|
outputs:
|
||||||
ruby-prefix:
|
ruby-prefix:
|
||||||
|
|||||||
+271
-156
@@ -1010,7 +1010,6 @@ module.exports = function createError(message, config, code, request, response)
|
|||||||
|
|
||||||
|
|
||||||
var bind = __webpack_require__(727);
|
var bind = __webpack_require__(727);
|
||||||
var isBuffer = __webpack_require__(812);
|
|
||||||
|
|
||||||
/*global toString:true*/
|
/*global toString:true*/
|
||||||
|
|
||||||
@@ -1028,6 +1027,27 @@ function isArray(val) {
|
|||||||
return toString.call(val) === '[object Array]';
|
return toString.call(val) === '[object Array]';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Determine if a value is undefined
|
||||||
|
*
|
||||||
|
* @param {Object} val The value to test
|
||||||
|
* @returns {boolean} True if the value is undefined, otherwise false
|
||||||
|
*/
|
||||||
|
function isUndefined(val) {
|
||||||
|
return typeof val === 'undefined';
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Determine if a value is a Buffer
|
||||||
|
*
|
||||||
|
* @param {Object} val The value to test
|
||||||
|
* @returns {boolean} True if value is a Buffer, otherwise false
|
||||||
|
*/
|
||||||
|
function isBuffer(val) {
|
||||||
|
return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor)
|
||||||
|
&& typeof val.constructor.isBuffer === 'function' && val.constructor.isBuffer(val);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Determine if a value is an ArrayBuffer
|
* Determine if a value is an ArrayBuffer
|
||||||
*
|
*
|
||||||
@@ -1084,16 +1104,6 @@ function isNumber(val) {
|
|||||||
return typeof val === 'number';
|
return typeof val === 'number';
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Determine if a value is undefined
|
|
||||||
*
|
|
||||||
* @param {Object} val The value to test
|
|
||||||
* @returns {boolean} True if the value is undefined, otherwise false
|
|
||||||
*/
|
|
||||||
function isUndefined(val) {
|
|
||||||
return typeof val === 'undefined';
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Determine if a value is an Object
|
* Determine if a value is an Object
|
||||||
*
|
*
|
||||||
@@ -1392,10 +1402,10 @@ async function run() {
|
|||||||
if (platform === 'windows-latest' && engine !== 'jruby') {
|
if (platform === 'windows-latest' && engine !== 'jruby') {
|
||||||
installer = __webpack_require__(826)
|
installer = __webpack_require__(826)
|
||||||
} else {
|
} else {
|
||||||
installer = __webpack_require__(442)
|
installer = __webpack_require__(489)
|
||||||
}
|
}
|
||||||
|
|
||||||
const engineVersions = await installer.getAvailableVersions(engine)
|
const engineVersions = installer.getAvailableVersions(platform, engine)
|
||||||
const ruby = validateRubyEngineAndVersion(platform, engineVersions, engine, version)
|
const ruby = validateRubyEngineAndVersion(platform, engineVersions, engine, version)
|
||||||
|
|
||||||
const rubyPrefix = await installer.install(platform, ruby)
|
const rubyPrefix = await installer.install(platform, ruby)
|
||||||
@@ -1432,13 +1442,13 @@ function validateRubyEngineAndVersion(platform, engineVersions, engine, version)
|
|||||||
|
|
||||||
if (!engineVersions.includes(version)) {
|
if (!engineVersions.includes(version)) {
|
||||||
const latestToFirstVersion = engineVersions.slice().reverse()
|
const latestToFirstVersion = engineVersions.slice().reverse()
|
||||||
const found = latestToFirstVersion.find(v => v.startsWith(version))
|
const found = latestToFirstVersion.find(v => v !== 'head' && v.startsWith(version))
|
||||||
if (found) {
|
if (found) {
|
||||||
version = found
|
version = found
|
||||||
} 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`)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2124,6 +2134,43 @@ if (process.env.NODE_DEBUG && /\btunnel\b/.test(process.env.NODE_DEBUG)) {
|
|||||||
exports.debug = debug; // for test
|
exports.debug = debug; // for test
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ 156:
|
||||||
|
/***/ (function(__unusedmodule, __webpack_exports__, __webpack_require__) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
__webpack_require__.r(__webpack_exports__);
|
||||||
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getVersions", function() { return getVersions; });
|
||||||
|
function getVersions(platform) {
|
||||||
|
const versions = {
|
||||||
|
"ruby": [
|
||||||
|
"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",
|
||||||
|
"head"
|
||||||
|
],
|
||||||
|
"jruby": [
|
||||||
|
"9.2.9.0"
|
||||||
|
],
|
||||||
|
"truffleruby": [
|
||||||
|
"19.3.0", "19.3.1",
|
||||||
|
"head"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
if (platform === 'ubuntu-18.04') {
|
||||||
|
versions['rubinius'] = [
|
||||||
|
"4.14"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
return versions
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
||||||
/***/ 211:
|
/***/ 211:
|
||||||
@@ -2142,6 +2189,7 @@ module.exports = require("https");
|
|||||||
var utils = __webpack_require__(35);
|
var utils = __webpack_require__(35);
|
||||||
var settle = __webpack_require__(564);
|
var settle = __webpack_require__(564);
|
||||||
var buildURL = __webpack_require__(133);
|
var buildURL = __webpack_require__(133);
|
||||||
|
var buildFullPath = __webpack_require__(960);
|
||||||
var parseHeaders = __webpack_require__(333);
|
var parseHeaders = __webpack_require__(333);
|
||||||
var isURLSameOrigin = __webpack_require__(688);
|
var isURLSameOrigin = __webpack_require__(688);
|
||||||
var createError = __webpack_require__(26);
|
var createError = __webpack_require__(26);
|
||||||
@@ -2164,7 +2212,8 @@ module.exports = function xhrAdapter(config) {
|
|||||||
requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password);
|
requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password);
|
||||||
}
|
}
|
||||||
|
|
||||||
request.open(config.method.toUpperCase(), buildURL(config.url, config.params, config.paramsSerializer), true);
|
var fullPath = buildFullPath(config.baseURL, config.url);
|
||||||
|
request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true);
|
||||||
|
|
||||||
// Set the request timeout in MS
|
// Set the request timeout in MS
|
||||||
request.timeout = config.timeout;
|
request.timeout = config.timeout;
|
||||||
@@ -2225,7 +2274,11 @@ module.exports = function xhrAdapter(config) {
|
|||||||
|
|
||||||
// Handle timeout
|
// Handle timeout
|
||||||
request.ontimeout = function handleTimeout() {
|
request.ontimeout = function handleTimeout() {
|
||||||
reject(createError('timeout of ' + config.timeout + 'ms exceeded', config, 'ECONNABORTED',
|
var timeoutErrorMessage = 'timeout of ' + config.timeout + 'ms exceeded';
|
||||||
|
if (config.timeoutErrorMessage) {
|
||||||
|
timeoutErrorMessage = config.timeoutErrorMessage;
|
||||||
|
}
|
||||||
|
reject(createError(timeoutErrorMessage, config, 'ECONNABORTED',
|
||||||
request));
|
request));
|
||||||
|
|
||||||
// Clean up request
|
// Clean up request
|
||||||
@@ -2239,7 +2292,7 @@ module.exports = function xhrAdapter(config) {
|
|||||||
var cookies = __webpack_require__(864);
|
var cookies = __webpack_require__(864);
|
||||||
|
|
||||||
// Add xsrf header
|
// Add xsrf header
|
||||||
var xsrfValue = (config.withCredentials || isURLSameOrigin(config.url)) && config.xsrfCookieName ?
|
var xsrfValue = (config.withCredentials || isURLSameOrigin(fullPath)) && config.xsrfCookieName ?
|
||||||
cookies.read(config.xsrfCookieName) :
|
cookies.read(config.xsrfCookieName) :
|
||||||
undefined;
|
undefined;
|
||||||
|
|
||||||
@@ -2262,8 +2315,8 @@ module.exports = function xhrAdapter(config) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Add withCredentials to request if needed
|
// Add withCredentials to request if needed
|
||||||
if (config.withCredentials) {
|
if (!utils.isUndefined(config.withCredentials)) {
|
||||||
request.withCredentials = true;
|
request.withCredentials = !!config.withCredentials;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add responseType to request if needed
|
// Add responseType to request if needed
|
||||||
@@ -4644,7 +4697,7 @@ module.exports = require("assert");
|
|||||||
/***/ 361:
|
/***/ 361:
|
||||||
/***/ (function(module) {
|
/***/ (function(module) {
|
||||||
|
|
||||||
module.exports = {"name":"axios","version":"0.19.0","description":"Promise based HTTP client for the browser and node.js","main":"index.js","scripts":{"test":"grunt test && bundlesize","start":"node ./sandbox/server.js","build":"NODE_ENV=production grunt build","preversion":"npm test","version":"npm run build && grunt version && git add -A dist && git add CHANGELOG.md bower.json package.json","postversion":"git push && git push --tags","examples":"node ./examples/server.js","coveralls":"cat coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js","fix":"eslint --fix lib/**/*.js"},"repository":{"type":"git","url":"https://github.com/axios/axios.git"},"keywords":["xhr","http","ajax","promise","node"],"author":"Matt Zabriskie","license":"MIT","bugs":{"url":"https://github.com/axios/axios/issues"},"homepage":"https://github.com/axios/axios","devDependencies":{"bundlesize":"^0.17.0","coveralls":"^3.0.0","es6-promise":"^4.2.4","grunt":"^1.0.2","grunt-banner":"^0.6.0","grunt-cli":"^1.2.0","grunt-contrib-clean":"^1.1.0","grunt-contrib-watch":"^1.0.0","grunt-eslint":"^20.1.0","grunt-karma":"^2.0.0","grunt-mocha-test":"^0.13.3","grunt-ts":"^6.0.0-beta.19","grunt-webpack":"^1.0.18","istanbul-instrumenter-loader":"^1.0.0","jasmine-core":"^2.4.1","karma":"^1.3.0","karma-chrome-launcher":"^2.2.0","karma-coverage":"^1.1.1","karma-firefox-launcher":"^1.1.0","karma-jasmine":"^1.1.1","karma-jasmine-ajax":"^0.1.13","karma-opera-launcher":"^1.0.0","karma-safari-launcher":"^1.0.0","karma-sauce-launcher":"^1.2.0","karma-sinon":"^1.0.5","karma-sourcemap-loader":"^0.3.7","karma-webpack":"^1.7.0","load-grunt-tasks":"^3.5.2","minimist":"^1.2.0","mocha":"^5.2.0","sinon":"^4.5.0","typescript":"^2.8.1","url-search-params":"^0.10.0","webpack":"^1.13.1","webpack-dev-server":"^1.14.1"},"browser":{"./lib/adapters/http.js":"./lib/adapters/xhr.js"},"typings":"./index.d.ts","dependencies":{"follow-redirects":"1.5.10","is-buffer":"^2.0.2"},"bundlesize":[{"path":"./dist/axios.min.js","threshold":"5kB"}]};
|
module.exports = {"name":"axios","version":"0.19.2","description":"Promise based HTTP client for the browser and node.js","main":"index.js","scripts":{"test":"grunt test && bundlesize","start":"node ./sandbox/server.js","build":"NODE_ENV=production grunt build","preversion":"npm test","version":"npm run build && grunt version && git add -A dist && git add CHANGELOG.md bower.json package.json","postversion":"git push && git push --tags","examples":"node ./examples/server.js","coveralls":"cat coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js","fix":"eslint --fix lib/**/*.js"},"repository":{"type":"git","url":"https://github.com/axios/axios.git"},"keywords":["xhr","http","ajax","promise","node"],"author":"Matt Zabriskie","license":"MIT","bugs":{"url":"https://github.com/axios/axios/issues"},"homepage":"https://github.com/axios/axios","devDependencies":{"bundlesize":"^0.17.0","coveralls":"^3.0.0","es6-promise":"^4.2.4","grunt":"^1.0.2","grunt-banner":"^0.6.0","grunt-cli":"^1.2.0","grunt-contrib-clean":"^1.1.0","grunt-contrib-watch":"^1.0.0","grunt-eslint":"^20.1.0","grunt-karma":"^2.0.0","grunt-mocha-test":"^0.13.3","grunt-ts":"^6.0.0-beta.19","grunt-webpack":"^1.0.18","istanbul-instrumenter-loader":"^1.0.0","jasmine-core":"^2.4.1","karma":"^1.3.0","karma-chrome-launcher":"^2.2.0","karma-coverage":"^1.1.1","karma-firefox-launcher":"^1.1.0","karma-jasmine":"^1.1.1","karma-jasmine-ajax":"^0.1.13","karma-opera-launcher":"^1.0.0","karma-safari-launcher":"^1.0.0","karma-sauce-launcher":"^1.2.0","karma-sinon":"^1.0.5","karma-sourcemap-loader":"^0.3.7","karma-webpack":"^1.7.0","load-grunt-tasks":"^3.5.2","minimist":"^1.2.0","mocha":"^5.2.0","sinon":"^4.5.0","typescript":"^2.8.1","url-search-params":"^0.10.0","webpack":"^1.13.1","webpack-dev-server":"^1.14.1"},"browser":{"./lib/adapters/http.js":"./lib/adapters/xhr.js"},"typings":"./index.d.ts","dependencies":{"follow-redirects":"1.5.10"},"bundlesize":[{"path":"./dist/axios.min.js","threshold":"5kB"}]};
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
||||||
@@ -4839,52 +4892,6 @@ function escape(s) {
|
|||||||
}
|
}
|
||||||
//# sourceMappingURL=command.js.map
|
//# sourceMappingURL=command.js.map
|
||||||
|
|
||||||
/***/ }),
|
|
||||||
|
|
||||||
/***/ 442:
|
|
||||||
/***/ (function(__unusedmodule, __webpack_exports__, __webpack_require__) {
|
|
||||||
|
|
||||||
"use strict";
|
|
||||||
__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__, "install", function() { return install; });
|
|
||||||
const os = __webpack_require__(87)
|
|
||||||
const path = __webpack_require__(622)
|
|
||||||
const core = __webpack_require__(470)
|
|
||||||
const io = __webpack_require__(1)
|
|
||||||
const tc = __webpack_require__(533)
|
|
||||||
const axios = __webpack_require__(53)
|
|
||||||
|
|
||||||
const builderReleaseTag = 'builds-newer-openssl'
|
|
||||||
const releasesURL = 'https://github.com/eregon/ruby-install-builder/releases'
|
|
||||||
const metadataURL = 'https://raw.githubusercontent.com/eregon/ruby-install-builder/metadata'
|
|
||||||
|
|
||||||
async function getAvailableVersions(engine) {
|
|
||||||
const response = await axios.get(`${metadataURL}/versions.json`)
|
|
||||||
const versions = response.data
|
|
||||||
return versions[engine]
|
|
||||||
}
|
|
||||||
|
|
||||||
async function install(platform, ruby) {
|
|
||||||
const rubyPrefix = await downloadAndExtract(platform, ruby)
|
|
||||||
core.addPath(path.join(rubyPrefix, 'bin'))
|
|
||||||
return rubyPrefix
|
|
||||||
}
|
|
||||||
|
|
||||||
async function downloadAndExtract(platform, ruby) {
|
|
||||||
const rubiesDir = path.join(os.homedir(), '.rubies')
|
|
||||||
await io.mkdirP(rubiesDir)
|
|
||||||
|
|
||||||
const url = `${releasesURL}/download/${builderReleaseTag}/${ruby}-${platform}.tar.gz`
|
|
||||||
console.log(url)
|
|
||||||
|
|
||||||
const downloadPath = await tc.downloadTool(url)
|
|
||||||
await tc.extractTar(downloadPath, rubiesDir)
|
|
||||||
|
|
||||||
return path.join(rubiesDir, ruby)
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
||||||
/***/ 470:
|
/***/ 470:
|
||||||
@@ -5087,6 +5094,111 @@ function getState(name) {
|
|||||||
exports.getState = getState;
|
exports.getState = getState;
|
||||||
//# sourceMappingURL=core.js.map
|
//# sourceMappingURL=core.js.map
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ 471:
|
||||||
|
/***/ (function(__unusedmodule, __webpack_exports__, __webpack_require__) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
__webpack_require__.r(__webpack_exports__);
|
||||||
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "versions", function() { return versions; });
|
||||||
|
const versions = {
|
||||||
|
"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.3": "https://dl.bintray.com/oneclick/rubyinstaller/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.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.4": "https://github.com/oneclick/rubyinstaller2/releases/download/rubyinstaller-2.4.4-2/rubyinstaller-2.4.4-2-x64.7z",
|
||||||
|
"2.4.5": "https://github.com/oneclick/rubyinstaller2/releases/download/rubyinstaller-2.4.5-1/rubyinstaller-2.4.5-1-x64.7z",
|
||||||
|
"2.4.6": "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-2.4.6-1/rubyinstaller-2.4.6-1-x64.7z",
|
||||||
|
"2.4.7": "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-2.4.7-1/rubyinstaller-2.4.7-1-x64.7z",
|
||||||
|
"2.4.9": "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-2.4.9-1/rubyinstaller-2.4.9-1-x64.7z",
|
||||||
|
"2.5.0": "https://github.com/oneclick/rubyinstaller2/releases/download/rubyinstaller-2.5.0-2/rubyinstaller-2.5.0-2-x64.7z",
|
||||||
|
"2.5.1": "https://github.com/oneclick/rubyinstaller2/releases/download/rubyinstaller-2.5.1-2/rubyinstaller-2.5.1-2-x64.7z",
|
||||||
|
"2.5.3": "https://github.com/oneclick/rubyinstaller2/releases/download/rubyinstaller-2.5.3-1/rubyinstaller-2.5.3-1-x64.7z",
|
||||||
|
"2.5.5": "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-2.5.5-1/rubyinstaller-2.5.5-1-x64.7z",
|
||||||
|
"2.5.6": "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-2.5.6-1/rubyinstaller-2.5.6-1-x64.7z",
|
||||||
|
"2.5.7": "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-2.5.7-1/rubyinstaller-2.5.7-1-x64.7z",
|
||||||
|
"2.6.0": "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-2.6.0-1/rubyinstaller-2.6.0-1-x64.7z",
|
||||||
|
"2.6.1": "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-2.6.1-1/rubyinstaller-2.6.1-1-x64.7z",
|
||||||
|
"2.6.2": "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-2.6.2-1/rubyinstaller-2.6.2-1-x64.7z",
|
||||||
|
"2.6.3": "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-2.6.3-1/rubyinstaller-2.6.3-1-x64.7z",
|
||||||
|
"2.6.4": "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-2.6.4-1/rubyinstaller-2.6.4-1-x64.7z",
|
||||||
|
"2.6.5": "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-2.6.5-1/rubyinstaller-2.6.5-1-x64.7z",
|
||||||
|
"2.7.0": "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-2.7.0-1/rubyinstaller-2.7.0-1-x64.7z",
|
||||||
|
"head": "https://github.com/oneclick/rubyinstaller2/releases/download/rubyinstaller-head/rubyinstaller-head-x64.7z"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ 489:
|
||||||
|
/***/ (function(__unusedmodule, __webpack_exports__, __webpack_require__) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
__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__, "install", function() { return install; });
|
||||||
|
const os = __webpack_require__(87)
|
||||||
|
const path = __webpack_require__(622)
|
||||||
|
const core = __webpack_require__(470)
|
||||||
|
const io = __webpack_require__(1)
|
||||||
|
const tc = __webpack_require__(533)
|
||||||
|
const rubyBuilderVersions = __webpack_require__(156)
|
||||||
|
const axios = __webpack_require__(53)
|
||||||
|
|
||||||
|
const builderReleaseTag = 'builds-no-warn'
|
||||||
|
const releasesURL = 'https://github.com/ruby/ruby-builder/releases'
|
||||||
|
|
||||||
|
function getAvailableVersions(platform, engine) {
|
||||||
|
return rubyBuilderVersions.getVersions(platform)[engine]
|
||||||
|
}
|
||||||
|
|
||||||
|
async function install(platform, ruby) {
|
||||||
|
const rubyPrefix = await downloadAndExtract(platform, ruby)
|
||||||
|
|
||||||
|
core.addPath(path.join(rubyPrefix, 'bin'))
|
||||||
|
if (ruby.startsWith('rubinius')) {
|
||||||
|
core.addPath(path.join(rubyPrefix, 'gems', 'bin'))
|
||||||
|
}
|
||||||
|
|
||||||
|
return rubyPrefix
|
||||||
|
}
|
||||||
|
|
||||||
|
async function downloadAndExtract(platform, ruby) {
|
||||||
|
const rubiesDir = path.join(os.homedir(), '.rubies')
|
||||||
|
await io.mkdirP(rubiesDir)
|
||||||
|
|
||||||
|
const url = await getDownloadURL(platform, ruby)
|
||||||
|
console.log(url)
|
||||||
|
|
||||||
|
const downloadPath = await tc.downloadTool(url)
|
||||||
|
await tc.extractTar(downloadPath, rubiesDir)
|
||||||
|
|
||||||
|
return path.join(rubiesDir, ruby)
|
||||||
|
}
|
||||||
|
|
||||||
|
async function getDownloadURL(platform, ruby) {
|
||||||
|
if (ruby.endsWith('-head')) {
|
||||||
|
return getLatestHeadBuildURL(platform, ruby)
|
||||||
|
} else {
|
||||||
|
return `${releasesURL}/download/${builderReleaseTag}/${ruby}-${platform}.tar.gz`
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async function getLatestHeadBuildURL(platform, ruby) {
|
||||||
|
const engine = ruby.split('-')[0]
|
||||||
|
const repository = `ruby/${engine}-dev-builder`
|
||||||
|
const metadataURL = `https://raw.githubusercontent.com/${repository}/metadata/latest_build.tag`
|
||||||
|
const releasesURL = `https://github.com/${repository}/releases/download`
|
||||||
|
|
||||||
|
const response = await axios.get(metadataURL)
|
||||||
|
const tag = response.data.trim()
|
||||||
|
return `${releasesURL}/${tag}/${ruby}-${platform}.tar.gz`
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
||||||
/***/ 494:
|
/***/ 494:
|
||||||
@@ -5146,13 +5258,12 @@ function setContentTypeIfUnset(headers, value) {
|
|||||||
|
|
||||||
function getDefaultAdapter() {
|
function getDefaultAdapter() {
|
||||||
var adapter;
|
var adapter;
|
||||||
// Only Node.JS has a process variable that is of [[Class]] process
|
if (typeof XMLHttpRequest !== 'undefined') {
|
||||||
if (typeof process !== 'undefined' && Object.prototype.toString.call(process) === '[object process]') {
|
|
||||||
// For node use HTTP adapter
|
|
||||||
adapter = __webpack_require__(670);
|
|
||||||
} else if (typeof XMLHttpRequest !== 'undefined') {
|
|
||||||
// For browsers use XHR adapter
|
// For browsers use XHR adapter
|
||||||
adapter = __webpack_require__(219);
|
adapter = __webpack_require__(219);
|
||||||
|
} else if (typeof process !== 'undefined' && Object.prototype.toString.call(process) === '[object process]') {
|
||||||
|
// For node use HTTP adapter
|
||||||
|
adapter = __webpack_require__(670);
|
||||||
}
|
}
|
||||||
return adapter;
|
return adapter;
|
||||||
}
|
}
|
||||||
@@ -5674,42 +5785,6 @@ function _evaluateVersions(versions, versionSpec) {
|
|||||||
}
|
}
|
||||||
//# sourceMappingURL=tool-cache.js.map
|
//# sourceMappingURL=tool-cache.js.map
|
||||||
|
|
||||||
/***/ }),
|
|
||||||
|
|
||||||
/***/ 538:
|
|
||||||
/***/ (function(__unusedmodule, __webpack_exports__, __webpack_require__) {
|
|
||||||
|
|
||||||
"use strict";
|
|
||||||
__webpack_require__.r(__webpack_exports__);
|
|
||||||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "versions", function() { return versions; });
|
|
||||||
const versions = {
|
|
||||||
"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.3": "https://dl.bintray.com/oneclick/rubyinstaller/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.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.4": "https://github.com/oneclick/rubyinstaller2/releases/download/rubyinstaller-2.4.4-2/rubyinstaller-2.4.4-2-x64.7z",
|
|
||||||
"2.4.5": "https://github.com/oneclick/rubyinstaller2/releases/download/rubyinstaller-2.4.5-1/rubyinstaller-2.4.5-1-x64.7z",
|
|
||||||
"2.4.6": "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-2.4.6-1/rubyinstaller-2.4.6-1-x64.7z",
|
|
||||||
"2.4.7": "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-2.4.7-1/rubyinstaller-2.4.7-1-x64.7z",
|
|
||||||
"2.4.9": "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-2.4.9-1/rubyinstaller-2.4.9-1-x64.7z",
|
|
||||||
"2.5.0": "https://github.com/oneclick/rubyinstaller2/releases/download/rubyinstaller-2.5.0-2/rubyinstaller-2.5.0-2-x64.7z",
|
|
||||||
"2.5.1": "https://github.com/oneclick/rubyinstaller2/releases/download/rubyinstaller-2.5.1-2/rubyinstaller-2.5.1-2-x64.7z",
|
|
||||||
"2.5.3": "https://github.com/oneclick/rubyinstaller2/releases/download/rubyinstaller-2.5.3-1/rubyinstaller-2.5.3-1-x64.7z",
|
|
||||||
"2.5.5": "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-2.5.5-1/rubyinstaller-2.5.5-1-x64.7z",
|
|
||||||
"2.5.6": "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-2.5.6-1/rubyinstaller-2.5.6-1-x64.7z",
|
|
||||||
"2.5.7": "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-2.5.7-1/rubyinstaller-2.5.7-1-x64.7z",
|
|
||||||
"2.6.0": "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-2.6.0-1/rubyinstaller-2.6.0-1-x64.7z",
|
|
||||||
"2.6.1": "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-2.6.1-1/rubyinstaller-2.6.1-1-x64.7z",
|
|
||||||
"2.6.2": "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-2.6.2-1/rubyinstaller-2.6.2-1-x64.7z",
|
|
||||||
"2.6.3": "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-2.6.3-1/rubyinstaller-2.6.3-1-x64.7z",
|
|
||||||
"2.6.4": "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-2.6.4-1/rubyinstaller-2.6.4-1-x64.7z",
|
|
||||||
"2.6.5": "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-2.6.5-1/rubyinstaller-2.6.5-1-x64.7z",
|
|
||||||
"2.7.0": "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-2.7.0-1/rubyinstaller-2.7.0-1-x64.7z"
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
||||||
/***/ 549:
|
/***/ 549:
|
||||||
@@ -6570,6 +6645,7 @@ module.exports = require("util");
|
|||||||
|
|
||||||
var utils = __webpack_require__(35);
|
var utils = __webpack_require__(35);
|
||||||
var settle = __webpack_require__(564);
|
var settle = __webpack_require__(564);
|
||||||
|
var buildFullPath = __webpack_require__(960);
|
||||||
var buildURL = __webpack_require__(133);
|
var buildURL = __webpack_require__(133);
|
||||||
var http = __webpack_require__(605);
|
var http = __webpack_require__(605);
|
||||||
var https = __webpack_require__(211);
|
var https = __webpack_require__(211);
|
||||||
@@ -6586,13 +6662,10 @@ var isHttps = /https:?/;
|
|||||||
/*eslint consistent-return:0*/
|
/*eslint consistent-return:0*/
|
||||||
module.exports = function httpAdapter(config) {
|
module.exports = function httpAdapter(config) {
|
||||||
return new Promise(function dispatchHttpRequest(resolvePromise, rejectPromise) {
|
return new Promise(function dispatchHttpRequest(resolvePromise, rejectPromise) {
|
||||||
var timer;
|
|
||||||
var resolve = function resolve(value) {
|
var resolve = function resolve(value) {
|
||||||
clearTimeout(timer);
|
|
||||||
resolvePromise(value);
|
resolvePromise(value);
|
||||||
};
|
};
|
||||||
var reject = function reject(value) {
|
var reject = function reject(value) {
|
||||||
clearTimeout(timer);
|
|
||||||
rejectPromise(value);
|
rejectPromise(value);
|
||||||
};
|
};
|
||||||
var data = config.data;
|
var data = config.data;
|
||||||
@@ -6632,7 +6705,8 @@ module.exports = function httpAdapter(config) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Parse url
|
// Parse url
|
||||||
var parsed = url.parse(config.url);
|
var fullPath = buildFullPath(config.baseURL, config.url);
|
||||||
|
var parsed = url.parse(fullPath);
|
||||||
var protocol = parsed.protocol || 'http:';
|
var protocol = parsed.protocol || 'http:';
|
||||||
|
|
||||||
if (!auth && parsed.auth) {
|
if (!auth && parsed.auth) {
|
||||||
@@ -6654,6 +6728,7 @@ module.exports = function httpAdapter(config) {
|
|||||||
method: config.method.toUpperCase(),
|
method: config.method.toUpperCase(),
|
||||||
headers: headers,
|
headers: headers,
|
||||||
agent: agent,
|
agent: agent,
|
||||||
|
agents: { http: config.httpAgent, https: config.httpsAgent },
|
||||||
auth: auth
|
auth: auth
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -6686,8 +6761,7 @@ module.exports = function httpAdapter(config) {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (proxyElement[0] === '.' &&
|
if (proxyElement[0] === '.' &&
|
||||||
parsed.hostname.substr(parsed.hostname.length - proxyElement.length) === proxyElement &&
|
parsed.hostname.substr(parsed.hostname.length - proxyElement.length) === proxyElement) {
|
||||||
proxyElement.match(/\./g).length === parsed.hostname.match(/\./g).length) {
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -6815,10 +6889,15 @@ module.exports = function httpAdapter(config) {
|
|||||||
|
|
||||||
// Handle request timeout
|
// Handle request timeout
|
||||||
if (config.timeout) {
|
if (config.timeout) {
|
||||||
timer = setTimeout(function handleRequestTimeout() {
|
// Sometime, the response will be very slow, and does not respond, the connect event will be block by event loop system.
|
||||||
|
// And timer callback will be fired, and abort() will be invoked before connection, then get "socket hang up" and code ECONNRESET.
|
||||||
|
// At this time, if we have a large number of request, nodejs will hang up some socket on background. and the number will up and up.
|
||||||
|
// And then these socket which be hang up will devoring CPU little by little.
|
||||||
|
// ClientRequest.setTimeout will be fired on the specify milliseconds, and can make sure that abort() will be fired after connect.
|
||||||
|
req.setTimeout(config.timeout, function handleRequestTimeout() {
|
||||||
req.abort();
|
req.abort();
|
||||||
reject(createError('timeout of ' + config.timeout + 'ms exceeded', config, 'ECONNABORTED', req));
|
reject(createError('timeout of ' + config.timeout + 'ms exceeded', config, 'ECONNABORTED', req));
|
||||||
}, config.timeout);
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (config.cancelToken) {
|
if (config.cancelToken) {
|
||||||
@@ -7623,7 +7702,15 @@ Axios.prototype.request = function request(config) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
config = mergeConfig(this.defaults, config);
|
config = mergeConfig(this.defaults, config);
|
||||||
config.method = config.method ? config.method.toLowerCase() : 'get';
|
|
||||||
|
// Set config.method
|
||||||
|
if (config.method) {
|
||||||
|
config.method = config.method.toLowerCase();
|
||||||
|
} else if (this.defaults.method) {
|
||||||
|
config.method = this.defaults.method.toLowerCase();
|
||||||
|
} else {
|
||||||
|
config.method = 'get';
|
||||||
|
}
|
||||||
|
|
||||||
// Hook up interceptors middleware
|
// Hook up interceptors middleware
|
||||||
var chain = [dispatchRequest, undefined];
|
var chain = [dispatchRequest, undefined];
|
||||||
@@ -7681,24 +7768,6 @@ module.exports = Axios;
|
|||||||
|
|
||||||
module.exports = require("stream");
|
module.exports = require("stream");
|
||||||
|
|
||||||
/***/ }),
|
|
||||||
|
|
||||||
/***/ 812:
|
|
||||||
/***/ (function(module) {
|
|
||||||
|
|
||||||
/*!
|
|
||||||
* Determine if an object is a Buffer
|
|
||||||
*
|
|
||||||
* @author Feross Aboukhadijeh <https://feross.org>
|
|
||||||
* @license MIT
|
|
||||||
*/
|
|
||||||
|
|
||||||
module.exports = function isBuffer (obj) {
|
|
||||||
return obj != null && obj.constructor != null &&
|
|
||||||
typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj)
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
||||||
/***/ 825:
|
/***/ 825:
|
||||||
@@ -7722,13 +7791,23 @@ module.exports = function mergeConfig(config1, config2) {
|
|||||||
config2 = config2 || {};
|
config2 = config2 || {};
|
||||||
var config = {};
|
var config = {};
|
||||||
|
|
||||||
utils.forEach(['url', 'method', 'params', 'data'], function valueFromConfig2(prop) {
|
var valueFromConfig2Keys = ['url', 'method', 'params', 'data'];
|
||||||
|
var mergeDeepPropertiesKeys = ['headers', 'auth', 'proxy'];
|
||||||
|
var defaultToConfig2Keys = [
|
||||||
|
'baseURL', 'url', 'transformRequest', 'transformResponse', 'paramsSerializer',
|
||||||
|
'timeout', 'withCredentials', 'adapter', 'responseType', 'xsrfCookieName',
|
||||||
|
'xsrfHeaderName', 'onUploadProgress', 'onDownloadProgress',
|
||||||
|
'maxContentLength', 'validateStatus', 'maxRedirects', 'httpAgent',
|
||||||
|
'httpsAgent', 'cancelToken', 'socketPath'
|
||||||
|
];
|
||||||
|
|
||||||
|
utils.forEach(valueFromConfig2Keys, function valueFromConfig2(prop) {
|
||||||
if (typeof config2[prop] !== 'undefined') {
|
if (typeof config2[prop] !== 'undefined') {
|
||||||
config[prop] = config2[prop];
|
config[prop] = config2[prop];
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
utils.forEach(['headers', 'auth', 'proxy'], function mergeDeepProperties(prop) {
|
utils.forEach(mergeDeepPropertiesKeys, function mergeDeepProperties(prop) {
|
||||||
if (utils.isObject(config2[prop])) {
|
if (utils.isObject(config2[prop])) {
|
||||||
config[prop] = utils.deepMerge(config1[prop], config2[prop]);
|
config[prop] = utils.deepMerge(config1[prop], config2[prop]);
|
||||||
} else if (typeof config2[prop] !== 'undefined') {
|
} else if (typeof config2[prop] !== 'undefined') {
|
||||||
@@ -7740,13 +7819,25 @@ module.exports = function mergeConfig(config1, config2) {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
utils.forEach([
|
utils.forEach(defaultToConfig2Keys, function defaultToConfig2(prop) {
|
||||||
'baseURL', 'transformRequest', 'transformResponse', 'paramsSerializer',
|
if (typeof config2[prop] !== 'undefined') {
|
||||||
'timeout', 'withCredentials', 'adapter', 'responseType', 'xsrfCookieName',
|
config[prop] = config2[prop];
|
||||||
'xsrfHeaderName', 'onUploadProgress', 'onDownloadProgress', 'maxContentLength',
|
} else if (typeof config1[prop] !== 'undefined') {
|
||||||
'validateStatus', 'maxRedirects', 'httpAgent', 'httpsAgent', 'cancelToken',
|
config[prop] = config1[prop];
|
||||||
'socketPath'
|
}
|
||||||
], function defaultToConfig2(prop) {
|
});
|
||||||
|
|
||||||
|
var axiosKeys = valueFromConfig2Keys
|
||||||
|
.concat(mergeDeepPropertiesKeys)
|
||||||
|
.concat(defaultToConfig2Keys);
|
||||||
|
|
||||||
|
var otherKeys = Object
|
||||||
|
.keys(config2)
|
||||||
|
.filter(function filterAxiosKeys(key) {
|
||||||
|
return axiosKeys.indexOf(key) === -1;
|
||||||
|
});
|
||||||
|
|
||||||
|
utils.forEach(otherKeys, function otherKeysDefaultToConfig2(prop) {
|
||||||
if (typeof config2[prop] !== 'undefined') {
|
if (typeof config2[prop] !== 'undefined') {
|
||||||
config[prop] = config2[prop];
|
config[prop] = config2[prop];
|
||||||
} else if (typeof config1[prop] !== 'undefined') {
|
} else if (typeof config1[prop] !== 'undefined') {
|
||||||
@@ -7774,9 +7865,9 @@ const fs = __webpack_require__(747)
|
|||||||
const core = __webpack_require__(470)
|
const core = __webpack_require__(470)
|
||||||
const exec = __webpack_require__(986)
|
const exec = __webpack_require__(986)
|
||||||
const tc = __webpack_require__(533)
|
const tc = __webpack_require__(533)
|
||||||
const rubyInstallerVersions = __webpack_require__(538).versions
|
const rubyInstallerVersions = __webpack_require__(471).versions
|
||||||
|
|
||||||
async function getAvailableVersions(engine) {
|
function getAvailableVersions(platform, engine) {
|
||||||
if (engine === 'ruby') {
|
if (engine === 'ruby') {
|
||||||
return Object.keys(rubyInstallerVersions)
|
return Object.keys(rubyInstallerVersions)
|
||||||
} else {
|
} else {
|
||||||
@@ -7794,9 +7885,12 @@ 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/ruby/setup-ruby/pull/14
|
||||||
|
const drive = (process.env['GITHUB_WORKSPACE'] || 'C')[0]
|
||||||
|
|
||||||
const downloadPath = await tc.downloadTool(url)
|
const downloadPath = await tc.downloadTool(url)
|
||||||
await exec.exec(`7z x ${downloadPath} -xr!${base}\\share\\doc -oC:\\`)
|
await exec.exec(`7z x ${downloadPath} -xr!${base}\\share\\doc -o${drive}:\\`)
|
||||||
const rubyPrefix = `C:\\${base}`
|
const rubyPrefix = `${drive}:\\${base}`
|
||||||
|
|
||||||
const [hostedRuby, msys2] = await linkMSYS2()
|
const [hostedRuby, msys2] = await linkMSYS2()
|
||||||
const newPath = setupPath(msys2, rubyPrefix)
|
const newPath = setupPath(msys2, rubyPrefix)
|
||||||
@@ -8773,8 +8867,6 @@ var utils = __webpack_require__(35);
|
|||||||
var transformData = __webpack_require__(589);
|
var transformData = __webpack_require__(589);
|
||||||
var isCancel = __webpack_require__(732);
|
var isCancel = __webpack_require__(732);
|
||||||
var defaults = __webpack_require__(529);
|
var defaults = __webpack_require__(529);
|
||||||
var isAbsoluteURL = __webpack_require__(590);
|
|
||||||
var combineURLs = __webpack_require__(887);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Throws a `Cancel` if cancellation has been requested.
|
* Throws a `Cancel` if cancellation has been requested.
|
||||||
@@ -8794,11 +8886,6 @@ function throwIfCancellationRequested(config) {
|
|||||||
module.exports = function dispatchRequest(config) {
|
module.exports = function dispatchRequest(config) {
|
||||||
throwIfCancellationRequested(config);
|
throwIfCancellationRequested(config);
|
||||||
|
|
||||||
// Support baseURL config
|
|
||||||
if (config.baseURL && !isAbsoluteURL(config.url)) {
|
|
||||||
config.url = combineURLs(config.baseURL, config.url);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Ensure headers exist
|
// Ensure headers exist
|
||||||
config.headers = config.headers || {};
|
config.headers = config.headers || {};
|
||||||
|
|
||||||
@@ -8813,7 +8900,7 @@ module.exports = function dispatchRequest(config) {
|
|||||||
config.headers = utils.merge(
|
config.headers = utils.merge(
|
||||||
config.headers.common || {},
|
config.headers.common || {},
|
||||||
config.headers[config.method] || {},
|
config.headers[config.method] || {},
|
||||||
config.headers || {}
|
config.headers
|
||||||
);
|
);
|
||||||
|
|
||||||
utils.forEach(
|
utils.forEach(
|
||||||
@@ -8855,6 +8942,34 @@ module.exports = function dispatchRequest(config) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ 960:
|
||||||
|
/***/ (function(module, __unusedexports, __webpack_require__) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
|
||||||
|
var isAbsoluteURL = __webpack_require__(590);
|
||||||
|
var combineURLs = __webpack_require__(887);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a new URL by combining the baseURL with the requestedURL,
|
||||||
|
* only when the requestedURL is not already an absolute URL.
|
||||||
|
* If the requestURL is absolute, this function returns the requestedURL untouched.
|
||||||
|
*
|
||||||
|
* @param {string} baseURL The base URL
|
||||||
|
* @param {string} requestedURL Absolute or relative URL to combine
|
||||||
|
* @returns {string} The combined full path
|
||||||
|
*/
|
||||||
|
module.exports = function buildFullPath(baseURL, requestedURL) {
|
||||||
|
if (baseURL && !isAbsoluteURL(requestedURL)) {
|
||||||
|
return combineURLs(baseURL, requestedURL);
|
||||||
|
}
|
||||||
|
return requestedURL;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
||||||
/***/ 972:
|
/***/ 972:
|
||||||
|
|||||||
@@ -23,5 +23,7 @@ versions = entries.select { |entry|
|
|||||||
[version, entry[:href]]
|
[version, entry[:href]]
|
||||||
}.to_h
|
}.to_h
|
||||||
|
|
||||||
|
versions['head'] = 'https://github.com/oneclick/rubyinstaller2/releases/download/rubyinstaller-head/rubyinstaller-head-x64.7z'
|
||||||
|
|
||||||
js = "export const versions = #{JSON.pretty_generate(versions)}\n"
|
js = "export const versions = #{JSON.pretty_generate(versions)}\n"
|
||||||
File.write 'ruby-installer-versions.js', js
|
File.write 'windows-versions.js', js
|
||||||
@@ -11,10 +11,10 @@ async function run() {
|
|||||||
if (platform === 'windows-latest' && engine !== 'jruby') {
|
if (platform === 'windows-latest' && engine !== 'jruby') {
|
||||||
installer = require('./windows')
|
installer = require('./windows')
|
||||||
} else {
|
} else {
|
||||||
installer = require('./ruby-install-builder')
|
installer = require('./ruby-builder')
|
||||||
}
|
}
|
||||||
|
|
||||||
const engineVersions = await installer.getAvailableVersions(engine)
|
const engineVersions = installer.getAvailableVersions(platform, engine)
|
||||||
const ruby = validateRubyEngineAndVersion(platform, engineVersions, engine, version)
|
const ruby = validateRubyEngineAndVersion(platform, engineVersions, engine, version)
|
||||||
|
|
||||||
const rubyPrefix = await installer.install(platform, ruby)
|
const rubyPrefix = await installer.install(platform, ruby)
|
||||||
@@ -51,13 +51,13 @@ function validateRubyEngineAndVersion(platform, engineVersions, engine, version)
|
|||||||
|
|
||||||
if (!engineVersions.includes(version)) {
|
if (!engineVersions.includes(version)) {
|
||||||
const latestToFirstVersion = engineVersions.slice().reverse()
|
const latestToFirstVersion = engineVersions.slice().reverse()
|
||||||
const found = latestToFirstVersion.find(v => v.startsWith(version))
|
const found = latestToFirstVersion.find(v => v !== 'head' && v.startsWith(version))
|
||||||
if (found) {
|
if (found) {
|
||||||
version = found
|
version = found
|
||||||
} 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
@@ -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",
|
||||||
|
|||||||
@@ -0,0 +1,27 @@
|
|||||||
|
export function getVersions(platform) {
|
||||||
|
const versions = {
|
||||||
|
"ruby": [
|
||||||
|
"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",
|
||||||
|
"head"
|
||||||
|
],
|
||||||
|
"jruby": [
|
||||||
|
"9.2.9.0"
|
||||||
|
],
|
||||||
|
"truffleruby": [
|
||||||
|
"19.3.0", "19.3.1",
|
||||||
|
"head"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
if (platform === 'ubuntu-18.04') {
|
||||||
|
versions['rubinius'] = [
|
||||||
|
"4.14"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
return versions
|
||||||
|
}
|
||||||
@@ -0,0 +1,57 @@
|
|||||||
|
const os = require('os')
|
||||||
|
const path = require('path')
|
||||||
|
const core = require('@actions/core')
|
||||||
|
const io = require('@actions/io')
|
||||||
|
const tc = require('@actions/tool-cache')
|
||||||
|
const rubyBuilderVersions = require('./ruby-builder-versions')
|
||||||
|
const axios = require('axios')
|
||||||
|
|
||||||
|
const builderReleaseTag = 'builds-no-warn'
|
||||||
|
const releasesURL = 'https://github.com/ruby/ruby-builder/releases'
|
||||||
|
|
||||||
|
export function getAvailableVersions(platform, engine) {
|
||||||
|
return rubyBuilderVersions.getVersions(platform)[engine]
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function install(platform, ruby) {
|
||||||
|
const rubyPrefix = await downloadAndExtract(platform, ruby)
|
||||||
|
|
||||||
|
core.addPath(path.join(rubyPrefix, 'bin'))
|
||||||
|
if (ruby.startsWith('rubinius')) {
|
||||||
|
core.addPath(path.join(rubyPrefix, 'gems', 'bin'))
|
||||||
|
}
|
||||||
|
|
||||||
|
return rubyPrefix
|
||||||
|
}
|
||||||
|
|
||||||
|
async function downloadAndExtract(platform, ruby) {
|
||||||
|
const rubiesDir = path.join(os.homedir(), '.rubies')
|
||||||
|
await io.mkdirP(rubiesDir)
|
||||||
|
|
||||||
|
const url = await getDownloadURL(platform, ruby)
|
||||||
|
console.log(url)
|
||||||
|
|
||||||
|
const downloadPath = await tc.downloadTool(url)
|
||||||
|
await tc.extractTar(downloadPath, rubiesDir)
|
||||||
|
|
||||||
|
return path.join(rubiesDir, ruby)
|
||||||
|
}
|
||||||
|
|
||||||
|
async function getDownloadURL(platform, ruby) {
|
||||||
|
if (ruby.endsWith('-head')) {
|
||||||
|
return getLatestHeadBuildURL(platform, ruby)
|
||||||
|
} else {
|
||||||
|
return `${releasesURL}/download/${builderReleaseTag}/${ruby}-${platform}.tar.gz`
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async function getLatestHeadBuildURL(platform, ruby) {
|
||||||
|
const engine = ruby.split('-')[0]
|
||||||
|
const repository = `ruby/${engine}-dev-builder`
|
||||||
|
const metadataURL = `https://raw.githubusercontent.com/${repository}/metadata/latest_build.tag`
|
||||||
|
const releasesURL = `https://github.com/${repository}/releases/download`
|
||||||
|
|
||||||
|
const response = await axios.get(metadataURL)
|
||||||
|
const tag = response.data.trim()
|
||||||
|
return `${releasesURL}/${tag}/${ruby}-${platform}.tar.gz`
|
||||||
|
}
|
||||||
@@ -1,35 +0,0 @@
|
|||||||
const os = require('os')
|
|
||||||
const path = require('path')
|
|
||||||
const core = require('@actions/core')
|
|
||||||
const io = require('@actions/io')
|
|
||||||
const tc = require('@actions/tool-cache')
|
|
||||||
const axios = require('axios')
|
|
||||||
|
|
||||||
const builderReleaseTag = 'builds-newer-openssl'
|
|
||||||
const releasesURL = 'https://github.com/eregon/ruby-install-builder/releases'
|
|
||||||
const metadataURL = 'https://raw.githubusercontent.com/eregon/ruby-install-builder/metadata'
|
|
||||||
|
|
||||||
export async function getAvailableVersions(engine) {
|
|
||||||
const response = await axios.get(`${metadataURL}/versions.json`)
|
|
||||||
const versions = response.data
|
|
||||||
return versions[engine]
|
|
||||||
}
|
|
||||||
|
|
||||||
export async function install(platform, ruby) {
|
|
||||||
const rubyPrefix = await downloadAndExtract(platform, ruby)
|
|
||||||
core.addPath(path.join(rubyPrefix, 'bin'))
|
|
||||||
return rubyPrefix
|
|
||||||
}
|
|
||||||
|
|
||||||
async function downloadAndExtract(platform, ruby) {
|
|
||||||
const rubiesDir = path.join(os.homedir(), '.rubies')
|
|
||||||
await io.mkdirP(rubiesDir)
|
|
||||||
|
|
||||||
const url = `${releasesURL}/download/${builderReleaseTag}/${ruby}-${platform}.tar.gz`
|
|
||||||
console.log(url)
|
|
||||||
|
|
||||||
const downloadPath = await tc.downloadTool(url)
|
|
||||||
await tc.extractTar(downloadPath, rubiesDir)
|
|
||||||
|
|
||||||
return path.join(rubiesDir, ruby)
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
require 'rbconfig'
|
||||||
|
require 'stringio'
|
||||||
|
|
||||||
|
puts "CPPFLAGS: #{RbConfig::CONFIG["CPPFLAGS"]}"
|
||||||
|
|
||||||
|
$stderr = StringIO.new
|
||||||
|
begin
|
||||||
|
system RbConfig.ruby, "-e", "p :OK"
|
||||||
|
out = $stderr.string
|
||||||
|
ensure
|
||||||
|
$stderr = STDERR
|
||||||
|
end
|
||||||
|
abort out unless out.empty?
|
||||||
@@ -22,5 +22,6 @@ export const versions = {
|
|||||||
"2.6.3": "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-2.6.3-1/rubyinstaller-2.6.3-1-x64.7z",
|
"2.6.3": "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-2.6.3-1/rubyinstaller-2.6.3-1-x64.7z",
|
||||||
"2.6.4": "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-2.6.4-1/rubyinstaller-2.6.4-1-x64.7z",
|
"2.6.4": "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-2.6.4-1/rubyinstaller-2.6.4-1-x64.7z",
|
||||||
"2.6.5": "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-2.6.5-1/rubyinstaller-2.6.5-1-x64.7z",
|
"2.6.5": "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-2.6.5-1/rubyinstaller-2.6.5-1-x64.7z",
|
||||||
"2.7.0": "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-2.7.0-1/rubyinstaller-2.7.0-1-x64.7z"
|
"2.7.0": "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-2.7.0-1/rubyinstaller-2.7.0-1-x64.7z",
|
||||||
|
"head": "https://github.com/oneclick/rubyinstaller2/releases/download/rubyinstaller-head/rubyinstaller-head-x64.7z"
|
||||||
}
|
}
|
||||||
+7
-4
@@ -5,9 +5,9 @@ const fs = require('fs')
|
|||||||
const core = require('@actions/core')
|
const core = require('@actions/core')
|
||||||
const exec = require('@actions/exec')
|
const exec = require('@actions/exec')
|
||||||
const tc = require('@actions/tool-cache')
|
const tc = require('@actions/tool-cache')
|
||||||
const rubyInstallerVersions = require('./ruby-installer-versions').versions
|
const rubyInstallerVersions = require('./windows-versions').versions
|
||||||
|
|
||||||
export async function getAvailableVersions(engine) {
|
export function getAvailableVersions(platform, engine) {
|
||||||
if (engine === 'ruby') {
|
if (engine === 'ruby') {
|
||||||
return Object.keys(rubyInstallerVersions)
|
return Object.keys(rubyInstallerVersions)
|
||||||
} else {
|
} else {
|
||||||
@@ -25,9 +25,12 @@ 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/ruby/setup-ruby/pull/14
|
||||||
|
const drive = (process.env['GITHUB_WORKSPACE'] || 'C')[0]
|
||||||
|
|
||||||
const downloadPath = await tc.downloadTool(url)
|
const downloadPath = await tc.downloadTool(url)
|
||||||
await exec.exec(`7z x ${downloadPath} -xr!${base}\\share\\doc -oC:\\`)
|
await exec.exec(`7z x ${downloadPath} -xr!${base}\\share\\doc -o${drive}:\\`)
|
||||||
const rubyPrefix = `C:\\${base}`
|
const rubyPrefix = `${drive}:\\${base}`
|
||||||
|
|
||||||
const [hostedRuby, msys2] = await linkMSYS2()
|
const [hostedRuby, msys2] = await linkMSYS2()
|
||||||
const newPath = setupPath(msys2, rubyPrefix)
|
const newPath = setupPath(msys2, rubyPrefix)
|
||||||
|
|||||||
@@ -109,12 +109,11 @@ astral-regex@^1.0.0:
|
|||||||
integrity sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg==
|
integrity sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg==
|
||||||
|
|
||||||
axios@^0.19.0:
|
axios@^0.19.0:
|
||||||
version "0.19.0"
|
version "0.19.2"
|
||||||
resolved "https://registry.yarnpkg.com/axios/-/axios-0.19.0.tgz#8e09bff3d9122e133f7b8101c8fbdd00ed3d2ab8"
|
resolved "https://registry.yarnpkg.com/axios/-/axios-0.19.2.tgz#3ea36c5d8818d0d5f8a8a97a6d36b86cdc00cb27"
|
||||||
integrity sha512-1uvKqKQta3KBxIz14F2v06AEHZ/dIoeKfbTRkK1E5oqjDnuEerLmYTgJB5AiQZHJcljpg1TuRzdjDR06qNk0DQ==
|
integrity sha512-fjgm5MvRHLhx+osE2xoekY70AhARk3a6hkN+3Io1jc00jtquGvxYlKlsFUhmUET0V5te6CcZI7lcv2Ym61mjHA==
|
||||||
dependencies:
|
dependencies:
|
||||||
follow-redirects "1.5.10"
|
follow-redirects "1.5.10"
|
||||||
is-buffer "^2.0.2"
|
|
||||||
|
|
||||||
balanced-match@^1.0.0:
|
balanced-match@^1.0.0:
|
||||||
version "1.0.0"
|
version "1.0.0"
|
||||||
@@ -487,11 +486,6 @@ inquirer@^7.0.0:
|
|||||||
strip-ansi "^5.1.0"
|
strip-ansi "^5.1.0"
|
||||||
through "^2.3.6"
|
through "^2.3.6"
|
||||||
|
|
||||||
is-buffer@^2.0.2:
|
|
||||||
version "2.0.4"
|
|
||||||
resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-2.0.4.tgz#3e572f23c8411a5cfd9557c849e3665e0b290623"
|
|
||||||
integrity sha512-Kq1rokWXOPXWuaMAqZiJW4XxsmD9zGx9q4aePabbn3qCRGedtH7Cm+zV8WETitMfu1wdh+Rvd6w5egwSngUX2A==
|
|
||||||
|
|
||||||
is-extglob@^2.1.1:
|
is-extglob@^2.1.1:
|
||||||
version "2.1.1"
|
version "2.1.1"
|
||||||
resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2"
|
resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2"
|
||||||
|
|||||||
Reference in New Issue
Block a user