mirror of
https://github.com/ruby/setup-ruby.git
synced 2026-09-13 14:34:21 +02:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a7439cf424 | ||
|
|
b9675e15ad | ||
|
|
57a3395c80 | ||
|
|
296bf7f67a |
+18
-14
@@ -15,22 +15,26 @@ jobs:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [ ubuntu-18.04, ubuntu-20.04, macos-10.15, macos-11.0, windows-2019, windows-2022 ]
|
||||
ruby: [ 1.9, '2.0', 2.1, 2.2, 2.3, 2.4, 2.5, 2.6, 2.7, '3.0', 3.1, ruby-head, jruby, jruby-head, truffleruby, truffleruby-head, truffleruby+graalvm, truffleruby+graalvm-head ]
|
||||
os: [ ubuntu-18.04, ubuntu-20.04, macos-10.15, macos-11, macos-12, windows-2019, windows-2022 ]
|
||||
ruby: [ '1.9', '2.0', '2.1', '2.2', '2.3', '2.4', '2.5', '2.6', '2.7', '3.0', '3.1', ruby-head, jruby, jruby-head, truffleruby, truffleruby-head, truffleruby+graalvm, truffleruby+graalvm-head ]
|
||||
include:
|
||||
- { os: ubuntu-22.04, ruby: '3.1.0' }
|
||||
- { os: ubuntu-22.04, ruby: '3.1' }
|
||||
- { os: ubuntu-22.04, ruby: '3.2.0-preview1' }
|
||||
- { os: ubuntu-22.04, ruby: ruby-head }
|
||||
- { os: windows-2019, ruby: mingw }
|
||||
- { os: windows-2019, ruby: mswin }
|
||||
- { os: windows-2022, ruby: mingw }
|
||||
- { os: windows-2022, ruby: mswin }
|
||||
- { os: windows-2022, ruby: ucrt }
|
||||
exclude:
|
||||
- { os: windows-2019, ruby: 1.9 }
|
||||
- { os: windows-2019, ruby: '1.9' }
|
||||
- { os: windows-2019, ruby: debug }
|
||||
- { os: windows-2019, ruby: truffleruby }
|
||||
- { os: windows-2019, ruby: truffleruby-head }
|
||||
- { os: windows-2019, ruby: truffleruby+graalvm }
|
||||
- { os: windows-2019, ruby: truffleruby+graalvm-head }
|
||||
- { os: windows-2022, ruby: 1.9 }
|
||||
- { os: windows-2022, ruby: '1.9' }
|
||||
- { os: windows-2022, ruby: debug }
|
||||
- { os: windows-2022, ruby: truffleruby }
|
||||
- { os: windows-2022, ruby: truffleruby-head }
|
||||
@@ -120,7 +124,7 @@ jobs:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: ./
|
||||
with:
|
||||
ruby-version: 2.6
|
||||
ruby-version: '2.6'
|
||||
rubygems: latest
|
||||
- run: ruby -e "exit(Gem.rubygems_version > Gem::Version.new('3.0.3'))"
|
||||
|
||||
@@ -131,7 +135,7 @@ jobs:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: ./
|
||||
with:
|
||||
ruby-version: 2.6
|
||||
ruby-version: '2.6'
|
||||
rubygems: 3.2.3
|
||||
- run: gem --version | grep -F "3.2.3"
|
||||
|
||||
@@ -142,7 +146,7 @@ jobs:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: ./
|
||||
with:
|
||||
ruby-version: 3.1.0
|
||||
ruby-version: '3.1.0'
|
||||
rubygems: 3.2.3
|
||||
- run: gem --version | grep -F "3.3.3"
|
||||
|
||||
@@ -153,7 +157,7 @@ jobs:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: ./
|
||||
with:
|
||||
ruby-version: 2.2
|
||||
ruby-version: '2.2'
|
||||
rubygems: 2.7.11
|
||||
- run: gem --version | grep -F "2.7.11"
|
||||
- run: bundle --version | grep -F "1.16.6"
|
||||
@@ -165,7 +169,7 @@ jobs:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: ./
|
||||
with:
|
||||
ruby-version: 2.2
|
||||
ruby-version: '2.2'
|
||||
bundler: 1.16.6
|
||||
- run: bundle --version | grep -F "1.16.6" # And not 1.17.x from ~> 1
|
||||
|
||||
@@ -176,7 +180,7 @@ jobs:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: ./
|
||||
with:
|
||||
ruby-version: 2.6
|
||||
ruby-version: '2.6'
|
||||
bundler: 2
|
||||
- run: bundle --version | grep -P "Bundler version 2\.\d+\.\d+"
|
||||
|
||||
@@ -187,7 +191,7 @@ jobs:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: ./
|
||||
with:
|
||||
ruby-version: 2.6
|
||||
ruby-version: '2.6'
|
||||
bundler: 2.2
|
||||
- run: bundle --version | grep -P "Bundler version 2\.2\.\d+"
|
||||
|
||||
@@ -198,7 +202,7 @@ jobs:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: ./
|
||||
with:
|
||||
ruby-version: 2.6
|
||||
ruby-version: '2.6'
|
||||
bundler: 2.2.3
|
||||
- run: bundle --version | grep -F "Bundler version 2.2.3"
|
||||
|
||||
@@ -211,7 +215,7 @@ jobs:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: ./
|
||||
with:
|
||||
ruby-version: 2.7
|
||||
ruby-version: '2.7'
|
||||
bundler: 1
|
||||
bundler-cache: true
|
||||
- run: bundle --version | grep -F "Bundler version 1."
|
||||
@@ -229,7 +233,7 @@ jobs:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: ./
|
||||
with:
|
||||
ruby-version: 2.6
|
||||
ruby-version: '2.6'
|
||||
bundler-cache: true
|
||||
- run: bundle exec rails --version
|
||||
|
||||
|
||||
@@ -39,10 +39,12 @@ The action works on these [GitHub-hosted runners](https://help.github.com/en/act
|
||||
|
||||
| Operating System | Recommended | Other Supported Versions |
|
||||
| ----------- | -------- | -------- |
|
||||
| Ubuntu | `ubuntu-latest` (= `ubuntu-20.04`) | `ubuntu-18.04` |
|
||||
| macOS | `macos-latest` (= `macos-10.15`) | `macos-11.0` |
|
||||
| Ubuntu | `ubuntu-latest` (= `ubuntu-20.04`) | `ubuntu-18.04`, `ubuntu-22.04` (beta, only `ruby: 3.1 - head`) |
|
||||
| macOS | `macos-latest` (= `macos-11`) | `macos-10.15`, `macos-12` (beta) |
|
||||
| Windows | `windows-latest` (= `windows-2022`) | `windows-2019` |
|
||||
|
||||
On `ubuntu-22.04` (beta), only `ruby: 3.1 - head` are supported, due to Ubuntu 22.04 only supporting OpenSSL 3.
|
||||
|
||||
The prebuilt releases are generated by [ruby-builder](https://github.com/ruby/ruby-builder)
|
||||
and on Windows by [RubyInstaller2](https://github.com/oneclick/rubyinstaller2).
|
||||
`mingw` and `mswin` builds are generated by [ruby-loco](https://github.com/MSP-Greg/ruby-loco).
|
||||
@@ -67,7 +69,7 @@ jobs:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: ruby/setup-ruby@v1
|
||||
with:
|
||||
ruby-version: 2.6 # Not needed with a .ruby-version file
|
||||
ruby-version: '3.0' # Not needed with a .ruby-version file
|
||||
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
|
||||
- run: bundle exec rake
|
||||
```
|
||||
@@ -86,7 +88,7 @@ jobs:
|
||||
matrix:
|
||||
os: [ubuntu-latest, macos-latest]
|
||||
# Due to https://github.com/actions/runner/issues/849, we have to use quotes for '3.0'
|
||||
ruby: [2.6, 2.7, '3.0', 3.1, head, jruby, jruby-head, truffleruby, truffleruby-head]
|
||||
ruby: ['2.7', '3.0', '3.1', head, jruby, jruby-head, truffleruby, truffleruby-head]
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
@@ -115,7 +117,7 @@ jobs:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: ruby/setup-ruby@v1
|
||||
with:
|
||||
ruby-version: 2.6
|
||||
ruby-version: '3.0'
|
||||
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
|
||||
- run: bundle exec rake
|
||||
```
|
||||
@@ -127,8 +129,8 @@ and the [condition and expression syntax](https://help.github.com/en/actions/ref
|
||||
### Supported Version Syntax
|
||||
|
||||
* engine-version like `ruby-2.6.5` and `truffleruby-19.3.0`
|
||||
* 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
|
||||
* short version like `'2.6'`, automatically using the latest release matching that version (`2.6.10`)
|
||||
* 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` reads from the project's `.ruby-version` file
|
||||
* `.tool-versions` reads from the project's `.tool-versions` file
|
||||
|
||||
@@ -98,6 +98,17 @@ function getImageOS() {
|
||||
return imageOS
|
||||
}
|
||||
|
||||
export const supportedPlatforms = [
|
||||
'ubuntu-18.04',
|
||||
'ubuntu-20.04',
|
||||
'ubuntu-22.04',
|
||||
'macos-10.15',
|
||||
'macos-11',
|
||||
'macos-12',
|
||||
'windows-2019',
|
||||
'windows-2022',
|
||||
]
|
||||
|
||||
export function getVirtualEnvironmentName() {
|
||||
const imageOS = getImageOS()
|
||||
|
||||
@@ -108,7 +119,11 @@ export function getVirtualEnvironmentName() {
|
||||
|
||||
match = imageOS.match(/^macos(\d{2})(\d+)?/) // e.g. macos1015, macos11
|
||||
if (match) {
|
||||
return `macos-${match[1]}.${match[2] || '0'}`
|
||||
if (match[2]) {
|
||||
return `macos-${match[1]}.${match[2]}`
|
||||
} else {
|
||||
return `macos-${match[1]}`
|
||||
}
|
||||
}
|
||||
|
||||
match = imageOS.match(/^win(\d+)/) // e.g. win19
|
||||
|
||||
+34
-3
@@ -259,6 +259,7 @@ __nccwpck_require__.r(__webpack_exports__);
|
||||
/* harmony export */ "isBundler2Default": () => (/* binding */ isBundler2Default),
|
||||
/* harmony export */ "floatVersion": () => (/* binding */ floatVersion),
|
||||
/* harmony export */ "hashFile": () => (/* binding */ hashFile),
|
||||
/* harmony export */ "supportedPlatforms": () => (/* binding */ supportedPlatforms),
|
||||
/* harmony export */ "getVirtualEnvironmentName": () => (/* binding */ getVirtualEnvironmentName),
|
||||
/* harmony export */ "shouldUseToolCache": () => (/* binding */ shouldUseToolCache),
|
||||
/* harmony export */ "getToolCacheRubyPrefix": () => (/* binding */ getToolCacheRubyPrefix),
|
||||
@@ -366,6 +367,17 @@ function getImageOS() {
|
||||
return imageOS
|
||||
}
|
||||
|
||||
const supportedPlatforms = [
|
||||
'ubuntu-18.04',
|
||||
'ubuntu-20.04',
|
||||
'ubuntu-22.04',
|
||||
'macos-10.15',
|
||||
'macos-11',
|
||||
'macos-12',
|
||||
'windows-2019',
|
||||
'windows-2022',
|
||||
]
|
||||
|
||||
function getVirtualEnvironmentName() {
|
||||
const imageOS = getImageOS()
|
||||
|
||||
@@ -376,7 +388,11 @@ function getVirtualEnvironmentName() {
|
||||
|
||||
match = imageOS.match(/^macos(\d{2})(\d+)?/) // e.g. macos1015, macos11
|
||||
if (match) {
|
||||
return `macos-${match[1]}.${match[2] || '0'}`
|
||||
if (match[2]) {
|
||||
return `macos-${match[1]}.${match[2]}`
|
||||
} else {
|
||||
return `macos-${match[1]}`
|
||||
}
|
||||
}
|
||||
|
||||
match = imageOS.match(/^win(\d+)/) // e.g. win19
|
||||
@@ -59565,6 +59581,17 @@ const releasesURL = 'https://github.com/ruby/ruby-builder/releases'
|
||||
const windows = common.windows
|
||||
|
||||
function getAvailableVersions(platform, engine) {
|
||||
if (!common.supportedPlatforms.includes(platform)) {
|
||||
throw new Error(`Unsupported platform ${platform}`)
|
||||
}
|
||||
|
||||
if (platform === 'ubuntu-22.04') {
|
||||
const rubyVersions = rubyBuilderVersions['ruby']
|
||||
return {
|
||||
ruby: rubyVersions.slice(rubyVersions.indexOf('3.1.0')),
|
||||
}[engine]
|
||||
}
|
||||
|
||||
return rubyBuilderVersions[engine]
|
||||
}
|
||||
|
||||
@@ -59747,6 +59774,10 @@ const msysPathEntries = [`${msys1}\\mingw\\x86_64-w64-mingw32\\bin`, `${msys1}\\
|
||||
const virtualEnv = common.getVirtualEnvironmentName()
|
||||
|
||||
function getAvailableVersions(platform, engine) {
|
||||
if (!common.supportedPlatforms.includes(platform)) {
|
||||
throw new Error(`Unsupported platform ${platform}`)
|
||||
}
|
||||
|
||||
if (engine === 'ruby') {
|
||||
return Object.keys(rubyInstallerVersions)
|
||||
} else {
|
||||
@@ -60315,7 +60346,7 @@ async function setupRuby(options = {}) {
|
||||
const [engine, parsedVersion] = parseRubyEngineAndVersion(inputs['ruby-version'])
|
||||
|
||||
let installer
|
||||
if (platform.startsWith('windows-') && engine !== 'jruby') {
|
||||
if (platform.startsWith('windows-') && engine === 'ruby') {
|
||||
installer = __nccwpck_require__(3216)
|
||||
} else {
|
||||
installer = __nccwpck_require__(9974)
|
||||
@@ -60424,7 +60455,7 @@ function validateRubyEngineAndVersion(platform, engineVersions, engine, parsedVe
|
||||
throw new Error(`Unknown version ${parsedVersion} for ${engine} on ${platform}
|
||||
available versions for ${engine} on ${platform}: ${engineVersions.join(', ')}
|
||||
Make sure you use the latest version of the action with - uses: ruby/setup-ruby@v1
|
||||
File an issue at https://github.com/ruby/setup-ruby/issues if would like support for a new version`)
|
||||
File an issue at https://github.com/ruby/setup-ruby/issues if you would like support for a new version`)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ export async function setupRuby(options = {}) {
|
||||
const [engine, parsedVersion] = parseRubyEngineAndVersion(inputs['ruby-version'])
|
||||
|
||||
let installer
|
||||
if (platform.startsWith('windows-') && engine !== 'jruby') {
|
||||
if (platform.startsWith('windows-') && engine === 'ruby') {
|
||||
installer = require('./windows')
|
||||
} else {
|
||||
installer = require('./ruby-builder')
|
||||
@@ -151,7 +151,7 @@ function validateRubyEngineAndVersion(platform, engineVersions, engine, parsedVe
|
||||
throw new Error(`Unknown version ${parsedVersion} for ${engine} on ${platform}
|
||||
available versions for ${engine} on ${platform}: ${engineVersions.join(', ')}
|
||||
Make sure you use the latest version of the action with - uses: ruby/setup-ruby@v1
|
||||
File an issue at https://github.com/ruby/setup-ruby/issues if would like support for a new version`)
|
||||
File an issue at https://github.com/ruby/setup-ruby/issues if you would like support for a new version`)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -13,6 +13,17 @@ const releasesURL = 'https://github.com/ruby/ruby-builder/releases'
|
||||
const windows = common.windows
|
||||
|
||||
export function getAvailableVersions(platform, engine) {
|
||||
if (!common.supportedPlatforms.includes(platform)) {
|
||||
throw new Error(`Unsupported platform ${platform}`)
|
||||
}
|
||||
|
||||
if (platform === 'ubuntu-22.04') {
|
||||
const rubyVersions = rubyBuilderVersions['ruby']
|
||||
return {
|
||||
ruby: rubyVersions.slice(rubyVersions.indexOf('3.1.0')),
|
||||
}[engine]
|
||||
}
|
||||
|
||||
return rubyBuilderVersions[engine]
|
||||
}
|
||||
|
||||
|
||||
@@ -25,6 +25,10 @@ const msysPathEntries = [`${msys1}\\mingw\\x86_64-w64-mingw32\\bin`, `${msys1}\\
|
||||
const virtualEnv = common.getVirtualEnvironmentName()
|
||||
|
||||
export function getAvailableVersions(platform, engine) {
|
||||
if (!common.supportedPlatforms.includes(platform)) {
|
||||
throw new Error(`Unsupported platform ${platform}`)
|
||||
}
|
||||
|
||||
if (engine === 'ruby') {
|
||||
return Object.keys(rubyInstallerVersions)
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user