Compare commits

...
4 Commits
9 changed files with 54 additions and 3333 deletions
+1 -1
View File
@@ -15,7 +15,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.2, 2.3, 2.7.0, ruby-head, jruby, truffleruby, truffleruby-head, rubinius ]
ruby: [ .ruby-version, .tool-versions, 2.2, 2.3, ruby-head, jruby, jruby-head, truffleruby, truffleruby-head, rubinius ]
exclude:
- os: windows-latest
ruby: truffleruby
+2
View File
@@ -0,0 +1,2 @@
nodejs 12.0.0
ruby 2.7.0
+9 -4
View File
@@ -17,7 +17,7 @@ This action currently supports these versions of MRI, JRuby and TruffleRuby:
| Interpreter | Versions |
| ----------- | -------- |
| Ruby | 2.2, 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, head |
| TruffleRuby | 19.3.0, 19.3.1, head |
| Rubinius | 4.14 |
@@ -91,7 +91,11 @@ jobs:
* short version like `2.6`, automatically using the latest release matching that version (`2.6.5`)
* version only like `2.6.5`, assumes MRI for the engine
* engine only like `truffleruby`, uses the latest stable release of that implementation
* `.ruby-version` (also the default value) reads from the project's `.ruby-version` file
* `.ruby-version` reads from the project's `.ruby-version` file
* `.tool-versions` reads from the project's `.tool-versions` file
* If the `ruby-version` input is not specified, `.ruby-version` is tried first, followed by `.tool-versions`
### Bundler
@@ -117,7 +121,8 @@ You can cache the installed gems with these two steps:
```
When using a single job with a Ruby version, replace `${{ matrix.ruby }}` with the Ruby version.
When using `.ruby-version`, replace `${{ matrix.ruby }}` with `${{ hashFiles('.ruby-version') }}`.
When using `.ruby-version`, replace `${{ matrix.ruby }}` with `${{ hashFiles('.ruby-version') }}`.
When using `.tool-versions`, replace `${{ matrix.ruby }}` with `${{ hashFiles('.tool-versions') }}`.
This uses the [cache action](https://github.com/actions/cache).
The code above is a more complete version of the [Ruby - Bundler example](https://github.com/actions/cache/blob/master/examples.md#ruby---bundler).
@@ -130,7 +135,7 @@ It is recommended to first get your build working on Ubuntu and macOS before try
* The default shell on Windows is not Bash but [PowerShell](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#using-a-specific-shell).
This can lead issues such as multi-line scripts [not working as expected](https://github.com/ruby/setup-ruby/issues/13).
* The `PATH` contains [multiple compiler toolchains](https://github.com/ruby/setup-ruby/issues/19). Use `where` to debug which tool is used.
* The `PATH` contains [multiple compiler toolchains](https://github.com/ruby/setup-ruby/issues/19). Use `where.exe` to debug which tool is used.
* MSYS2 is prepended to the `PATH`, similar to what RubyInstaller2 does.
* JRuby on Windows has a known bug that `bundle exec rake` [fails](https://github.com/ruby/setup-ruby/issues/18).
+1 -1
View File
@@ -8,7 +8,7 @@ inputs:
ruby-version:
description: 'Engine and version to use, see the syntax in the README. Reads from .ruby-version if unset.'
required: false
default: '.ruby-version'
default: 'default'
outputs:
ruby-prefix:
description: 'The prefix of the installed ruby'
Generated Vendored
+20 -3314
View File
File diff suppressed because it is too large Load Diff
+15
View File
@@ -25,9 +25,24 @@ async function run() {
}
function parseRubyEngineAndVersion(rubyVersion) {
if (rubyVersion === 'default') {
if (fs.existsSync('.ruby-version')) {
rubyVersion = '.ruby-version'
} else if (fs.existsSync('.tool-versions')) {
rubyVersion = '.tool-versions'
} else {
throw new Error('input ruby-version needs to be specified if no .ruby-version or .tool-versions file exists')
}
}
if (rubyVersion === '.ruby-version') { // Read from .ruby-version
rubyVersion = fs.readFileSync('.ruby-version', 'utf8').trim()
console.log(`Using ${rubyVersion} as input from file .ruby-version`)
} else if (rubyVersion === '.tool-versions') { // Read from .tool-versions
const toolVersions = fs.readFileSync('.tool-versions', 'utf8').trim()
const rubyLine = toolVersions.split(/\r?\n/).filter(e => e.match(/^ruby\s/))[0]
rubyVersion = rubyLine.split(/\s+/, 2)[1]
console.log(`Using ${rubyVersion} as input from file .tool-versions`)
}
let engine, version
+1 -2
View File
@@ -26,8 +26,7 @@
"@actions/core": "^1.1.1",
"@actions/exec": "^1.0.1",
"@actions/io": "^1.0.1",
"@actions/tool-cache": "^1.1.2",
"axios": "^0.19.0"
"@actions/tool-cache": "^1.1.2"
},
"devDependencies": {
"@zeit/ncc": "^0.20.5",
+2 -1
View File
@@ -10,7 +10,8 @@ export function getVersions(platform) {
"head"
],
"jruby": [
"9.2.9.0"
"9.2.9.0",
"head"
],
"truffleruby": [
"19.3.0", "19.3.1",
+3 -10
View File
@@ -4,7 +4,6 @@ const core = require('@actions/core')
const io = require('@actions/io')
const tc = require('@actions/tool-cache')
const rubyBuilderVersions = require('./ruby-builder-versions')
const axios = require('axios')
const builderReleaseTag = 'builds-no-warn'
const releasesURL = 'https://github.com/ruby/ruby-builder/releases'
@@ -41,7 +40,7 @@ async function downloadAndExtract(platform, ruby) {
return path.join(rubiesDir, ruby)
}
async function getDownloadURL(platform, ruby) {
function getDownloadURL(platform, ruby) {
if (ruby.endsWith('-head')) {
return getLatestHeadBuildURL(platform, ruby)
} else {
@@ -49,13 +48,7 @@ async function getDownloadURL(platform, ruby) {
}
}
async function getLatestHeadBuildURL(platform, ruby) {
function getLatestHeadBuildURL(platform, ruby) {
const engine = ruby.split('-')[0]
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`
const response = await axios.get(metadataURL)
const tag = response.data.trim()
return `${releasesURL}/${tag}/${ruby}-${platform}.tar.gz`
return `https://github.com/ruby/${engine}-dev-builder/releases/latest/download/${engine}-head-${platform}.tar.gz`
}