mirror of
https://github.com/ruby/setup-ruby.git
synced 2026-09-13 14:34:21 +02:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
58366f2203 | ||
|
|
f5483241db |
@@ -14,7 +14,7 @@ jobs:
|
||||
matrix:
|
||||
os: [ ubuntu-16.04, ubuntu-18.04, macos-latest, windows-latest ]
|
||||
# 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:
|
||||
- os: windows-latest
|
||||
ruby: truffleruby
|
||||
|
||||
@@ -11,7 +11,7 @@ This action currently supports these versions of MRI, JRuby and TruffleRuby:
|
||||
|
||||
| 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 |
|
||||
| TruffleRuby | 19.3.0, 19.3.1, head |
|
||||
| Rubinius | 4.13 |
|
||||
|
||||
+20
-11
@@ -1442,7 +1442,7 @@ function validateRubyEngineAndVersion(platform, engineVersions, engine, version)
|
||||
|
||||
if (!engineVersions.includes(version)) {
|
||||
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) {
|
||||
version = found
|
||||
} else {
|
||||
@@ -4875,9 +4875,6 @@ 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]
|
||||
}
|
||||
@@ -4907,15 +4904,24 @@ async function downloadAndExtract(platform, 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`
|
||||
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`
|
||||
}
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
@@ -4932,13 +4938,15 @@ 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.5.0", "2.5.1", "2.5.2", "2.5.3", "2.5.4", "2.5.5", "2.5.6", "2.5.7",
|
||||
"2.6.0", "2.6.1", "2.6.2", "2.6.3", "2.6.4", "2.6.5",
|
||||
"2.7.0"
|
||||
"2.7.0",
|
||||
"head"
|
||||
],
|
||||
"jruby": [
|
||||
"9.2.9.0"
|
||||
],
|
||||
"truffleruby": [
|
||||
"head", "19.3.0", "19.3.1"
|
||||
"19.3.0", "19.3.1",
|
||||
"head"
|
||||
]
|
||||
}
|
||||
|
||||
@@ -5186,7 +5194,8 @@ 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.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"
|
||||
"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"
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -23,5 +23,7 @@ versions = entries.select { |entry|
|
||||
[version, entry[:href]]
|
||||
}.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"
|
||||
File.write 'windows-versions.js', js
|
||||
|
||||
@@ -51,7 +51,7 @@ function validateRubyEngineAndVersion(platform, engineVersions, engine, version)
|
||||
|
||||
if (!engineVersions.includes(version)) {
|
||||
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) {
|
||||
version = found
|
||||
} else {
|
||||
|
||||
@@ -5,13 +5,15 @@ 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.5.0", "2.5.1", "2.5.2", "2.5.3", "2.5.4", "2.5.5", "2.5.6", "2.5.7",
|
||||
"2.6.0", "2.6.1", "2.6.2", "2.6.3", "2.6.4", "2.6.5",
|
||||
"2.7.0"
|
||||
"2.7.0",
|
||||
"head"
|
||||
],
|
||||
"jruby": [
|
||||
"9.2.9.0"
|
||||
],
|
||||
"truffleruby": [
|
||||
"head", "19.3.0", "19.3.1"
|
||||
"19.3.0", "19.3.1",
|
||||
"head"
|
||||
]
|
||||
}
|
||||
|
||||
|
||||
+13
-7
@@ -9,9 +9,6 @@ const axios = require('axios')
|
||||
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'
|
||||
|
||||
export function getAvailableVersions(platform, engine) {
|
||||
return rubyBuilderVersions.getVersions(platform)[engine]
|
||||
}
|
||||
@@ -41,11 +38,20 @@ async function downloadAndExtract(platform, 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`
|
||||
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`
|
||||
}
|
||||
|
||||
+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.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"
|
||||
"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