mirror of
https://github.com/ruby/setup-ruby.git
synced 2026-09-13 14:34:21 +02:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a01ba37375 | ||
|
|
fdfc519f55 | ||
|
|
480f78f4b6 | ||
|
|
48efd73814 | ||
|
|
5478747ea7 | ||
|
|
8a173f1bc2 | ||
|
|
48481806ad |
@@ -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
|
||||||
|
|||||||
@@ -1,10 +1,15 @@
|
|||||||
# 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:
|
||||||
@@ -14,7 +19,7 @@ This action currently supports these versions of MRI, JRuby and TruffleRuby:
|
|||||||
| Ruby | 2.3.0 - 2.3.8, 2.4.0 - 2.4.9, 2.5.0 - 2.5.7, 2.6.0 - 2.6.5, 2.7.0, head |
|
| Ruby | 2.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 +37,9 @@ The action works for all [GitHub-hosted runners](https://help.github.com/en/acti
|
|||||||
|
|
||||||
Rubinius is only available on `ubuntu-latest`.
|
Rubinius is only available on `ubuntu-latest`.
|
||||||
|
|
||||||
The prebuilt releases are generated by [ruby-builder](https://github.com/eregon/ruby-builder)
|
The prebuilt releases are generated by [ruby-builder](https://github.com/ruby/ruby-builder)
|
||||||
and on Windows by [RubyInstaller2](https://github.com/oneclick/rubyinstaller2).
|
and on Windows by [RubyInstaller2](https://github.com/oneclick/rubyinstaller2).
|
||||||
`ruby-head` is generated by [ruby-dev-builder](https://github.com/eregon/ruby-dev-builder) and `truffleruby-head` is generated by [truffleruby-dev-builder](https://github.com/eregon/truffleruby-dev-builder).
|
`ruby-head` is generated by [ruby-dev-builder](https://github.com/ruby/ruby-dev-builder) and `truffleruby-head` is generated by [truffleruby-dev-builder](https://github.com/ruby/truffleruby-dev-builder).
|
||||||
The full list of available Ruby versions can be seen in [ruby-builder-versions.js](ruby-builder-versions.js)
|
The full list of available Ruby versions can be seen in [ruby-builder-versions.js](ruby-builder-versions.js)
|
||||||
for Ubuntu and macOS and in [windows-versions.js](windows-versions.js) for Windows.
|
for Ubuntu and macOS and in [windows-versions.js](windows-versions.js) for Windows.
|
||||||
|
|
||||||
@@ -50,7 +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
|
||||||
@@ -73,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
|
||||||
@@ -128,5 +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.
|
Many thanks to MSP-Greg and Lars Kanis for the help with Ruby Installer.
|
||||||
|
|||||||
+6
-6
@@ -1448,7 +1448,7 @@ function validateRubyEngineAndVersion(platform, engineVersions, engine, version)
|
|||||||
} else {
|
} else {
|
||||||
throw new Error(`Unknown version ${version} for ${engine} on ${platform}
|
throw new Error(`Unknown version ${version} for ${engine} on ${platform}
|
||||||
available versions for ${engine} on ${platform}: ${engineVersions.join(', ')}
|
available versions for ${engine} on ${platform}: ${engineVersions.join(', ')}
|
||||||
File an issue at https://github.com/eregon/use-ruby-action/issues if would like support for a new version`)
|
File an issue at https://github.com/ruby/setup-ruby/issues if would like support for a new version`)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2163,7 +2163,7 @@ function getVersions(platform) {
|
|||||||
|
|
||||||
if (platform === 'ubuntu-18.04') {
|
if (platform === 'ubuntu-18.04') {
|
||||||
versions['rubinius'] = [
|
versions['rubinius'] = [
|
||||||
"4.13"
|
"4.14"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -5148,8 +5148,8 @@ const tc = __webpack_require__(533)
|
|||||||
const rubyBuilderVersions = __webpack_require__(156)
|
const rubyBuilderVersions = __webpack_require__(156)
|
||||||
const axios = __webpack_require__(53)
|
const axios = __webpack_require__(53)
|
||||||
|
|
||||||
const builderReleaseTag = 'builds-newer-openssl'
|
const builderReleaseTag = 'builds-no-warn'
|
||||||
const releasesURL = 'https://github.com/eregon/ruby-builder/releases'
|
const releasesURL = 'https://github.com/ruby/ruby-builder/releases'
|
||||||
|
|
||||||
function getAvailableVersions(platform, engine) {
|
function getAvailableVersions(platform, engine) {
|
||||||
return rubyBuilderVersions.getVersions(platform)[engine]
|
return rubyBuilderVersions.getVersions(platform)[engine]
|
||||||
@@ -5189,7 +5189,7 @@ async function getDownloadURL(platform, ruby) {
|
|||||||
|
|
||||||
async function getLatestHeadBuildURL(platform, ruby) {
|
async function getLatestHeadBuildURL(platform, ruby) {
|
||||||
const engine = ruby.split('-')[0]
|
const engine = ruby.split('-')[0]
|
||||||
const repository = `eregon/${engine}-dev-builder`
|
const repository = `ruby/${engine}-dev-builder`
|
||||||
const metadataURL = `https://raw.githubusercontent.com/${repository}/metadata/latest_build.tag`
|
const metadataURL = `https://raw.githubusercontent.com/${repository}/metadata/latest_build.tag`
|
||||||
const releasesURL = `https://github.com/${repository}/releases/download`
|
const releasesURL = `https://github.com/${repository}/releases/download`
|
||||||
|
|
||||||
@@ -7885,7 +7885,7 @@ async function install(platform, ruby) {
|
|||||||
}
|
}
|
||||||
const base = url.slice(url.lastIndexOf('/') + 1, url.length - '.7z'.length)
|
const base = url.slice(url.lastIndexOf('/') + 1, url.length - '.7z'.length)
|
||||||
|
|
||||||
// Extract to SSD, see https://github.com/eregon/use-ruby-action/pull/14
|
// Extract to SSD, see https://github.com/ruby/setup-ruby/pull/14
|
||||||
const drive = (process.env['GITHUB_WORKSPACE'] || 'C')[0]
|
const drive = (process.env['GITHUB_WORKSPACE'] || 'C')[0]
|
||||||
|
|
||||||
const downloadPath = await tc.downloadTool(url)
|
const downloadPath = await tc.downloadTool(url)
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ function validateRubyEngineAndVersion(platform, engineVersions, engine, version)
|
|||||||
} else {
|
} else {
|
||||||
throw new Error(`Unknown version ${version} for ${engine} on ${platform}
|
throw new Error(`Unknown version ${version} for ${engine} on ${platform}
|
||||||
available versions for ${engine} on ${platform}: ${engineVersions.join(', ')}
|
available versions for ${engine} on ${platform}: ${engineVersions.join(', ')}
|
||||||
File an issue at https://github.com/eregon/use-ruby-action/issues if would like support for a new version`)
|
File an issue at https://github.com/ruby/setup-ruby/issues if would like support for a new version`)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+4
-4
@@ -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",
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ export function getVersions(platform) {
|
|||||||
|
|
||||||
if (platform === 'ubuntu-18.04') {
|
if (platform === 'ubuntu-18.04') {
|
||||||
versions['rubinius'] = [
|
versions['rubinius'] = [
|
||||||
"4.13"
|
"4.14"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+3
-3
@@ -6,8 +6,8 @@ const tc = require('@actions/tool-cache')
|
|||||||
const rubyBuilderVersions = require('./ruby-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-builder/releases'
|
const releasesURL = 'https://github.com/ruby/ruby-builder/releases'
|
||||||
|
|
||||||
export function getAvailableVersions(platform, engine) {
|
export function getAvailableVersions(platform, engine) {
|
||||||
return rubyBuilderVersions.getVersions(platform)[engine]
|
return rubyBuilderVersions.getVersions(platform)[engine]
|
||||||
@@ -47,7 +47,7 @@ async function getDownloadURL(platform, ruby) {
|
|||||||
|
|
||||||
async function getLatestHeadBuildURL(platform, ruby) {
|
async function getLatestHeadBuildURL(platform, ruby) {
|
||||||
const engine = ruby.split('-')[0]
|
const engine = ruby.split('-')[0]
|
||||||
const repository = `eregon/${engine}-dev-builder`
|
const repository = `ruby/${engine}-dev-builder`
|
||||||
const metadataURL = `https://raw.githubusercontent.com/${repository}/metadata/latest_build.tag`
|
const metadataURL = `https://raw.githubusercontent.com/${repository}/metadata/latest_build.tag`
|
||||||
const releasesURL = `https://github.com/${repository}/releases/download`
|
const releasesURL = `https://github.com/${repository}/releases/download`
|
||||||
|
|
||||||
|
|||||||
@@ -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?
|
||||||
+1
-1
@@ -25,7 +25,7 @@ export async function install(platform, ruby) {
|
|||||||
}
|
}
|
||||||
const base = url.slice(url.lastIndexOf('/') + 1, url.length - '.7z'.length)
|
const base = url.slice(url.lastIndexOf('/') + 1, url.length - '.7z'.length)
|
||||||
|
|
||||||
// Extract to SSD, see https://github.com/eregon/use-ruby-action/pull/14
|
// Extract to SSD, see https://github.com/ruby/setup-ruby/pull/14
|
||||||
const drive = (process.env['GITHUB_WORKSPACE'] || 'C')[0]
|
const drive = (process.env['GITHUB_WORKSPACE'] || 'C')[0]
|
||||||
|
|
||||||
const downloadPath = await tc.downloadTool(url)
|
const downloadPath = await tc.downloadTool(url)
|
||||||
|
|||||||
Reference in New Issue
Block a user