Compare commits

...
7 Commits
9 changed files with 43 additions and 22 deletions
+2
View File
@@ -35,6 +35,8 @@ jobs:
- run: ruby --version
- run: ridk version
if: matrix.os == 'windows-latest' && !startsWith(matrix.ruby, '2.3')
- name: Subprocess test
run: ruby test_subprocess.rb
- name: OpenSSL version
run: ruby -ropenssl -e 'puts OpenSSL::OPENSSL_LIBRARY_VERSION'
- name: OpenSSL test
+12 -6
View File
@@ -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`.
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.
Compared to [actions/setup-ruby](https://github.com/actions/setup-ruby),
this actions supports many more versions and features.
### Supported Versions
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 |
| JRuby | 9.2.9.0 |
| 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,
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`.
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).
`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)
for Ubuntu and macOS and in [windows-versions.js](windows-versions.js) for Windows.
@@ -50,7 +55,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: eregon/use-ruby-action@v1
- uses: ruby/setup-ruby@v1
with:
ruby-version: 2.6
- run: ruby -v
@@ -73,7 +78,7 @@ jobs:
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: eregon/use-ruby-action@v1
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
- run: ruby -v
@@ -128,5 +133,6 @@ This follows the [recommendations](https://github.com/actions/toolkit/blob/maste
## 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.
Many thanks to MSP-Greg and Lars Kanis for the help with Ruby Installer.
Generated Vendored
+6 -6
View File
@@ -1448,7 +1448,7 @@ function validateRubyEngineAndVersion(platform, engineVersions, engine, version)
} else {
throw new Error(`Unknown version ${version} for ${engine} on ${platform}
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') {
versions['rubinius'] = [
"4.13"
"4.14"
]
}
@@ -5148,8 +5148,8 @@ const tc = __webpack_require__(533)
const rubyBuilderVersions = __webpack_require__(156)
const axios = __webpack_require__(53)
const builderReleaseTag = 'builds-newer-openssl'
const releasesURL = 'https://github.com/eregon/ruby-builder/releases'
const builderReleaseTag = 'builds-no-warn'
const releasesURL = 'https://github.com/ruby/ruby-builder/releases'
function getAvailableVersions(platform, engine) {
return rubyBuilderVersions.getVersions(platform)[engine]
@@ -5189,7 +5189,7 @@ async function getDownloadURL(platform, ruby) {
async function getLatestHeadBuildURL(platform, ruby) {
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 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)
// 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 downloadPath = await tc.downloadTool(url)
+1 -1
View File
@@ -57,7 +57,7 @@ function validateRubyEngineAndVersion(platform, engineVersions, engine, version)
} else {
throw new Error(`Unknown version ${version} for ${engine} on ${platform}
available versions for ${engine} on ${platform}: ${engineVersions.join(', ')}
File an issue at https://github.com/eregon/use-ruby-action/issues if would like support for a new version`)
File an issue at https://github.com/ruby/setup-ruby/issues if would like support for a new version`)
}
}
+4 -4
View File
@@ -1,5 +1,5 @@
{
"name": "use-ruby-action",
"name": "setup-ruby",
"version": "0.1.0",
"description": "Download a prebuilt Ruby and add it to the PATH in 5 seconds",
"main": "index.js",
@@ -9,7 +9,7 @@
},
"repository": {
"type": "git",
"url": "git+https://github.com/eregon/use-ruby-action.git"
"url": "git+https://github.com/ruby/setup-ruby.git"
},
"keywords": [
"GitHub",
@@ -19,9 +19,9 @@
"author": "Benoit Daloze",
"license": "MIT",
"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": {
"@actions/core": "^1.1.1",
"@actions/exec": "^1.0.1",
+1 -1
View File
@@ -19,7 +19,7 @@ export function getVersions(platform) {
if (platform === 'ubuntu-18.04') {
versions['rubinius'] = [
"4.13"
"4.14"
]
}
+3 -3
View File
@@ -6,8 +6,8 @@ const tc = require('@actions/tool-cache')
const rubyBuilderVersions = require('./ruby-builder-versions')
const axios = require('axios')
const builderReleaseTag = 'builds-newer-openssl'
const releasesURL = 'https://github.com/eregon/ruby-builder/releases'
const builderReleaseTag = 'builds-no-warn'
const releasesURL = 'https://github.com/ruby/ruby-builder/releases'
export function getAvailableVersions(platform, engine) {
return rubyBuilderVersions.getVersions(platform)[engine]
@@ -47,7 +47,7 @@ async function getDownloadURL(platform, ruby) {
async function getLatestHeadBuildURL(platform, ruby) {
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 releasesURL = `https://github.com/${repository}/releases/download`
+13
View File
@@ -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
View File
@@ -25,7 +25,7 @@ export async function install(platform, ruby) {
}
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 downloadPath = await tc.downloadTool(url)