Compare commits

...
20 Commits
Author SHA1 Message Date
Benoit Daloze e8f04a3cee Use latest Bundler on CRuby 2.6 and 2.7 as their default Bundler is too old 2022-07-26 21:55:37 +02:00
Benoit Daloze bb1d54ff77 Use a new cache version
* To make sure existing caches based on latest Bundler are not reused.
2022-07-26 21:17:48 +02:00
Benoit Daloze 4e1189c53d Use the Bundler shipped with that Ruby by default
* Fixes https://github.com/ruby/setup-ruby/issues/358
2022-07-26 20:57:23 +02:00
Benoit Daloze a54c48c94b TruffleRuby 22.2 supports OpenSSL 3 2022-07-26 15:40:56 +02:00
ruby-builder-bot cb55cb0ce4 Add truffleruby-22.2.0 2022-07-26 15:39:50 +02:00
ruby-builder-bot 08245253a7 Add jruby-9.3.6.0 2022-06-28 12:20:18 +02:00
ruby-builder-bot 51df335734 Add jruby-9.2.21.0 2022-06-28 12:16:09 +02:00
Benoit Daloze c4167d16b3 Link to JRuby on Windows issues 2022-06-26 14:06:55 +02:00
Benoit Daloze d97cd77c44 Create FUNDING.yml 2022-06-25 12:00:01 +02:00
Benoit Daloze 706bae07c5 Tweak no version found error message
* So it ends with "Use ruby/setup-ruby@v1" which seems to be what some
  people miss.
