Skip to content

Commit 7da380d

Browse files
committed
Add support for Ruby 2.3 on Windows
1 parent 5f2df8a commit 7da380d

6 files changed

+22
-9
lines changed

.github/workflows/test.yml

+2-3
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ jobs:
1616
# Use various version syntaxes here for testing
1717
ruby: [ .ruby-version, 2.3, ruby-2.4, 2.5, ruby-2.6.5, 2.7.0, jruby, truffleruby ]
1818
exclude:
19-
- os: windows-latest
20-
ruby: 2.3
2119
- os: windows-latest
2220
ruby: jruby
2321
- os: windows-latest
@@ -30,9 +28,10 @@ jobs:
3028
ruby-version: ${{ matrix.ruby }}
3129
- run: ruby --version
3230
- run: ridk version
33-
if: matrix.os == 'windows-latest'
31+
if: matrix.os == 'windows-latest' && !startsWith(matrix.ruby, '2.3')
3432
- name: OpenSSL version
3533
run: ruby -ropenssl -e 'puts OpenSSL::OPENSSL_LIBRARY_VERSION'
34+
if: matrix.os == 'windows-latest'
3635
- name: OpenSSL test
3736
run: ruby -ropen-uri -e 'puts open(%{https://rubygems.org/}) { |f| f.read(1024) }'
3837
- name: C extension test

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ The action works for all [GitHub-hosted runners](https://help.github.com/en/acti
2929
| macOS | `macos-latest` |
3030
| Windows | `windows-latest` |
3131

32-
Ruby 2.3, JRuby and TruffleRuby are not yet supported on `windows-latest`.
32+
JRuby and TruffleRuby are not yet supported on `windows-latest`.
3333

3434
The prebuilt rubies are generated by [eregon/ruby-install-builder](https://github.com/eregon/ruby-install-builder)
3535
and on Windows by [RubyInstaller2](https://github.com/oneclick/rubyinstaller2).

dist/index.js

+9-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

generate-ruby-installer-versions.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
}.sort_by { |version, entry|
1919
version
2020
}.select { |version, entry|
21-
version >= "2.4"
21+
version >= "2.3"
2222
}.map { |version, entry|
2323
[version, entry[:href]]
2424
}.to_h

ruby-installer-versions.js

+3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
export const versions = {
2+
"2.3.0": "https://dl.bintray.com/oneclick/rubyinstaller/ruby-2.3.0-x64-mingw32.7z",
3+
"2.3.1": "https://dl.bintray.com/oneclick/rubyinstaller/ruby-2.3.1-x64-mingw32.7z",
4+
"2.3.3": "https://dl.bintray.com/oneclick/rubyinstaller/ruby-2.3.3-x64-mingw32.7z",
25
"2.4.1": "https://github.com/oneclick/rubyinstaller2/releases/download/2.4.1-2/rubyinstaller-2.4.1-2-x64.7z",
36
"2.4.2": "https://github.com/oneclick/rubyinstaller2/releases/download/rubyinstaller-2.4.2-2/rubyinstaller-2.4.2-2-x64.7z",
47
"2.4.3": "https://github.com/oneclick/rubyinstaller2/releases/download/rubyinstaller-2.4.3-2/rubyinstaller-2.4.3-2-x64.7z",

windows.js

+6-2
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,14 @@ export async function install(platform, ruby) {
2929
await exec.exec(`7z x ${downloadPath} -xr!${base}\\share\\doc -oC:\\`)
3030
const rubyPrefix = `C:\\${base}`
3131

32-
const msys2 = await linkMSYS2()
32+
const [hostedRuby, msys2] = await linkMSYS2()
3333
const newPath = setupPath(msys2, rubyPrefix)
3434
core.exportVariable('PATH', newPath)
3535

36+
if (version.startsWith('2.3')) {
37+
core.exportVariable('SSL_CERT_FILE', `${hostedRuby}\\ssl\\cert.pem`)
38+
}
39+
3640
if (!fs.existsSync(`${rubyPrefix}\\bin\\bundle.cmd`)) {
3741
await exec.exec(`${rubyPrefix}\\bin\\gem install bundler -v "~> 1" --no-document`)
3842
}
@@ -52,7 +56,7 @@ async function linkMSYS2() {
5256
const hostedMSYS2 = `${latestHostedRuby}\\msys64`
5357
const msys2 = 'C:\\msys64'
5458
await exec.exec(`cmd /c mklink /D ${msys2} ${hostedMSYS2}`)
55-
return msys2
59+
return [latestHostedRuby, msys2]
5660
}
5761

5862
function setupPath(msys2, rubyPrefix) {

0 commit comments

Comments
 (0)