diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 0d35fe5..5f560c4 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -18,6 +18,10 @@ jobs: 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 ] 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 } diff --git a/README.md b/README.md index 43a7f2d..cae33cf 100644 --- a/README.md +++ b/README.md @@ -43,6 +43,8 @@ The action works on these [GitHub-hosted runners](https://help.github.com/en/act | macOS | `macos-latest` (= `macos-10.15`) | `macos-11.0` | | 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). diff --git a/common.js b/common.js index ae9b78a..7a0d21f 100644 --- a/common.js +++ b/common.js @@ -101,6 +101,7 @@ function getImageOS() { export const supportedPlatforms = [ 'ubuntu-18.04', 'ubuntu-20.04', + 'ubuntu-22.04', 'macos-10.15', 'macos-11.0', 'windows-2019', diff --git a/dist/index.js b/dist/index.js index 3a40693..452b154 100644 --- a/dist/index.js +++ b/dist/index.js @@ -370,6 +370,7 @@ function getImageOS() { const supportedPlatforms = [ 'ubuntu-18.04', 'ubuntu-20.04', + 'ubuntu-22.04', 'macos-10.15', 'macos-11.0', 'windows-2019', @@ -59579,6 +59580,13 @@ function getAvailableVersions(platform, engine) { 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] } @@ -60442,7 +60450,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`) } } diff --git a/index.js b/index.js index 9dd98da..0efd0ee 100644 --- a/index.js +++ b/index.js @@ -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`) } } diff --git a/ruby-builder.js b/ruby-builder.js index 81ca2cd..c7c6a3b 100644 --- a/ruby-builder.js +++ b/ruby-builder.js @@ -17,6 +17,13 @@ export function getAvailableVersions(platform, engine) { 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] }