Skip to content

Commit 57a3395

Browse files
committed
Support some Rubies on ubuntu-22.04
1 parent 296bf7f commit 57a3395

File tree

6 files changed

+24
-2
lines changed

6 files changed

+24
-2
lines changed

.github/workflows/test.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ jobs:
1818
os: [ ubuntu-18.04, ubuntu-20.04, macos-10.15, macos-11.0, windows-2019, windows-2022 ]
1919
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 ]
2020
include:
21+
- { os: ubuntu-22.04, ruby: 3.1.0 }
22+
- { os: ubuntu-22.04, ruby: 3.1 }
23+
- { os: ubuntu-22.04, ruby: 3.2.0-preview1 }
24+
- { os: ubuntu-22.04, ruby: ruby-head }
2125
- { os: windows-2019, ruby: mingw }
2226
- { os: windows-2019, ruby: mswin }
2327
- { os: windows-2022, ruby: mingw }

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ The action works on these [GitHub-hosted runners](https://help.github.com/en/act
4343
| macOS | `macos-latest` (= `macos-10.15`) | `macos-11.0` |
4444
| Windows | `windows-latest` (= `windows-2022`) | `windows-2019` |
4545

46+
On `ubuntu-22.04` (beta), only `ruby: 3.1 - head` are supported, due to Ubuntu 22.04 only supporting OpenSSL 3.
47+
4648
The prebuilt releases are generated by [ruby-builder](https://github.com/ruby/ruby-builder)
4749
and on Windows by [RubyInstaller2](https://github.com/oneclick/rubyinstaller2).
4850
`mingw` and `mswin` builds are generated by [ruby-loco](https://github.com/MSP-Greg/ruby-loco).

common.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ function getImageOS() {
101101
export const supportedPlatforms = [
102102
'ubuntu-18.04',
103103
'ubuntu-20.04',
104+
'ubuntu-22.04',
104105
'macos-10.15',
105106
'macos-11.0',
106107
'windows-2019',

dist/index.js

Lines changed: 9 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ function validateRubyEngineAndVersion(platform, engineVersions, engine, parsedVe
151151
throw new Error(`Unknown version ${parsedVersion} for ${engine} on ${platform}
152152
available versions for ${engine} on ${platform}: ${engineVersions.join(', ')}
153153
Make sure you use the latest version of the action with - uses: ruby/setup-ruby@v1
154-
File an issue at https://github.com/ruby/setup-ruby/issues if would like support for a new version`)
154+
File an issue at https://github.com/ruby/setup-ruby/issues if you would like support for a new version`)
155155
}
156156
}
157157

ruby-builder.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,13 @@ export function getAvailableVersions(platform, engine) {
1717
throw new Error(`Unsupported platform ${platform}`)
1818
}
1919

20+
if (platform === 'ubuntu-22.04') {
21+
const rubyVersions = rubyBuilderVersions['ruby']
22+
return {
23+
ruby: rubyVersions.slice(rubyVersions.indexOf('3.1.0')),
24+
}[engine]
25+
}
26+
2027
return rubyBuilderVersions[engine]
2128
}
2229

0 commit comments

Comments
 (0)