Compare commits

..
6 Commits
6 changed files with 23 additions and 17 deletions
+11 -5
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`. 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:
@@ -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.
Generated Vendored
+4 -4
View File
@@ -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`)
} }
} }
@@ -5149,7 +5149,7 @@ const rubyBuilderVersions = __webpack_require__(156)
const axios = __webpack_require__(53) const axios = __webpack_require__(53)
const builderReleaseTag = 'builds-no-warn' 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)
+1 -1
View File
@@ -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
View File
@@ -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",
+2 -2
View File
@@ -7,7 +7,7 @@ const rubyBuilderVersions = require('./ruby-builder-versions')
const axios = require('axios') const axios = require('axios')
const builderReleaseTag = 'builds-no-warn' 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`
+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) 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)