Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixup Rubygems latest to work with Rubies < 2.3 #557

Merged
merged 1 commit into from
Dec 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ jobs:
- { ruby: '2.6', expected_rubygems_version: '3.4.22' }
- { ruby: '2.5', expected_rubygems_version: '3.3.27' }
- { ruby: '2.3', expected_rubygems_version: '3.3.27' }
- { ruby: '2.0', expected_rubygems_version: '2.7.11' }
steps:
- uses: actions/checkout@v4
- uses: ./
Expand Down
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ inputs:
The version of RubyGems to use. Either 'default' (the default), 'latest', or a version number (e.g., 3.3.5).
For 'default', no action is taken and the version of RubyGems that comes with Ruby by default is used.
For 'latest', `gem update --system` is run to update to the latest compatible RubyGems version.
Ruby head/master builds and Ruby 2.2 and earlier will not be updated.
Ruby head/master builds will not be updated.
Similarly, if a version number is given, `gem update --system <version>` is run to update to that version of RubyGems, as long as that version is newer than the one provided by default.
bundler:
description: |
Expand Down
3 changes: 3 additions & 0 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions rubygems.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ async function rubygemsLatest(gem, platform, engine, rubyVersion) {
await exec.exec(gem, ['update', '--system', '3.4.22'])
} else if (floatVersion >= 2.3) {
await exec.exec(gem, ['update', '--system', '3.3.27'])
} else if (floatVersion >= 1.9) {
await exec.exec(`${gem} install rubygems-update -v 2.7.11 --no-document`)
await exec.exec('update_rubygems')
} else {
console.log(`Cannot update RubyGems for Ruby version ${rubyVersion}`)
}
Expand Down