diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index abded0b..0dd5cd0 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -17,7 +17,7 @@ jobs: matrix: os: [ ubuntu-16.04, ubuntu-18.04, ubuntu-20.04, macos-10.15, windows-2016, windows-2019 ] # Use various version syntax here for testing - ruby: [ 2.2, 2.3, 2.4, 2.5, 2.6.6, 2.7, ruby-head, debug, jruby-9.1, jruby, jruby-head, truffleruby, truffleruby-head ] + ruby: [ 2.1, 2.2, 2.3, 2.4, 2.5, 2.6.6, 2.7, ruby-head, debug, jruby-9.1, jruby, jruby-head, truffleruby, truffleruby-head ] include: - { os: ubuntu-18.04, ruby: rubinius } - { os: windows-2016, ruby: mingw } diff --git a/README.md b/README.md index 43b54d8..a53e210 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,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.10, 2.5.0 - 2.5.8, 2.6.0 - 2.6.6, 2.7.1, head, debug, mingw, mswin | +| Ruby | 2.1.9, 2.2, 2.3.0 - 2.3.8, 2.4.0 - 2.4.10, 2.5.0 - 2.5.8, 2.6.0 - 2.6.6, 2.7.1, head, debug, mingw, mswin | | JRuby | 9.1.17.0, 9.2.9.0 - 9.2.12.0, head | | TruffleRuby | 19.3.0 - 20.1.0, head | | Rubinius | 4.14 | diff --git a/dist/index.js b/dist/index.js index 8d8804a..75f02a1 100644 --- a/dist/index.js +++ b/dist/index.js @@ -2377,8 +2377,8 @@ async function installBundler(bundlerVersionInput, platform, rubyPrefix, engine, throw new Error(`Cannot parse bundler input: ${bundlerVersion}`) } - if (rubyVersion.startsWith('2.2')) { - console.log('Bundler 2 requires Ruby 2.3+, using Bundler 1 on Ruby 2.2') + if (rubyVersion.match(/^2\.[12]/)) { + console.log('Bundler 2 requires Ruby 2.3+, using Bundler 1 on Ruby <= 2.2') bundlerVersion = '1' } else if (rubyVersion.startsWith('2.3')) { console.log('Ruby 2.3 has a bug with Bundler 2 (https://github.com/rubygems/rubygems/issues/3570), using Bundler 1 instead on Ruby 2.3') @@ -3093,6 +3093,7 @@ __webpack_require__.r(__webpack_exports__); function getVersions(platform) { const versions = { "ruby": [ + "2.1.9", "2.2.10", "2.3.0", "2.3.1", "2.3.2", "2.3.3", "2.3.4", "2.3.5", "2.3.6", "2.3.7", "2.3.8", "2.4.0", "2.4.1", "2.4.2", "2.4.3", "2.4.4", "2.4.5", "2.4.6", "2.4.7", "2.4.9", "2.4.10", @@ -5923,6 +5924,7 @@ exports.getState = getState; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "versions", function() { return versions; }); const versions = { + "2.1.9": "https://dl.bintray.com/oneclick/rubyinstaller/ruby-2.1.9-x64-mingw32.7z", "2.2.6": "https://dl.bintray.com/oneclick/rubyinstaller/ruby-2.2.6-x64-mingw32.7z", "2.3.0": "https://dl.bintray.com/oneclick/rubyinstaller/ruby-2.3.0-x64-mingw32.7z", "2.3.1": "https://dl.bintray.com/oneclick/rubyinstaller/ruby-2.3.1-x64-mingw32.7z", @@ -7549,14 +7551,14 @@ const rubyInstallerVersions = __webpack_require__(471).versions // Extract to SSD, see https://github.com/ruby/setup-ruby/pull/14 const drive = (process.env['GITHUB_WORKSPACE'] || 'C')[0] -// needed for 2.2, 2.3, and mswin, cert file used by Git for Windows +// needed for 2.1, 2.2, 2.3, and mswin, cert file used by Git for Windows const certFile = 'C:\\Program Files\\Git\\mingw64\\ssl\\cert.pem' // standard MSYS2 location, found by 'devkit.rb' const msys2 = 'C:\\msys64' const msys2PathEntries = [`${msys2}\\mingw64\\bin`, `${msys2}\\usr\\bin`] -// location & path for old RubyInstaller DevKit (MSYS), Ruby 2.2 and 2.3 +// location & path for old RubyInstaller DevKit (MSYS), Ruby 2.1, 2.2 and 2.3 const msys = `${drive}:\\DevKit64` const msysPathEntries = [`${msys}\\mingw\\x86_64-w64-mingw32\\bin`, `${msys}\\mingw\\bin`, `${msys}\\bin`] @@ -7609,7 +7611,7 @@ async function symLinkToEmbeddedMSYS2() { async function setupMingw(version) { core.exportVariable('MAKE', 'make.exe') - if (version.startsWith('2.2') || version.startsWith('2.3')) { + if (version.match(/^2\.[123]/)) { core.exportVariable('SSL_CERT_FILE', certFile) await common.measure('Installing MSYS1', async () => installMSYS(version)) @@ -7625,7 +7627,7 @@ async function setupMingw(version) { } } -// Ruby 2.2 and 2.3 +// Ruby 2.1, 2.2 and 2.3 async function installMSYS(version) { const url = 'https://dl.bintray.com/oneclick/rubyinstaller/DevKit-mingw64-64-4.7.2-20130224-1432-sfx.exe' const downloadPath = await tc.downloadTool(url) diff --git a/generate-windows-versions.rb b/generate-windows-versions.rb index 7670156..3ea07b5 100644 --- a/generate-windows-versions.rb +++ b/generate-windows-versions.rb @@ -2,7 +2,8 @@ require 'net/http' require 'yaml' require 'json' -min_version = '2.2.6' +min_requirements = ['~> 2.1.9', '>= 2.2.6'].map { |req| Gem::Requirement.new(req) } + url = 'https://raw.githubusercontent.com/oneclick/rubyinstaller.org-website/master/_data/downloads.yaml' entries = YAML.load(Net::HTTP.get(URI(url)), symbolize_names: true) @@ -19,7 +20,7 @@ versions = entries.select { |entry| }.sort_by { |version, entry| Gem::Version.new(version) }.select { |version, entry| - Gem::Version.new(version) >= Gem::Version.new(min_version) + min_requirements.any? { |req| req.satisfied_by?(Gem::Version.new(version)) } }.map { |version, entry| [version, entry[:href]] }.to_h diff --git a/index.js b/index.js index 89f87a8..4167487 100644 --- a/index.js +++ b/index.js @@ -191,8 +191,8 @@ async function installBundler(bundlerVersionInput, platform, rubyPrefix, engine, throw new Error(`Cannot parse bundler input: ${bundlerVersion}`) } - if (rubyVersion.startsWith('2.2')) { - console.log('Bundler 2 requires Ruby 2.3+, using Bundler 1 on Ruby 2.2') + if (rubyVersion.match(/^2\.[12]/)) { + console.log('Bundler 2 requires Ruby 2.3+, using Bundler 1 on Ruby <= 2.2') bundlerVersion = '1' } else if (rubyVersion.startsWith('2.3')) { console.log('Ruby 2.3 has a bug with Bundler 2 (https://github.com/rubygems/rubygems/issues/3570), using Bundler 1 instead on Ruby 2.3') diff --git a/ruby-builder-versions.js b/ruby-builder-versions.js index 6913a25..040e97b 100644 --- a/ruby-builder-versions.js +++ b/ruby-builder-versions.js @@ -1,6 +1,7 @@ export function getVersions(platform) { const versions = { "ruby": [ + "2.1.9", "2.2.10", "2.3.0", "2.3.1", "2.3.2", "2.3.3", "2.3.4", "2.3.5", "2.3.6", "2.3.7", "2.3.8", "2.4.0", "2.4.1", "2.4.2", "2.4.3", "2.4.4", "2.4.5", "2.4.6", "2.4.7", "2.4.9", "2.4.10", diff --git a/versions-strings-for-builder.rb b/versions-strings-for-builder.rb index ba69956..320f35d 100644 --- a/versions-strings-for-builder.rb +++ b/versions-strings-for-builder.rb @@ -3,6 +3,7 @@ versions = eval hash by_minor = versions[:ruby].group_by { |v| v[/^\d\.\d/] } +p by_minor['2.1'] p by_minor['2.2'] p by_minor['2.3'] diff --git a/windows-versions.js b/windows-versions.js index 5f3d55f..34d021b 100644 --- a/windows-versions.js +++ b/windows-versions.js @@ -1,4 +1,5 @@ export const versions = { + "2.1.9": "https://dl.bintray.com/oneclick/rubyinstaller/ruby-2.1.9-x64-mingw32.7z", "2.2.6": "https://dl.bintray.com/oneclick/rubyinstaller/ruby-2.2.6-x64-mingw32.7z", "2.3.0": "https://dl.bintray.com/oneclick/rubyinstaller/ruby-2.3.0-x64-mingw32.7z", "2.3.1": "https://dl.bintray.com/oneclick/rubyinstaller/ruby-2.3.1-x64-mingw32.7z", diff --git a/windows.js b/windows.js index 5cca9f9..0e83a7b 100644 --- a/windows.js +++ b/windows.js @@ -13,14 +13,14 @@ const rubyInstallerVersions = require('./windows-versions').versions // Extract to SSD, see https://github.com/ruby/setup-ruby/pull/14 const drive = (process.env['GITHUB_WORKSPACE'] || 'C')[0] -// needed for 2.2, 2.3, and mswin, cert file used by Git for Windows +// needed for 2.1, 2.2, 2.3, and mswin, cert file used by Git for Windows const certFile = 'C:\\Program Files\\Git\\mingw64\\ssl\\cert.pem' // standard MSYS2 location, found by 'devkit.rb' const msys2 = 'C:\\msys64' const msys2PathEntries = [`${msys2}\\mingw64\\bin`, `${msys2}\\usr\\bin`] -// location & path for old RubyInstaller DevKit (MSYS), Ruby 2.2 and 2.3 +// location & path for old RubyInstaller DevKit (MSYS), Ruby 2.1, 2.2 and 2.3 const msys = `${drive}:\\DevKit64` const msysPathEntries = [`${msys}\\mingw\\x86_64-w64-mingw32\\bin`, `${msys}\\mingw\\bin`, `${msys}\\bin`] @@ -73,7 +73,7 @@ async function symLinkToEmbeddedMSYS2() { async function setupMingw(version) { core.exportVariable('MAKE', 'make.exe') - if (version.startsWith('2.2') || version.startsWith('2.3')) { + if (version.match(/^2\.[123]/)) { core.exportVariable('SSL_CERT_FILE', certFile) await common.measure('Installing MSYS1', async () => installMSYS(version)) @@ -89,7 +89,7 @@ async function setupMingw(version) { } } -// Ruby 2.2 and 2.3 +// Ruby 2.1, 2.2 and 2.3 async function installMSYS(version) { const url = 'https://dl.bintray.com/oneclick/rubyinstaller/DevKit-mingw64-64-4.7.2-20130224-1432-sfx.exe' const downloadPath = await tc.downloadTool(url)