mirror of
https://github.com/ruby/setup-ruby.git
synced 2026-09-13 14:34:21 +02:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
48481806ad | ||
|
|
623e527949 | ||
|
|
c933cecfdc | ||
|
|
7c15ff8590 | ||
|
|
58366f2203 | ||
|
|
f5483241db |
@@ -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, ruby-2.4, 2.5, ruby-2.6.5, 2.7.0, jruby, truffleruby, truffleruby-head, rubinius ]
|
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
|
||||||
@@ -35,6 +35,8 @@ 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'
|
||||||
- name: OpenSSL test
|
- name: OpenSSL test
|
||||||
|
|||||||
@@ -11,10 +11,10 @@ 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, head |
|
| TruffleRuby | 19.3.0, 19.3.1, head |
|
||||||
| Rubinius | 4.13 |
|
| 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.
|
||||||
@@ -32,9 +32,10 @@ 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 rubies are generated by [eregon/ruby-install-builder](https://github.com/eregon/ruby-install-builder)
|
The prebuilt releases are generated by [ruby-builder](https://github.com/eregon/ruby-builder)
|
||||||
and on Windows by [RubyInstaller2](https://github.com/oneclick/rubyinstaller2).
|
and on Windows by [RubyInstaller2](https://github.com/oneclick/rubyinstaller2).
|
||||||
The full list of available Ruby versions can be seen in [ruby-install-builder-versions.js](ruby-install-builder-versions.js)
|
`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).
|
||||||
|
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.
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|||||||
+109
-100
@@ -1402,7 +1402,7 @@ 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 = installer.getAvailableVersions(platform, engine)
|
const engineVersions = installer.getAvailableVersions(platform, engine)
|
||||||
@@ -1442,7 +1442,7 @@ 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 {
|
||||||
@@ -2134,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:
|
||||||
@@ -4855,103 +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 rubyBuilderVersions = __webpack_require__(451)
|
|
||||||
const axios = __webpack_require__(53)
|
|
||||||
|
|
||||||
const builderReleaseTag = 'builds-newer-openssl'
|
|
||||||
const releasesURL = 'https://github.com/eregon/ruby-install-builder/releases'
|
|
||||||
|
|
||||||
const truffleRubyHeadReleaseURL = 'https://github.com/eregon/truffleruby-dev-builder/releases/download'
|
|
||||||
const truffleRubyHeadMetadataURL = 'https://raw.githubusercontent.com/eregon/truffleruby-dev-builder/metadata/latest_build.tag'
|
|
||||||
|
|
||||||
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 === 'truffleruby-head') {
|
|
||||||
const response = await axios.get(truffleRubyHeadMetadataURL)
|
|
||||||
const tag = response.data.trim()
|
|
||||||
return `${truffleRubyHeadReleaseURL}/${tag}/${ruby}-${platform}.tar.gz`
|
|
||||||
} else {
|
|
||||||
return `${releasesURL}/download/${builderReleaseTag}/${ruby}-${platform}.tar.gz`
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/***/ }),
|
|
||||||
|
|
||||||
/***/ 451:
|
|
||||||
/***/ (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"
|
|
||||||
],
|
|
||||||
"jruby": [
|
|
||||||
"9.2.9.0"
|
|
||||||
],
|
|
||||||
"truffleruby": [
|
|
||||||
"head", "19.3.0", "19.3.1"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
||||||
if (platform === 'ubuntu-18.04') {
|
|
||||||
versions['rubinius'] = [
|
|
||||||
"4.13"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
||||||
return versions
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
||||||
/***/ 470:
|
/***/ 470:
|
||||||
@@ -5186,7 +5126,76 @@ 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"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ 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/eregon/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 = `eregon/${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`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -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 'windows-versions.js', js
|
File.write 'windows-versions.js', js
|
||||||
@@ -11,7 +11,7 @@ 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 = installer.getAvailableVersions(platform, engine)
|
const engineVersions = installer.getAvailableVersions(platform, engine)
|
||||||
@@ -51,7 +51,7 @@ 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 {
|
||||||
|
|||||||
@@ -5,19 +5,21 @@ export function getVersions(platform) {
|
|||||||
"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",
|
||||||
"2.6.0", "2.6.1", "2.6.2", "2.6.3", "2.6.4", "2.6.5",
|
"2.6.0", "2.6.1", "2.6.2", "2.6.3", "2.6.4", "2.6.5",
|
||||||
"2.7.0"
|
"2.7.0",
|
||||||
|
"head"
|
||||||
],
|
],
|
||||||
"jruby": [
|
"jruby": [
|
||||||
"9.2.9.0"
|
"9.2.9.0"
|
||||||
],
|
],
|
||||||
"truffleruby": [
|
"truffleruby": [
|
||||||
"head", "19.3.0", "19.3.1"
|
"19.3.0", "19.3.1",
|
||||||
|
"head"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
if (platform === 'ubuntu-18.04') {
|
if (platform === 'ubuntu-18.04') {
|
||||||
versions['rubinius'] = [
|
versions['rubinius'] = [
|
||||||
"4.13"
|
"4.14"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3,14 +3,11 @@ const path = require('path')
|
|||||||
const core = require('@actions/core')
|
const core = require('@actions/core')
|
||||||
const io = require('@actions/io')
|
const io = require('@actions/io')
|
||||||
const tc = require('@actions/tool-cache')
|
const tc = require('@actions/tool-cache')
|
||||||
const rubyBuilderVersions = require('./ruby-install-builder-versions')
|
const rubyBuilderVersions = require('./ruby-builder-versions')
|
||||||
const axios = require('axios')
|
const axios = require('axios')
|
||||||
|
|
||||||
const builderReleaseTag = 'builds-newer-openssl'
|
const builderReleaseTag = 'builds-no-warn'
|
||||||
const releasesURL = 'https://github.com/eregon/ruby-install-builder/releases'
|
const releasesURL = 'https://github.com/eregon/ruby-builder/releases'
|
||||||
|
|
||||||
const truffleRubyHeadReleaseURL = 'https://github.com/eregon/truffleruby-dev-builder/releases/download'
|
|
||||||
const truffleRubyHeadMetadataURL = 'https://raw.githubusercontent.com/eregon/truffleruby-dev-builder/metadata/latest_build.tag'
|
|
||||||
|
|
||||||
export function getAvailableVersions(platform, engine) {
|
export function getAvailableVersions(platform, engine) {
|
||||||
return rubyBuilderVersions.getVersions(platform)[engine]
|
return rubyBuilderVersions.getVersions(platform)[engine]
|
||||||
@@ -41,11 +38,20 @@ async function downloadAndExtract(platform, ruby) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function getDownloadURL(platform, ruby) {
|
async function getDownloadURL(platform, ruby) {
|
||||||
if (ruby === 'truffleruby-head') {
|
if (ruby.endsWith('-head')) {
|
||||||
const response = await axios.get(truffleRubyHeadMetadataURL)
|
return getLatestHeadBuildURL(platform, ruby)
|
||||||
const tag = response.data.trim()
|
|
||||||
return `${truffleRubyHeadReleaseURL}/${tag}/${ruby}-${platform}.tar.gz`
|
|
||||||
} else {
|
} else {
|
||||||
return `${releasesURL}/download/${builderReleaseTag}/${ruby}-${platform}.tar.gz`
|
return `${releasesURL}/download/${builderReleaseTag}/${ruby}-${platform}.tar.gz`
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function getLatestHeadBuildURL(platform, ruby) {
|
||||||
|
const engine = ruby.split('-')[0]
|
||||||
|
const repository = `eregon/${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`
|
||||||
|
}
|
||||||
@@ -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?
|
||||||
+2
-1
@@ -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"
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user