2022-06-21 11:03:22 +02:00
Benoit Daloze 2489e28c66 Use actions/checkout@v3 in workflows 2022-05-31 11:17:28 +02:00
Hiroshi SHIBATA d20d4c5fed Merge pull request #342 from kojix2/kojix2-patch1
Update README.md
2022-05-21 12:15:57 +09:00
kojix2 ad637dce55 Update README.md 2022-05-21 11:33:18 +09:00
Benoit Daloze 8029ebd6e5 Cleanup 2022-05-17 18:24:10 +02:00
MSP-Greg 356354c8aa Actions - show vcpkg list for mswin 2022-05-17 18:24:10 +02:00
MSP-Greg be54de855e Windows mswin - install vcpkg archive with required Ruby packages, cert 2022-05-17 18:24:10 +02:00
MSP-Greg cd4241788a MSP-Greg/setup-msys2-gcc -> ruby/setup-msys2-gcc, rmdirSync -> rmSync 2022-05-16 12:23:31 +02:00
MSP-Greg 3c76dcfa76 Update packages - @vercel/ncc, semver
semver was major update, but mostly refactor and dropping compatibility with old node versions
2022-05-16 12:23:31 +02:00
Benoit Daloze a7439cf424 Add support for macos-12 2022-05-16 12:08:36 +02:00
Benoit Daloze b9675e15ad Use quotes consistently for Ruby versions in docs
* To avoid issues from https://github.com/actions/runner/issues/849
2022-05-15 13:26:47 +02:00
13 changed files with 7041 additions and 1637 deletions
+1
View File
@@ -0,0 +1 @@
github: [eregon]
+1 -1
View File
@@ -6,7 +6,7 @@ jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
fetch-depth: 0
- run: git push origin HEAD:v1
+32 -30
View File
@@ -15,12 +15,12 @@ jobs:
strategy:
fail-fast: false
matrix:
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 ]
os: [ ubuntu-18.04, ubuntu-20.04, macos-10.15, macos-11, macos-12, 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: '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 }
@@ -28,13 +28,13 @@ jobs:
- { os: windows-2022, ruby: mswin }
- { os: windows-2022, ruby: ucrt }
exclude:
- { os: windows-2019, ruby: 1.9 }
- { os: windows-2019, ruby: '1.9' }
- { os: windows-2019, ruby: debug }
- { os: windows-2019, ruby: truffleruby }
- { os: windows-2019, ruby: truffleruby-head }
- { os: windows-2019, ruby: truffleruby+graalvm }
- { os: windows-2019, ruby: truffleruby+graalvm-head }
- { os: windows-2022, ruby: 1.9 }
- { os: windows-2022, ruby: '1.9' }
- { os: windows-2022, ruby: debug }
- { os: windows-2022, ruby: truffleruby }
- { os: windows-2022, ruby: truffleruby-head }
@@ -44,7 +44,7 @@ jobs:
name: ${{ matrix.os }} ${{ matrix.ruby }}
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: ./
with:
@@ -71,6 +71,8 @@ jobs:
} else {
echo 'ridk is unavailable'
}
} elseif ($plat.Contains('mswin')) {
&"$env:VCPKG_INSTALLATION_ROOT\vcpkg" list
}
- name: RbConfig::CONFIG
run: ruby -rrbconfig -rpp -e 'pp RbConfig::CONFIG'
@@ -121,10 +123,10 @@ jobs:
name: "Test rubygems: latest upgrades the default RubyGems version"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: ./
with:
ruby-version: 2.6
ruby-version: '2.6'
rubygems: latest
- run: ruby -e "exit(Gem.rubygems_version > Gem::Version.new('3.0.3'))"
@@ -132,10 +134,10 @@ jobs:
name: "Test rubygems: version upgrades RubyGems to that version if the default is older"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: ./
with:
ruby-version: 2.6
ruby-version: '2.6'
rubygems: 3.2.3
- run: gem --version | grep -F "3.2.3"
@@ -143,10 +145,10 @@ jobs:
name: "Test rubygems: version noops if the default is newer"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: ./
with:
ruby-version: 3.1.0
ruby-version: '3.1.0'
rubygems: 3.2.3
- run: gem --version | grep -F "3.3.3"
@@ -154,10 +156,10 @@ jobs:
name: "Test rubygems: version uses the Bundler installed by the rubygems update"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: ./
with:
ruby-version: 2.2
ruby-version: '2.2'
rubygems: 2.7.11
- run: gem --version | grep -F "2.7.11"
- run: bundle --version | grep -F "1.16.6"
@@ -166,10 +168,10 @@ jobs:
name: "Test bundler: 1.x for old Ruby"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: ./
with:
ruby-version: 2.2
ruby-version: '2.2'
bundler: 1.16.6
- run: bundle --version | grep -F "1.16.6" # And not 1.17.x from ~> 1
@@ -177,10 +179,10 @@ jobs:
name: "Test with a major Bundler version"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: ./
with:
ruby-version: 2.6
ruby-version: '2.6'
bundler: 2
- run: bundle --version | grep -P "Bundler version 2\.\d+\.\d+"
@@ -188,10 +190,10 @@ jobs:
name: "Test with a minor Bundler version"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: ./
with:
ruby-version: 2.6
ruby-version: '2.6'
bundler: 2.2
- run: bundle --version | grep -P "Bundler version 2\.2\.\d+"
@@ -199,10 +201,10 @@ jobs:
name: "Test with an exact Bundler version"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: ./
with:
ruby-version: 2.6
ruby-version: '2.6'
bundler: 2.2.3
- run: bundle --version | grep -F "Bundler version 2.2.3"
@@ -212,10 +214,10 @@ jobs:
env:
BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/bundler1.gemfile
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: ./
with:
ruby-version: 2.7
ruby-version: '2.7'
bundler: 1
bundler-cache: true
- run: bundle --version | grep -F "Bundler version 1."
@@ -230,10 +232,10 @@ jobs:
env:
BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/${{ matrix.gemfile }}.gemfile
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: ./
with:
ruby-version: 2.6
ruby-version: '2.6'
bundler-cache: true
- run: bundle exec rails --version
@@ -243,7 +245,7 @@ jobs:
env:
BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/nokogiri.gemfile
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: ./
with:
ruby-version: truffleruby-head
@@ -253,7 +255,7 @@ jobs:
lint:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- run: yarn install
- run: yarn run package
- name: Check generated files are up to date
+21 -17
View File
@@ -15,9 +15,9 @@ This action currently supports these versions of MRI, JRuby and TruffleRuby:
| Interpreter | Versions |
| ----------- | -------- |
| `ruby` | 1.9.3, 2.0.0, 2.1.9, 2.2, all versions from 2.3.0 until 3.2.0-preview1, head, debug, mingw, mswin |
| `jruby` | 9.1.17.0 - 9.3.4.0, head |
| `truffleruby` | 19.3.0 - 22.1.0, head |
| `truffleruby+graalvm` | 21.2.0 - 22.1.0, head |
| `jruby` | 9.1.17.0 - 9.3.6.0, head |
| `truffleruby` | 19.3.0 - 22.2.0, head |
| `truffleruby+graalvm` | 21.2.0 - 22.2.0, head |
`ruby-debug` is the same as `ruby-head` but with assertions enabled (`-DRUBY_DEBUG=1`).
On Windows, `mingw` and `mswin` are `ruby-head` builds using the MSYS2/MinGW and the MSVC toolchains respectively.
@@ -39,11 +39,11 @@ The action works on these [GitHub-hosted runners](https://help.github.com/en/act
| Operating System | Recommended | Other Supported Versions |
| ----------- | -------- | -------- |
| Ubuntu | `ubuntu-latest` (= `ubuntu-20.04`) | `ubuntu-18.04` |
| macOS | `macos-latest` (= `macos-10.15`) | `macos-11.0` |
| Ubuntu | `ubuntu-latest` (= `ubuntu-20.04`) | `ubuntu-18.04`, `ubuntu-22.04` (beta, only `ruby: 3.1 - head, truffleruby`) |
| macOS | `macos-latest` (= `macos-11`) | `macos-10.15`, `macos-12` (beta) |
| 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.
On `ubuntu-22.04` (beta), only `ruby: 3.1 - head, truffleruby` 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).
@@ -66,10 +66,10 @@ jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: ruby/setup-ruby@v1
with:
ruby-version: 2.6 # Not needed with a .ruby-version file
ruby-version: '3.0' # Not needed with a .ruby-version file
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- run: bundle exec rake
```
@@ -88,10 +88,10 @@ jobs:
matrix:
os: [ubuntu-latest, macos-latest]
# Due to https://github.com/actions/runner/issues/849, we have to use quotes for '3.0'
ruby: [2.6, 2.7, '3.0', 3.1, head, jruby, jruby-head, truffleruby, truffleruby-head]
ruby: ['2.7', '3.0', '3.1', head, jruby, jruby-head, truffleruby, truffleruby-head]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
@@ -114,10 +114,10 @@ jobs:
env: # $BUNDLE_GEMFILE must be set at the job level, so it is set for all steps
BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/${{ matrix.gemfile }}.gemfile
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: ruby/setup-ruby@v1
with:
ruby-version: 2.6
ruby-version: '3.0'
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- run: bundle exec rake
```
@@ -129,8 +129,8 @@ and the [condition and expression syntax](https://help.github.com/en/actions/ref
### Supported Version Syntax
* engine-version like `ruby-2.6.5` and `truffleruby-19.3.0`
* short version like `2.6`, automatically using the latest release matching that version (`2.6.5`)
* version only like `2.6.5`, assumes MRI for the engine
* short version like `'2.6'`, automatically using the latest release matching that version (`2.6.10`)
* version only like `'2.6.5'`, assumes MRI for the engine
* engine only like `truffleruby`, uses the latest stable release of that implementation
* `.ruby-version` reads from the project's `.ruby-version` file
* `.tool-versions` reads from the project's `.tool-versions` file
@@ -155,9 +155,12 @@ should be able to fix them by setting `rubygems: 3.0.0` or higher.
### Bundler
By default, if there is a `Gemfile.lock` file (or `$BUNDLE_GEMFILE.lock` or `gems.locked`) with a `BUNDLED WITH` section,
that version of Bundler will be installed and used.
Otherwise, the latest compatible Bundler version is installed (Bundler 2 on Ruby >= 2.4, Bundler 1 on Ruby < 2.4).
By default, Bundler is installed as follows:
* If there is a `Gemfile.lock` file (or `$BUNDLE_GEMFILE.lock` or `gems.locked`) with a `BUNDLED WITH` section,
that version of Bundler will be installed and used.
* If the Ruby ships with Bundler (as a default gem), that version is used.
* Otherwise, the latest compatible Bundler version is installed (Bundler 2 on Ruby >= 2.4, Bundler 1 on Ruby < 2.4).
This behavior can be customized, see [action.yml](action.yml) for more details about the `bundler` input.
@@ -228,6 +231,7 @@ It is recommended to first get your build working on Ubuntu and macOS before try
* For Ruby ≥ 2.4, MSYS2 is prepended to the `Path`, similar to what RubyInstaller2 does.
* For Ruby < 2.4, the DevKit MSYS tools are installed and prepended to the `Path`.
* Use JRuby 9.2.20+ on Windows (older versions have [bugs](https://github.com/ruby/setup-ruby/issues/18#issuecomment-889072695)).
* JRuby on Windows has multiple issues ([jruby/jruby#7106](https://github.com/jruby/jruby/issues/7106), [jruby/jruby#7182](https://github.com/jruby/jruby/issues/7182)).
## Versioning
+5 -3
View File
@@ -16,9 +16,11 @@ inputs:
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: |
The version of Bundler to install. Either 'none', 'latest', 'Gemfile.lock', or a version number (e.g., 1, 2, 2.1, 2.1.4).
For 'Gemfile.lock', the version is determined based on the BUNDLED WITH section from the file Gemfile.lock, $BUNDLE_GEMFILE.lock or gems.locked.
Defaults to 'default', which means 'Gemfile.lock' if the file exists and 'latest' otherwise.
The version of Bundler to install. Either 'Gemfile.lock' (the default), 'default', 'latest', 'none', or a version number (e.g., 1, 2, 2.1, 2.1.4).
For 'Gemfile.lock', the version of the BUNDLED WITH section from the Gemfile.lock if it exists. If the file or section does not exist then the same as 'default'.
For 'default', the version of Bundler that comes with that Ruby by default is used, or if that Ruby comes without Bundler then the same as 'latest'.
For 'latest', the latest compatible Bundler version is installed (Bundler 2 on Ruby >= 2.4, Bundler 1 on Ruby < 2.4).
For 'none', nothing is done.
bundler-cache:
description: 'Run "bundle install", and cache the result automatically. Either true or false.'
default: 'false'
+33 -29
View File
@@ -53,15 +53,37 @@ async function afterLockFile(lockFile, platform, engine, rubyVersion) {
export async function installBundler(bundlerVersionInput, rubygemsInputSet, lockFile, platform, rubyPrefix, engine, rubyVersion) {
let bundlerVersion = bundlerVersionInput
if (rubygemsInputSet && bundlerVersion === 'default') {
if (rubygemsInputSet && (bundlerVersion === 'default' || bundlerVersion === 'Gemfile.lock')) {
console.log('Using the Bundler installed by updating RubyGems')
return 'unknown'
}
if (bundlerVersion === 'default' || bundlerVersion === 'Gemfile.lock') {
bundlerVersion = readBundledWithFromGemfileLock(lockFile)
if (bundlerVersion === 'Gemfile.lock') {
let bundlerVersionFromGemfileLock = readBundledWithFromGemfileLock(lockFile)
if (!bundlerVersion) {
if (bundlerVersionFromGemfileLock) {
bundlerVersion = bundlerVersionFromGemfileLock
} else {
bundlerVersion = 'default'
}
}
const floatVersion = common.floatVersion(rubyVersion)
if (bundlerVersion === 'default') {
if (engine === 'ruby' && floatVersion < 3.0 && common.hasBundlerDefaultGem(engine, rubyVersion)) {
// Ruby 2.6 and 2.7 have a old Bundler default gem which does not work well for `gem 'foo', github: 'foo/foo'`:
// https://github.com/ruby/setup-ruby/issues/358#issuecomment-1195899304
// Also, Ruby 2.6 would get Bundler 1 yet Ruby 2.3 - 2.5 get latest Bundler 2 which might be unexpected.
console.log(`Using latest Bundler for ${engine}-${rubyVersion} because the default Bundler gem is too old for that Ruby version`)
bundlerVersion = 'latest'
} else if (common.isBundler2Default(engine, rubyVersion)) {
console.log(`Using Bundler 2 shipped with ${engine}-${rubyVersion}`)
return '2'
} else if (common.isBundler1Default(engine, rubyVersion) && engine !== 'ruby') {
console.log(`Using Bundler 1 shipped with ${engine}-${rubyVersion}`)
return '1'
} else {
bundlerVersion = 'latest'
}
}
@@ -76,8 +98,6 @@ export async function installBundler(bundlerVersionInput, rubygemsInputSet, lock
throw new Error(`Cannot parse bundler input: ${bundlerVersion}`)
}
const floatVersion = common.floatVersion(rubyVersion)
// Use Bundler 1 when we know Bundler 2 does not work
if (bundlerVersion.startsWith('2')) {
if (engine === 'ruby' && floatVersion <= 2.2) {
@@ -92,30 +112,14 @@ export async function installBundler(bundlerVersionInput, rubygemsInputSet, lock
}
}
// Workaround for truffleruby 22.0 + latest Bundler, use shipped Bundler instead: https://github.com/oracle/truffleruby/issues/2586
const truffleruby22workaround = engine.startsWith('truffleruby') && rubyVersion.startsWith('22.0')
const useShippedBundler2 = common.isHeadVersion(rubyVersion) || truffleruby22workaround
const gem = path.join(rubyPrefix, 'bin', 'gem')
// Workaround for https://github.com/rubygems/rubygems/issues/5245
const force = (platform.startsWith('windows-') && engine === 'ruby' && floatVersion >= 3.1) ? ['--force'] : []
if (useShippedBundler2 && common.isBundler2Default(engine, rubyVersion) && bundlerVersion.startsWith('2')) {
// Avoid installing a newer Bundler version for head versions as it might not work.
// For releases, even if they ship with Bundler 2 we install the latest Bundler.
if (truffleruby22workaround) {
console.log(`Using Bundler 2 shipped with ${engine}-${rubyVersion} (workaround for https://github.com/oracle/truffleruby/issues/2586 on truffleruby 22.0)`)
} else {
console.log(`Using Bundler 2 shipped with ${engine}-${rubyVersion} (head versions do not always support the latest Bundler release)`)
}
} else if (engine.startsWith('truffleruby') && common.isBundler1Default(engine, rubyVersion) && bundlerVersion.startsWith('1')) {
console.log(`Using Bundler 1 shipped with ${engine}-${rubyVersion} (required for truffleruby < 21.0)`)
} else {
const gem = path.join(rubyPrefix, 'bin', 'gem')
// Workaround for https://github.com/rubygems/rubygems/issues/5245
const force = (platform.startsWith('windows-') && engine === 'ruby' && floatVersion >= 3.1) ? ['--force'] : []
const versionParts = [...bundlerVersion.matchAll(/\d+/g)].length
const bundlerVersionConstraint = versionParts === 3 ? bundlerVersion : `~> ${bundlerVersion}.0`
const versionParts = [...bundlerVersion.matchAll(/\d+/g)].length
const bundlerVersionConstraint = versionParts === 3 ? bundlerVersion : `~> ${bundlerVersion}.0`
await exec.exec(gem, ['install', 'bundler', ...force, '-v', bundlerVersionConstraint])
}
await exec.exec(gem, ['install', 'bundler', ...force, '-v', bundlerVersionConstraint])
return bundlerVersion
}
@@ -204,7 +208,7 @@ export async function bundleInstall(gemfile, lockFile, platform, engine, rubyVer
async function computeBaseKey(platform, engine, version, lockFile, cacheVersion) {
const cacheVersionSuffix = DEFAULT_CACHE_VERSION === cacheVersion ? '' : `-cachever:${cacheVersion}`
let key = `setup-ruby-bundler-cache-v3-${platform}-${engine}-${version}${cacheVersionSuffix}`
let key = `setup-ruby-bundler-cache-v4-${platform}-${engine}-${version}${cacheVersionSuffix}`
if (common.isHeadVersion(version)) {
if (engine !== 'jruby') {
+20 -3
View File
@@ -55,8 +55,20 @@ export function isStableVersion(rubyVersion) {
return /^\d+(\.\d+)*$/.test(rubyVersion)
}
export function hasBundlerDefaultGem(engine, rubyVersion) {
return isBundler1Default(engine, rubyVersion) || isBundler2Default(engine, rubyVersion)
}
export function isBundler1Default(engine, rubyVersion) {
return !isBundler2Default(engine, rubyVersion)
if (engine === 'ruby') {
return floatVersion(rubyVersion) >= 2.6 && floatVersion(rubyVersion) < 2.7
} else if (engine.startsWith('truffleruby')) {
return floatVersion(rubyVersion) < 21.0
} else if (engine === 'jruby') {
return false
} else {
return false
}
}
export function isBundler2Default(engine, rubyVersion) {
@@ -103,7 +115,8 @@ export const supportedPlatforms = [
'ubuntu-20.04',
'ubuntu-22.04',
'macos-10.15',
'macos-11.0',
'macos-11',
'macos-12',
'windows-2019',
'windows-2022',
]
@@ -118,7 +131,11 @@ export function getVirtualEnvironmentName() {
match = imageOS.match(/^macos(\d{2})(\d+)?/) // e.g. macos1015, macos11
if (match) {
return `macos-${match[1]}.${match[2] || '0'}`
if (match[2]) {
return `macos-${match[1]}.${match[2]}`
} else {
return `macos-${match[1]}`
}
}
match = imageOS.match(/^win(\d+)/) // e.g. win19
Generated Vendored
+6835 -1506
View File
File diff suppressed because one or more lines are too long
+2 -3
View File
@@ -12,7 +12,7 @@ const windows = common.windows
const inputDefaults = {
'ruby-version': 'default',
'rubygems': 'default',
'bundler': 'default',
'bundler': 'Gemfile.lock',
'bundler-cache': 'false',
'working-directory': '.',
'cache-version': bundler.DEFAULT_CACHE_VERSION,
@@ -150,8 +150,7 @@ function validateRubyEngineAndVersion(platform, engineVersions, engine, parsedVe
} else {
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 you would like support for a new version`)
Make sure you use the latest version of the action with - uses: ruby/setup-ruby@v1`)
}
}
+4 -4
View File
@@ -22,14 +22,14 @@
},
"homepage": "https://github.com/ruby/setup-ruby",
"dependencies": {
"@actions/cache": "^1.0.11",
"@actions/core": "^1.6.0",
"@actions/cache": "^2.0.2",
"@actions/core": "^1.7.0",
"@actions/exec": "^1.1.1",
"@actions/io": "^1.1.2",
"@actions/tool-cache": "^1.7.2",
"semver": "^6.3.0"
"semver": "^7.3.7"
},
"devDependencies": {
"@vercel/ncc": "^0.31.1"
"@vercel/ncc": "^0.33.4"
}
}
+4 -4
View File
@@ -16,20 +16,20 @@
],
"jruby": [
"9.1.17.0",
"9.2.9.0", "9.2.10.0", "9.2.11.0", "9.2.11.1", "9.2.12.0", "9.2.13.0", "9.2.14.0", "9.2.15.0", "9.2.16.0", "9.2.17.0", "9.2.18.0", "9.2.19.0", "9.2.20.0", "9.2.20.1",
"9.3.0.0", "9.3.1.0", "9.3.2.0", "9.3.3.0", "9.3.4.0",
"9.2.9.0", "9.2.10.0", "9.2.11.0", "9.2.11.1", "9.2.12.0", "9.2.13.0", "9.2.14.0", "9.2.15.0", "9.2.16.0", "9.2.17.0", "9.2.18.0", "9.2.19.0", "9.2.20.0", "9.2.20.1", "9.2.21.0",
"9.3.0.0", "9.3.1.0", "9.3.2.0", "9.3.3.0", "9.3.4.0", "9.3.6.0",
"head"
],
"truffleruby": [
"19.3.0", "19.3.1",
"20.0.0", "20.1.0", "20.2.0", "20.3.0",
"21.0.0", "21.1.0", "21.2.0", "21.2.0.1", "21.3.0",
"22.0.0.2", "22.1.0",
"22.0.0.2", "22.1.0", "22.2.0",
"head"
],
"truffleruby+graalvm": [
"21.2.0", "21.3.0",
"22.0.0.2", "22.1.0",
"22.0.0.2", "22.1.0", "22.2.0",
"head"
]
}
+42 -15
View File
@@ -1,5 +1,5 @@
// Most of this logic is from
// https://github.com/MSP-Greg/actions-ruby/blob/master/lib/main.js
// 7z arguments
// -aoa overwrite existing, -bd disable progress indicator
const fs = require('fs')
const path = require('path')
@@ -13,12 +13,15 @@ const rubyInstallerVersions = require('./windows-versions.json')
const drive = common.drive
const msys2BasePath = 'C:\\msys64'
const msys2GCCReleaseURI = 'https://github.com/ruby/setup-msys2-gcc/releases/download'
// needed for 2.0-2.3, and mswin, cert file used by Git for Windows
const msys2BasePath = process.env['GHCUP_MSYS2']
const vcPkgBasePath = process.env['VCPKG_INSTALLATION_ROOT']
// needed for Ruby 2.0-2.3, and mswin, cert file used by Git for Windows
const certFile = 'C:\\Program Files\\Git\\mingw64\\ssl\\cert.pem'
// location & path for old RubyInstaller DevKit (MSYS1), Ruby 2.0-2.3
// location & path for old RubyInstaller DevKit (MSYS1), used with Ruby 2.0-2.3
const msys1 = `${drive}:\\DevKit64`
const msysPathEntries = [`${msys1}\\mingw\\x86_64-w64-mingw32\\bin`, `${msys1}\\mingw\\bin`, `${msys1}\\bin`]
@@ -80,6 +83,10 @@ export async function install(platform, engine, version) {
await installGCCTools(msys2Type)
}
if (version === 'mswin') {
await installVCPkg()
}
const ridk = `${rubyPrefix}\\bin\\ridk.cmd`
if (fs.existsSync(ridk)) {
await common.measure('Adding ridk env variables', async () => addRidkEnv(ridk))
@@ -92,13 +99,12 @@ export async function install(platform, engine, version) {
// and also install ucrt tools on earlier versions, which have msys2 and mingw tools preinstalled.
async function installGCCTools(type) {
const downloadPath = await common.measure(`Downloading ${type} build tools`, async () => {
let url = `https://github.com/MSP-Greg/setup-msys2-gcc/releases/download/msys2-gcc-pkgs/${type}.7z`
let url = `${msys2GCCReleaseURI}/msys2-gcc-pkgs/${type}.7z`
console.log(url)
return await tc.downloadTool(url)
})
await common.measure(`Extracting ${type} build tools`, async () =>
// -aoa overwrite existing, -bd disable progress indicator
exec.exec('7z', ['x', downloadPath, '-aoa', '-bd', `-o${msys2BasePath}`], { silent: true }))
}
@@ -106,17 +112,16 @@ async function installGCCTools(type) {
// A subset of the MSYS2 base-devel group
async function installMSYS2Tools() {
const downloadPath = await common.measure(`Downloading msys2 build tools`, async () => {
let url = `https://github.com/MSP-Greg/setup-msys2-gcc/releases/download/msys2-gcc-pkgs/msys2.7z`
let url = `${msys2GCCReleaseURI}/msys2-gcc-pkgs/msys2.7z`
console.log(url)
return await tc.downloadTool(url)
})
// need to remove all directories, since they may indicate old packages are installed,
// otherwise, error of "error: duplicated database entry"
fs.rmdirSync(`${msys2BasePath}\\var\\lib\\pacman\\local`, { recursive: true, force: true })
fs.rmSync(`${msys2BasePath}\\var\\lib\\pacman\\local`, { recursive: true, force: true })
await common.measure(`Extracting msys2 build tools`, async () =>
// -aoa overwrite existing, -bd disable progress indicator
exec.exec('7z', ['x', downloadPath, '-aoa', '-bd', `-o${msys2BasePath}`], { silent: true }))
}
@@ -127,6 +132,18 @@ export async function installJRubyTools() {
await installGCCTools('mingw64')
}
// Install vcpkg files needed to build mswin Ruby
async function installVCPkg() {
const downloadPath = await common.measure(`Downloading mswin vcpkg packages`, async () => {
let url = `${msys2GCCReleaseURI}/msys2-gcc-pkgs/mswin.7z`
console.log(url)
return await tc.downloadTool(url)
})
await common.measure(`Extracting mswin vcpkg packages`, async () =>
exec.exec('7z', ['x', downloadPath, '-aoa', '-bd', `-o${vcPkgBasePath}`], { silent: true }))
}
async function downloadAndExtract(engine, version, url, base, rubyPrefix) {
const parentDir = path.dirname(rubyPrefix)
@@ -136,7 +153,7 @@ async function downloadAndExtract(engine, version, url, base, rubyPrefix) {
})
await common.measure('Extracting Ruby', async () =>
// -bd disable progress indicator, -xr extract but exclude share\doc files
// -xr extract but exclude share\doc files
exec.exec('7z', ['x', downloadPath, '-bd', `-xr!${base}\\share\\doc`, `-o${parentDir}`], { silent: true }))
if (base !== path.basename(rubyPrefix)) {
@@ -183,18 +200,28 @@ async function installMSYS1(version) {
async function setupMSWin() {
core.exportVariable('MAKE', 'nmake.exe')
// All standard MSVC OpenSSL builds use C:\Program Files\Common Files\SSL
const certsDir = 'C:\\Program Files\\Common Files\\SSL\\certs'
// Pre-installed OpenSSL use C:\Program Files\Common Files\SSL
let certsDir = 'C:\\Program Files\\Common Files\\SSL\\certs'
if (!fs.existsSync(certsDir)) {
fs.mkdirSync(certsDir)
fs.mkdirSync(certsDir, { recursive: true })
}
// cert.pem location is hard-coded by OpenSSL msvc builds
const cert = 'C:\\Program Files\\Common Files\\SSL\\cert.pem'
let cert = 'C:\\Program Files\\Common Files\\SSL\\cert.pem'
if (!fs.existsSync(cert)) {
fs.copyFileSync(certFile, cert)
}
// vcpkg openssl uses packages\openssl_x64-windows\certs
certsDir = `${vcPkgBasePath}\\packages\\openssl_x64-windows\\certs`
if (!fs.existsSync(certsDir)) {
fs.mkdirSync(certsDir, { recursive: true })
}
// vcpkg openssl uses packages\openssl_x64-windows\cert.pem
cert = `${vcPkgBasePath}\\packages\\openssl_x64-windows\\cert.pem`
fs.copyFileSync(certFile, cert)
return await common.measure('Setting up MSVC environment', async () => addVCVARSEnv())
}
Generated
+41 -22
View File
@@ -2,10 +2,10 @@
# yarn lockfile v1
"@actions/cache@^1.0.11":
version "1.0.11"
resolved "https://registry.yarnpkg.com/@actions/cache/-/cache-1.0.11.tgz#db7909ba7f7e7bc9bd1a761c172c48807586b996"
integrity sha512-L+VCF1JpFePAzxkYtpwYDWnd0WzSU1DoNPE2cuINKpEie27ONH0Cpqt40cG8NiJW4zbZLN+kNkEDo3F2MkUuRw==
"@actions/cache@^2.0.2":
version "2.0.2"
resolved "https://registry.yarnpkg.com/@actions/cache/-/cache-2.0.2.tgz#e38167f5de20be8f61452ff1f0bb44b02558905e"
integrity sha512-K1DCaW/OtHj5mV7hI7HEXiceX3rM4Nc0iG2hfYsrkEy6GiOeqlCC/LyICrBZIRDM6+vSrS12tg1ORl4hghomBA==
dependencies:
"@actions/core" "^1.2.6"
"@actions/exec" "^1.0.1"
@@ -17,10 +17,10 @@
semver "^6.1.0"
uuid "^3.3.3"
"@actions/core@^1.2.6", "@actions/core@^1.6.0":
version "1.6.0"
resolved "https://registry.yarnpkg.com/@actions/core/-/core-1.6.0.tgz#0568e47039bfb6a9170393a73f3b7eb3b22462cb"
integrity sha512-NB1UAZomZlCV/LmJqkLhNTqtKfFXJZAUPcfl/zqG7EfsQdeUJtaWO98SGbuQ3pydJ3fHl2CvI/51OKYlCYYcaw==
"@actions/core@^1.2.6", "@actions/core@^1.7.0":
version "1.7.0"
resolved "https://registry.yarnpkg.com/@actions/core/-/core-1.7.0.tgz#f179a5a0bf5c1102d89b8cf1712825e763feaee4"
integrity sha512-7fPSS7yKOhTpgLMbw7lBLc1QJWvJBBAgyTX2PEhagWcKK8t0H8AKCoPMfnrHqIm5cRYH4QFPqD1/ruhuUE7YcQ==
dependencies:
"@actions/http-client" "^1.0.11"
@@ -167,9 +167,9 @@
tslib "^2.2.0"
"@opentelemetry/api@^1.0.1":
version "1.0.4"
resolved "https://registry.yarnpkg.com/@opentelemetry/api/-/api-1.0.4.tgz#a167e46c10d05a07ab299fc518793b0cff8f6924"
integrity sha512-BuJuXRSJNQ3QoKA6GWWDyuLpOUck+9hAXNMCnrloc1aWVoy6Xq6t9PUV08aBZ4Lutqq2LEHM486bpZqoViScog==
version "1.1.0"
resolved "https://registry.yarnpkg.com/@opentelemetry/api/-/api-1.1.0.tgz#563539048255bbe1a5f4f586a4a10a1bb737f44a"
integrity sha512-hf+3bwuBwtXsugA2ULBc95qxrOqP2pOekLz34BJhcAKawt94vfeNyUKpYc0lZQ/3sCP6LqRa7UAdHA7i5UODzQ==
"@types/node-fetch@^2.5.0":
version "2.6.1"
@@ -180,9 +180,9 @@
form-data "^3.0.0"
"@types/node@*":
version "17.0.24"
resolved "https://registry.yarnpkg.com/@types/node/-/node-17.0.24.tgz#20ba1bf69c1b4ab405c7a01e950c4f446b05029f"
integrity sha512-aveCYRQbgTH9Pssp1voEP7HiuWlD2jW2BO56w+bVrJn04i61yh6mRfoKO6hEYQD9vF+W8Chkwc6j1M36uPkx4g==
version "17.0.31"
resolved "https://registry.yarnpkg.com/@types/node/-/node-17.0.31.tgz#a5bb84ecfa27eec5e1c802c6bbf8139bdb163a5d"
integrity sha512-AR0x5HbXGqkEx9CadRH3EBYx/VkiUgZIhP4wvPn/+5KIsgpNoyFaRlVe0Zlx9gRtg8fA06a9tskE2MSN7TcG4Q==
"@types/tunnel@^0.0.3":
version "0.0.3"
@@ -191,10 +191,10 @@
dependencies:
"@types/node" "*"
"@vercel/ncc@^0.31.1":
version "0.31.1"
resolved "https://registry.yarnpkg.com/@vercel/ncc/-/ncc-0.31.1.tgz#9346c7e59326f5eeac75c0286e47df94c2d6d8f7"
integrity sha512-g0FAxwdViI6UzsiVz5HssIHqjcPa1EHL6h+2dcJD893SoCJaGdqqgUF09xnMW6goWnnhbLvgiKlgJWrJa+7qYA==
"@vercel/ncc@^0.33.4":
version "0.33.4"
resolved "https://registry.yarnpkg.com/@vercel/ncc/-/ncc-0.33.4.tgz#e44a87511f583b7ba88e4b9ae90eeb7ba252b872"
integrity sha512-ln18hs7dMffelP47tpkaR+V5Tj6coykNyxJrlcmCormPqRQjB/Gv4cu2FfBG+PMzIfdZp2CLDsrrB1NPU22Qhg==
abort-controller@^3.0.0:
version "3.0.0"
@@ -280,6 +280,13 @@ ip-regex@^2.1.0:
resolved "https://registry.yarnpkg.com/ip-regex/-/ip-regex-2.1.0.tgz#fa78bf5d2e6913c911ce9f819ee5146bb6d844e9"
integrity sha1-+ni/XS5pE8kRzp+BnuUUa7bYROk=
lru-cache@^6.0.0:
version "6.0.0"
resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-6.0.0.tgz#6d6fe6570ebd96aaf90fcad1dafa3b2566db3a94"
integrity sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==
dependencies:
yallist "^4.0.0"
mime-db@1.52.0:
version "1.52.0"
resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.52.0.tgz#bbabcdc02859f4987301c856e3387ce5ec43bf70"
@@ -326,11 +333,18 @@ sax@>=0.6.0:
resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.4.tgz#2816234e2378bddc4e5354fab5caa895df7100d9"
integrity sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==
semver@^6.1.0, semver@^6.3.0:
semver@^6.1.0:
version "6.3.0"
resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d"
integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==
semver@^7.3.7:
version "7.3.7"
resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.7.tgz#12c5b649afdbf9049707796e22a4028814ce523f"
integrity sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==
dependencies:
lru-cache "^6.0.0"
tough-cookie@^3.0.1:
version "3.0.1"
resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-3.0.1.tgz#9df4f57e739c26930a018184887f4adb7dca73b2"
@@ -360,9 +374,9 @@ tslib@^1.10.0:
integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==
tslib@^2.0.0, tslib@^2.2.0:
version "2.3.1"
resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.3.1.tgz#e8a335add5ceae51aa261d32a490158ef042ef01"
integrity sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw==
version "2.4.0"
resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.4.0.tgz#7cecaa7f073ce680a05847aa77be941098f36dc3"
integrity sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ==
tunnel@0.0.6, tunnel@^0.0.6:
version "0.0.6"
@@ -409,3 +423,8 @@ xmlbuilder@~11.0.0:
version "11.0.1"
resolved "https://registry.yarnpkg.com/xmlbuilder/-/xmlbuilder-11.0.1.tgz#be9bae1c8a046e76b31127726347d0ad7002beb3"
integrity sha512-fDlsI/kFEx7gLvbecc0/ohLG50fugQp8ryHzMTuW9vSa1GJ0XYWKnhsUx7oie3G98+r56aTQIUB4kht42R3JvA==
yallist@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72"
integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==