mirror of
https://github.com/ruby/setup-ruby.git
synced 2026-09-13 22:44:20 +02:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d5f787ce33 | ||
|
|
1010da45f3 | ||
|
|
7f50f6e3b3 | ||
|
|
be19563477 | ||
|
|
b90be12699 | ||
|
|
4c24fa5ec0 | ||
|
|
8a836efbce | ||
|
|
ae195bbe74 | ||
|
|
d354de180d | ||
|
|
ed55d55e82 | ||
|
|
a25f1e45f0 | ||
|
|
211ffaaa5f | ||
|
|
f8d7259c7a | ||
|
|
ac793fdd38 | ||
|
|
5f8a775744 | ||
|
|
30a6546035 | ||
|
|
d697be2f83 | ||
|
|
8aeb6ff803 | ||
|
|
09e84e3b9d | ||
|
|
d5126b9b35 | ||
|
|
274049f8cf | ||
|
|
a96ff531da | ||
|
|
4ff6f3611a | ||
|
|
5375105c88 | ||
|
|
ab177d40ee |
@@ -11,7 +11,7 @@ jobs:
|
|||||||
GH_TOKEN: ${{ github.token }}
|
GH_TOKEN: ${{ github.token }}
|
||||||
GH_REPO: ${{ github.repository }}
|
GH_REPO: ${{ github.repository }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v6
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
- uses: ./
|
- uses: ./
|
||||||
|
|||||||
+36
-23
@@ -17,9 +17,9 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
os: [ ubuntu-22.04, ubuntu-24.04, ubuntu-22.04-arm, ubuntu-24.04-arm, macos-13, macos-14, macos-15, macos-15-intel, windows-2022, windows-2025, windows-11-arm ]
|
os: [ ubuntu-22.04, ubuntu-24.04, ubuntu-22.04-arm, ubuntu-24.04-arm, macos-14, macos-15, macos-15-intel, windows-2022, windows-2025, windows-11-arm ]
|
||||||
ruby: [
|
ruby: [
|
||||||
'1.9', '2.0', '2.1', '2.2', '2.3', '2.4', '2.5', '2.6', '2.7', '3.0', '3.1', '3.2', '3.3', '3.4', ruby-head,
|
'1.9', '2.0', '2.1', '2.2', '2.3', '2.4', '2.5', '2.6', '2.7', '3.0', '3.1', '3.2', '3.3', '3.4', '4.0', ruby-head,
|
||||||
jruby-9.4, jruby, jruby-head,
|
jruby-9.4, jruby, jruby-head,
|
||||||
truffleruby, truffleruby-head,
|
truffleruby, truffleruby-head,
|
||||||
truffleruby+graalvm, truffleruby+graalvm-head
|
truffleruby+graalvm, truffleruby+graalvm-head
|
||||||
@@ -32,7 +32,7 @@ jobs:
|
|||||||
- { os: windows-2025, ruby: mswin }
|
- { os: windows-2025, ruby: mswin }
|
||||||
- { os: windows-2025, ruby: ucrt }
|
- { os: windows-2025, ruby: ucrt }
|
||||||
- { os: ubuntu-24.04, ruby: asan }
|
- { os: ubuntu-24.04, ruby: asan }
|
||||||
- { os: ubuntu-24.04, ruby: 3.4-asan }
|
- { os: ubuntu-24.04, ruby: asan-release }
|
||||||
exclude:
|
exclude:
|
||||||
# https://github.com/ruby/setup-ruby/issues/496
|
# https://github.com/ruby/setup-ruby/issues/496
|
||||||
- { os: ubuntu-22.04, ruby: '2.2' }
|
- { os: ubuntu-22.04, ruby: '2.2' }
|
||||||
@@ -96,7 +96,7 @@ jobs:
|
|||||||
name: ${{ matrix.os }} ${{ matrix.ruby }}
|
name: ${{ matrix.os }} ${{ matrix.ruby }}
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v6
|
||||||
|
|
||||||
- uses: ./
|
- uses: ./
|
||||||
with:
|
with:
|
||||||
@@ -202,7 +202,7 @@ jobs:
|
|||||||
name: "Test .ruby-version"
|
name: "Test .ruby-version"
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v6
|
||||||
- run: echo "ruby-3.4.0" > .ruby-version
|
- run: echo "ruby-3.4.0" > .ruby-version
|
||||||
- uses: ./
|
- uses: ./
|
||||||
- run: ruby -v | grep -F "ruby 3.4.0"
|
- run: ruby -v | grep -F "ruby 3.4.0"
|
||||||
@@ -211,7 +211,7 @@ jobs:
|
|||||||
name: "Test .tool-versions"
|
name: "Test .tool-versions"
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v6
|
||||||
- run: echo -e "nodejs 16.0.0\nruby 3.4.0" > .tool-versions
|
- run: echo -e "nodejs 16.0.0\nruby 3.4.0" > .tool-versions
|
||||||
- uses: ./
|
- uses: ./
|
||||||
- run: ruby -v | grep -F "ruby 3.4.0"
|
- run: ruby -v | grep -F "ruby 3.4.0"
|
||||||
@@ -220,7 +220,7 @@ jobs:
|
|||||||
name: "Test mise.toml"
|
name: "Test mise.toml"
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v6
|
||||||
- run: echo -e "[tools]\nnode = '18'\nruby = '3.4.0'" > mise.toml
|
- run: echo -e "[tools]\nnode = '18'\nruby = '3.4.0'" > mise.toml
|
||||||
- uses: ./
|
- uses: ./
|
||||||
- run: ruby -v | grep -F "ruby 3.4.0"
|
- run: ruby -v | grep -F "ruby 3.4.0"
|
||||||
@@ -229,7 +229,7 @@ jobs:
|
|||||||
name: "Test with no Gemfile"
|
name: "Test with no Gemfile"
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v6
|
||||||
- run: rm Gemfile
|
- run: rm Gemfile
|
||||||
- uses: ./
|
- uses: ./
|
||||||
with:
|
with:
|
||||||
@@ -240,7 +240,7 @@ jobs:
|
|||||||
name: "Test with no Gemfile but with bundler-cache"
|
name: "Test with no Gemfile but with bundler-cache"
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v6
|
||||||
- run: rm Gemfile
|
- run: rm Gemfile
|
||||||
- uses: ./
|
- uses: ./
|
||||||
with:
|
with:
|
||||||
@@ -263,7 +263,7 @@ jobs:
|
|||||||
- { ruby: '2.3', expected_rubygems_version: '3.3.27' }
|
- { ruby: '2.3', expected_rubygems_version: '3.3.27' }
|
||||||
- { ruby: '2.0', expected_rubygems_version: '2.7.11' }
|
- { ruby: '2.0', expected_rubygems_version: '2.7.11' }
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v6
|
||||||
- uses: ./
|
- uses: ./
|
||||||
with:
|
with:
|
||||||
ruby-version: ${{ matrix.ruby }}
|
ruby-version: ${{ matrix.ruby }}
|
||||||
@@ -274,7 +274,7 @@ jobs:
|
|||||||
name: "Test rubygems: version upgrades RubyGems to that version if the default is older"
|
name: "Test rubygems: version upgrades RubyGems to that version if the default is older"
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v6
|
||||||
- uses: ./
|
- uses: ./
|
||||||
with:
|
with:
|
||||||
ruby-version: '2.6'
|
ruby-version: '2.6'
|
||||||
@@ -285,7 +285,7 @@ jobs:
|
|||||||
name: "Test rubygems: version noops if the default is newer"
|
name: "Test rubygems: version noops if the default is newer"
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v6
|
||||||
- uses: ./
|
- uses: ./
|
||||||
with:
|
with:
|
||||||
ruby-version: '3.1.0'
|
ruby-version: '3.1.0'
|
||||||
@@ -296,7 +296,7 @@ jobs:
|
|||||||
name: "Test rubygems: version uses the Bundler installed by the rubygems update"
|
name: "Test rubygems: version uses the Bundler installed by the rubygems update"
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v6
|
||||||
- uses: ./
|
- uses: ./
|
||||||
with:
|
with:
|
||||||
ruby-version: '3.1.0'
|
ruby-version: '3.1.0'
|
||||||
@@ -308,7 +308,7 @@ jobs:
|
|||||||
name: "Test bundler: 1.x for old Ruby"
|
name: "Test bundler: 1.x for old Ruby"
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v6
|
||||||
- uses: ./
|
- uses: ./
|
||||||
with:
|
with:
|
||||||
ruby-version: '2.3'
|
ruby-version: '2.3'
|
||||||
@@ -319,7 +319,7 @@ jobs:
|
|||||||
name: "Test with a major Bundler version"
|
name: "Test with a major Bundler version"
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v6
|
||||||
- uses: ./
|
- uses: ./
|
||||||
with:
|
with:
|
||||||
ruby-version: '2.6'
|
ruby-version: '2.6'
|
||||||
@@ -330,7 +330,7 @@ jobs:
|
|||||||
name: "Test with a minor Bundler version"
|
name: "Test with a minor Bundler version"
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v6
|
||||||
- uses: ./
|
- uses: ./
|
||||||
with:
|
with:
|
||||||
ruby-version: '2.6'
|
ruby-version: '2.6'
|
||||||
@@ -341,18 +341,31 @@ jobs:
|
|||||||
name: "Test with an exact Bundler version"
|
name: "Test with an exact Bundler version"
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v6
|
||||||
- uses: ./
|
- uses: ./
|
||||||
with:
|
with:
|
||||||
ruby-version: '2.6'
|
ruby-version: '2.6'
|
||||||
bundler: 2.2.3
|
bundler: 2.2.3
|
||||||
- run: bundle --version | grep -F "Bundler version 2.2.3"
|
- run: bundle --version | grep -F "Bundler version 2.2.3"
|
||||||
|
|
||||||
|
# https://github.com/ruby/setup-ruby/issues/845
|
||||||
|
testOlderBundlerVersion:
|
||||||
|
name: "Test with an older Bundler version than the one of the default gem"
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v6
|
||||||
|
- uses: ./
|
||||||
|
with:
|
||||||
|
ruby-version: '4.0'
|
||||||
|
bundler: 2.7.2
|
||||||
|
bundler-cache: true
|
||||||
|
- run: bundle --version | grep -F "Bundler version 2.7.2"
|
||||||
|
|
||||||
testBundlerPre:
|
testBundlerPre:
|
||||||
name: "Test with a Bundler pre/rc version"
|
name: "Test with a Bundler pre/rc version"
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v6
|
||||||
- uses: ./
|
- uses: ./
|
||||||
with:
|
with:
|
||||||
ruby-version: '2.6'
|
ruby-version: '2.6'
|
||||||
@@ -365,7 +378,7 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/bundler-dev.gemfile
|
BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/bundler-dev.gemfile
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v6
|
||||||
- uses: ./
|
- uses: ./
|
||||||
with:
|
with:
|
||||||
ruby-version: ruby-head
|
ruby-version: ruby-head
|
||||||
@@ -377,7 +390,7 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/bundler1.gemfile
|
BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/bundler1.gemfile
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v6
|
||||||
- uses: ./
|
- uses: ./
|
||||||
with:
|
with:
|
||||||
ruby-version: '2.7'
|
ruby-version: '2.7'
|
||||||
@@ -395,7 +408,7 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/${{ matrix.gemfile }}.gemfile
|
BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/${{ matrix.gemfile }}.gemfile
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v6
|
||||||
- uses: ./
|
- uses: ./
|
||||||
with:
|
with:
|
||||||
ruby-version: '3.2'
|
ruby-version: '3.2'
|
||||||
@@ -406,7 +419,7 @@ jobs:
|
|||||||
name: "Test windows-toolchain: none"
|
name: "Test windows-toolchain: none"
|
||||||
runs-on: windows-latest
|
runs-on: windows-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v6
|
||||||
- uses: ./
|
- uses: ./
|
||||||
with:
|
with:
|
||||||
ruby-version: '2.7'
|
ruby-version: '2.7'
|
||||||
@@ -418,7 +431,7 @@ jobs:
|
|||||||
lint:
|
lint:
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v6
|
||||||
- run: yarn install
|
- run: yarn install
|
||||||
- run: yarn run package
|
- run: yarn run package
|
||||||
- name: Check generated files are up to date
|
- name: Check generated files are up to date
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ jobs:
|
|||||||
update_branch:
|
update_branch:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v6
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
- run: git push origin HEAD:v1
|
- run: git push origin HEAD:v1
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ This action currently supports these versions of MRI, JRuby and TruffleRuby:
|
|||||||
|
|
||||||
| Interpreter | Versions |
|
| Interpreter | Versions |
|
||||||
| ----------- | -------- |
|
| ----------- | -------- |
|
||||||
| `ruby` | 1.9.3, 2.0.0, 2.1.9, 2.2, all versions from 2.3.0 until 3.5.0-preview1, head, debug, mingw, mswin, ucrt |
|
| `ruby` | 1.9.3, 2.0.0, 2.1.9, 2.2, all versions from 2.3.0 until 4.0.0, head, debug, mingw, mswin, ucrt |
|
||||||
| `jruby` | 9.1.17.0 - 10.0.2.0, head |
|
| `jruby` | 9.1.17.0 - 10.0.2.0, head |
|
||||||
| `truffleruby` | 19.3.0 - 25.0.0, head |
|
| `truffleruby` | 19.3.0 - 25.0.0, head |
|
||||||
| `truffleruby+graalvm` | 21.2.0 - 25.0.0, head |
|
| `truffleruby+graalvm` | 21.2.0 - 25.0.0, head |
|
||||||
@@ -26,7 +26,7 @@ This action currently supports these versions of MRI, JRuby and TruffleRuby:
|
|||||||
Native extensions are automatically compiled with AddressSanitizer when using `ruby-asan`.
|
Native extensions are automatically compiled with AddressSanitizer when using `ruby-asan`.
|
||||||
`ruby-asan` is currently only available on `ubuntu-24.04`.
|
`ruby-asan` is currently only available on `ubuntu-24.04`.
|
||||||
|
|
||||||
`ruby-3.4-asan` is similar to `ruby-asan` but built from the latest stable 3.4 release tag.
|
`asan-release` is similar to `ruby-asan` but built from the latest stable release tag.
|
||||||
Like `ruby-asan`, it's currently only available on `ubuntu-24.04`.
|
Like `ruby-asan`, it's currently only available on `ubuntu-24.04`.
|
||||||
|
|
||||||
Regarding Windows ruby master builds, `mingw` is a MSYS2/MinGW build, `head` & `ucrt` are MSYS2/UCRT64
|
Regarding Windows ruby master builds, `mingw` is a MSYS2/MinGW build, `head` & `ucrt` are MSYS2/UCRT64
|
||||||
@@ -50,7 +50,7 @@ The action works on these [GitHub-hosted runners](https://docs.github.com/en/act
|
|||||||
| Operating System | Supported |
|
| Operating System | Supported |
|
||||||
| ---------------- | --------- |
|
| ---------------- | --------- |
|
||||||
| Ubuntu | `ubuntu-22.04`, `ubuntu-24.04`, `ubuntu-22.04-arm`, `ubuntu-24.04-arm` |
|
| Ubuntu | `ubuntu-22.04`, `ubuntu-24.04`, `ubuntu-22.04-arm`, `ubuntu-24.04-arm` |
|
||||||
| macOS | `macos-13` and newer versions |
|
| macOS | `macos-14` and newer versions |
|
||||||
| Windows | `windows-2022`, `windows-2025`, `windows-11-arm` |
|
| Windows | `windows-2022`, `windows-2025`, `windows-11-arm` |
|
||||||
|
|
||||||
Not all combinations of runner images and versions are supported.
|
Not all combinations of runner images and versions are supported.
|
||||||
@@ -230,6 +230,22 @@ It is also possible to cache gems manually, but this is not recommended because
|
|||||||
There are many concerns which means using `actions/cache` is never enough for caching gems (e.g., incomplete cache key, cleaning old gems when restoring from another key, correctly hashing the lockfile if not checked in, OS versions, ABI compatibility for `ruby-head`, etc).
|
There are many concerns which means using `actions/cache` is never enough for caching gems (e.g., incomplete cache key, cleaning old gems when restoring from another key, correctly hashing the lockfile if not checked in, OS versions, ABI compatibility for `ruby-head`, etc).
|
||||||
So, please use `bundler-cache: true` instead and report any issue.
|
So, please use `bundler-cache: true` instead and report any issue.
|
||||||
|
|
||||||
|
### Authentication Token
|
||||||
|
|
||||||
|
By default, this action uses `${{ github.token }}` to authenticate when downloading Ruby release assets from GitHub.
|
||||||
|
This helps avoid rate limiting issues.
|
||||||
|
|
||||||
|
If you're running this action on a GitHub Enterprise Server (GHES) instance, or if you're experiencing rate limiting,
|
||||||
|
you can provide a custom token:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
- uses: ruby/setup-ruby@v1
|
||||||
|
with:
|
||||||
|
token: ${{ secrets.MY_GITHUB_TOKEN }}
|
||||||
|
```
|
||||||
|
|
||||||
|
In most cases, you don't need to set this input as the default value is sufficient for use on github.com.
|
||||||
|
|
||||||
## Windows
|
## Windows
|
||||||
|
|
||||||
Note that running CI on Windows can be quite challenging if you are not very familiar with Windows.
|
Note that running CI on Windows can be quite challenging if you are not very familiar with Windows.
|
||||||
|
|||||||
@@ -44,6 +44,12 @@ inputs:
|
|||||||
It also sets environment variables using 'ridk' or 'vcvars64.bat' based on the selected Ruby.
|
It also sets environment variables using 'ridk' or 'vcvars64.bat' based on the selected Ruby.
|
||||||
At present, the only other setting than 'default' is 'none', which only adds Ruby to PATH.
|
At present, the only other setting than 'default' is 'none', which only adds Ruby to PATH.
|
||||||
No build tools or packages are installed, nor are any ENV setting changed to activate them.
|
No build tools or packages are installed, nor are any ENV setting changed to activate them.
|
||||||
|
token:
|
||||||
|
description: |
|
||||||
|
Used to authenticate with GitHub when downloading Ruby release assets.
|
||||||
|
When running this action on github.com, the default value is sufficient.
|
||||||
|
When running on GHES, you can pass a personal access token for github.com if you are experiencing rate limiting.
|
||||||
|
default: ${{ github.server_url == 'https://github.com' && github.token || '' }}
|
||||||
|
|
||||||
outputs:
|
outputs:
|
||||||
ruby-prefix:
|
ruby-prefix:
|
||||||
|
|||||||
+43
-21
@@ -1,4 +1,5 @@
|
|||||||
const fs = require('fs')
|
const fs = require('fs')
|
||||||
|
const os = require('os')
|
||||||
const path = require('path')
|
const path = require('path')
|
||||||
const core = require('@actions/core')
|
const core = require('@actions/core')
|
||||||
const exec = require('@actions/exec')
|
const exec = require('@actions/exec')
|
||||||
@@ -66,17 +67,15 @@ export async function installBundler(bundlerVersionInput, rubygemsInputSet, lock
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const floatVersion = common.floatVersion(rubyVersion)
|
|
||||||
|
|
||||||
if (bundlerVersion === 'default') {
|
if (bundlerVersion === 'default') {
|
||||||
if (common.isBundler2dot2Default(engine, rubyVersion)) {
|
if (common.isBundler2dot2PlusDefault(engine, rubyVersion)) {
|
||||||
if (common.windows && engine === 'ruby' && (common.isStableVersion(engine, rubyVersion) || rubyVersion === 'head')) {
|
if (common.windows && engine === 'ruby' && (common.isStableVersion(engine, rubyVersion) || rubyVersion === 'head')) {
|
||||||
// https://github.com/ruby/setup-ruby/issues/371
|
// https://github.com/ruby/setup-ruby/issues/371
|
||||||
console.log(`Installing latest Bundler for ${engine}-${rubyVersion} on Windows because bin/bundle does not work in bash otherwise`)
|
console.log(`Installing latest Bundler for ${engine}-${rubyVersion} on Windows because bin/bundle does not work in bash otherwise`)
|
||||||
bundlerVersion = 'latest'
|
bundlerVersion = 'latest'
|
||||||
} else {
|
} else {
|
||||||
console.log(`Using Bundler 2 shipped with ${engine}-${rubyVersion}`)
|
console.log(`Using Bundler shipped with ${engine}-${rubyVersion}`)
|
||||||
return '2'
|
return common.isBundler4PlusDefault(engine, rubyVersion) ? '4' : '2'
|
||||||
}
|
}
|
||||||
} else if (common.hasBundlerDefaultGem(engine, rubyVersion)) {
|
} else if (common.hasBundlerDefaultGem(engine, rubyVersion)) {
|
||||||
// Those Rubies have a old Bundler default gem < 2.2 which does not work well for `gem 'foo', github: 'foo/foo'`:
|
// Those Rubies have a old Bundler default gem < 2.2 which does not work well for `gem 'foo', github: 'foo/foo'`:
|
||||||
@@ -89,8 +88,15 @@ export async function installBundler(bundlerVersionInput, rubygemsInputSet, lock
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const targetRubyVersion = common.targetRubyVersion(engine, rubyVersion)
|
||||||
|
|
||||||
if (bundlerVersion === 'latest') {
|
if (bundlerVersion === 'latest') {
|
||||||
bundlerVersion = '2'
|
// Bundler 4 requires Ruby 3.2+
|
||||||
|
if (targetRubyVersion < 3.2) {
|
||||||
|
bundlerVersion = '2'
|
||||||
|
} else {
|
||||||
|
bundlerVersion = '4'
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isValidBundlerVersion(bundlerVersion)) {
|
if (isValidBundlerVersion(bundlerVersion)) {
|
||||||
@@ -99,24 +105,29 @@ export async function installBundler(bundlerVersionInput, rubygemsInputSet, lock
|
|||||||
throw new Error(`Cannot parse bundler input: ${bundlerVersion}`)
|
throw new Error(`Cannot parse bundler input: ${bundlerVersion}`)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Use Bundler 1 when we know Bundler 2 does not work
|
// Only use Bundler 4 on Ruby 3.2+
|
||||||
if (bundlerVersion.startsWith('2')) {
|
if (common.floatVersion(bundlerVersion) >= 4 && targetRubyVersion < 3.2) {
|
||||||
if (engine === 'ruby' && floatVersion <= 2.2) {
|
console.log('Bundler 4 requires Ruby 3.2+, using Bundler 2 instead on Ruby < 3.2')
|
||||||
console.log('Bundler 2 requires Ruby 2.3+, using Bundler 1 on Ruby <= 2.2')
|
bundlerVersion = '2'
|
||||||
|
}
|
||||||
|
|
||||||
|
// Use Bundler 1 when we know Bundler 2+ does not work
|
||||||
|
if (common.floatVersion(bundlerVersion) >= 2) {
|
||||||
|
if (engine === 'ruby' && targetRubyVersion <= 2.2) {
|
||||||
|
console.log(`Bundler 2+ requires Ruby 2.3+, using Bundler 1 on Ruby <= 2.2`)
|
||||||
bundlerVersion = '1'
|
bundlerVersion = '1'
|
||||||
} else if (engine === 'ruby' && /^2\.3\.[01]/.test(rubyVersion)) {
|
} else if (engine === 'ruby' && /^2\.3\.[01]/.test(rubyVersion)) {
|
||||||
console.log('Ruby 2.3.0 and 2.3.1 have shipped with an old rubygems that only works with Bundler 1')
|
console.log('Ruby 2.3.0 and 2.3.1 have shipped with an old rubygems that only works with Bundler 1')
|
||||||
bundlerVersion = '1'
|
bundlerVersion = '1'
|
||||||
} else if (engine === 'jruby' && rubyVersion.startsWith('9.1')) { // JRuby 9.1 targets Ruby 2.3, treat it the same
|
} else if (engine === 'jruby' && rubyVersion.startsWith('9.1')) { // JRuby 9.1 targets Ruby 2.3, treat it the same
|
||||||
console.log('JRuby 9.1 has a bug with Bundler 2 (https://github.com/ruby/setup-ruby/issues/108), using Bundler 1 instead on JRuby 9.1')
|
console.log('JRuby 9.1 has a bug with Bundler 2+ (https://github.com/ruby/setup-ruby/issues/108), using Bundler 1 instead on JRuby 9.1')
|
||||||
bundlerVersion = '1'
|
bundlerVersion = '1'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const targetRubyVersion = common.targetRubyVersion(engine, rubyVersion)
|
|
||||||
// Use Bundler 2.3 when we use Ruby 2.3.2 - 2.5
|
// Use Bundler 2.3 when we use Ruby 2.3.2 - 2.5
|
||||||
// Use Bundler 2.4 when we use Ruby 2.6-2.7
|
// Use Bundler 2.4 when we use Ruby 2.6-2.7
|
||||||
if (bundlerVersion == '2') {
|
if (bundlerVersion === '2') {
|
||||||
if (targetRubyVersion <= 2.5) { // < 2.3.2 already handled above
|
if (targetRubyVersion <= 2.5) { // < 2.3.2 already handled above
|
||||||
console.log('Ruby 2.3.2 - 2.5 only works with Bundler 2.3')
|
console.log('Ruby 2.3.2 - 2.5 only works with Bundler 2.3')
|
||||||
bundlerVersion = '2.3'
|
bundlerVersion = '2.3'
|
||||||
@@ -136,6 +147,14 @@ export async function installBundler(bundlerVersionInput, rubygemsInputSet, lock
|
|||||||
return bundlerVersion
|
return bundlerVersion
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function bundlerConfigSetArgs(bundlerVersion, key, value) {
|
||||||
|
if (bundlerVersion.startsWith('1')) {
|
||||||
|
return ['config', '--local', key, value]
|
||||||
|
} else {
|
||||||
|
return ['config', 'set', '--local', key, value]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
export async function bundleInstall(gemfile, lockFile, platform, engine, rubyVersion, bundlerVersion, cacheVersion) {
|
export async function bundleInstall(gemfile, lockFile, platform, engine, rubyVersion, bundlerVersion, cacheVersion) {
|
||||||
if (gemfile === null) {
|
if (gemfile === null) {
|
||||||
console.log('Could not determine gemfile path, skipping "bundle install" and caching')
|
console.log('Could not determine gemfile path, skipping "bundle install" and caching')
|
||||||
@@ -143,10 +162,10 @@ export async function bundleInstall(gemfile, lockFile, platform, engine, rubyVer
|
|||||||
}
|
}
|
||||||
|
|
||||||
let envOptions = {}
|
let envOptions = {}
|
||||||
if (bundlerVersion.startsWith('1') && common.isBundler2Default(engine, rubyVersion)) {
|
if (bundlerVersion.match(/^\d+/)) {
|
||||||
// If Bundler 1 is specified on Rubies which ship with Bundler 2,
|
// If a specific Bundler version is given or determined, we need to specify the version to use explicitly until the lockfile exists.
|
||||||
// we need to specify which Bundler version to use explicitly until the lockfile exists.
|
// Otherwise, a newer version of Bundler might be used.
|
||||||
console.log(`Setting BUNDLER_VERSION=${bundlerVersion} for "bundle config|lock" commands below to ensure Bundler 1 is used`)
|
console.log(`Setting BUNDLER_VERSION=${bundlerVersion} for "bundle config|lock" commands below to ensure Bundler ${bundlerVersion} is used`)
|
||||||
envOptions = { env: { ...process.env, BUNDLER_VERSION: bundlerVersion } }
|
envOptions = { env: { ...process.env, BUNDLER_VERSION: bundlerVersion } }
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -155,10 +174,10 @@ export async function bundleInstall(gemfile, lockFile, platform, engine, rubyVer
|
|||||||
// An absolute path, so it is reliably under $PWD/vendor/bundle, and not relative to the gemfile's directory
|
// An absolute path, so it is reliably under $PWD/vendor/bundle, and not relative to the gemfile's directory
|
||||||
const bundleCachePath = path.join(process.cwd(), cachePath)
|
const bundleCachePath = path.join(process.cwd(), cachePath)
|
||||||
|
|
||||||
await exec.exec('bundle', ['config', '--local', 'path', bundleCachePath], envOptions)
|
await exec.exec('bundle', bundlerConfigSetArgs(bundlerVersion, 'path', bundleCachePath), envOptions)
|
||||||
|
|
||||||
if (fs.existsSync(lockFile)) {
|
if (fs.existsSync(lockFile)) {
|
||||||
await exec.exec('bundle', ['config', '--local', 'deployment', 'true'], envOptions)
|
await exec.exec('bundle', bundlerConfigSetArgs(bundlerVersion, 'deployment', 'true'), envOptions)
|
||||||
} else {
|
} else {
|
||||||
// Generate the lockfile so we can use it to compute the cache key.
|
// Generate the lockfile so we can use it to compute the cache key.
|
||||||
// This will also automatically pick up the latest gem versions compatible with the Gemfile.
|
// This will also automatically pick up the latest gem versions compatible with the Gemfile.
|
||||||
@@ -193,11 +212,14 @@ export async function bundleInstall(gemfile, lockFile, platform, engine, rubyVer
|
|||||||
console.log(`Found cache for key: ${cachedKey}`)
|
console.log(`Found cache for key: ${cachedKey}`)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Number of jobs should scale with runner, up to a point
|
||||||
|
const jobs = Math.min(os.availableParallelism(), 8)
|
||||||
// Always run 'bundle install' to list the gems
|
// Always run 'bundle install' to list the gems
|
||||||
await exec.exec('bundle', ['install', '--jobs', '4'])
|
await exec.exec('bundle', ['install', '--jobs', `${jobs}`])
|
||||||
|
|
||||||
// @actions/cache only allows to save for non-existing keys
|
// @actions/cache only allows to save for non-existing keys
|
||||||
if (!common.isExactCacheKeyMatch(key, cachedKey)) {
|
// Also, skip saving cache for merge_group event
|
||||||
|
if (!common.isExactCacheKeyMatch(key, cachedKey) && process.env['GITHUB_EVENT_NAME'] !== 'merge_group') {
|
||||||
if (cachedKey) { // existing cache but Gemfile.lock differs, clean old gems
|
if (cachedKey) { // existing cache but Gemfile.lock differs, clean old gems
|
||||||
await exec.exec('bundle', ['clean'])
|
await exec.exec('bundle', ['clean'])
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,9 +13,11 @@ const linuxOSInfo = require('linux-os-info')
|
|||||||
export const windows = (os.platform() === 'win32')
|
export const windows = (os.platform() === 'win32')
|
||||||
// Extract to SSD on Windows, see https://github.com/ruby/setup-ruby/pull/14
|
// Extract to SSD on Windows, see https://github.com/ruby/setup-ruby/pull/14
|
||||||
export const drive = (windows ? (process.env['RUNNER_TEMP'] || 'C')[0] : undefined)
|
export const drive = (windows ? (process.env['RUNNER_TEMP'] || 'C')[0] : undefined)
|
||||||
|
const PATH_ENV_VAR = windows ? 'Path' : 'PATH'
|
||||||
|
|
||||||
export const inputs = {
|
export const inputs = {
|
||||||
selfHosted: undefined
|
selfHosted: undefined,
|
||||||
|
token: undefined
|
||||||
}
|
}
|
||||||
|
|
||||||
export function partition(string, separator) {
|
export function partition(string, separator) {
|
||||||
@@ -67,8 +69,8 @@ export async function time(name, block) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function isHeadVersion(rubyVersion) {
|
export function isHeadVersion(rubyVersion) {
|
||||||
// 3.4-asan counts as "head" because the version cannot be selected -- you can only get whatever's latest
|
// asan-release counts as "head" because the version cannot be selected -- you can only get whatever's latest
|
||||||
return ['head', 'debug', 'mingw', 'mswin', 'ucrt', 'asan', '3.4-asan'].includes(rubyVersion)
|
return ['head', 'debug', 'mingw', 'mswin', 'ucrt', 'asan', 'asan-release'].includes(rubyVersion)
|
||||||
}
|
}
|
||||||
|
|
||||||
export function isStableVersion(engine, rubyVersion) {
|
export function isStableVersion(engine, rubyVersion) {
|
||||||
@@ -80,7 +82,7 @@ export function isStableVersion(engine, rubyVersion) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function hasBundlerDefaultGem(engine, rubyVersion) {
|
export function hasBundlerDefaultGem(engine, rubyVersion) {
|
||||||
return isBundler1Default(engine, rubyVersion) || isBundler2Default(engine, rubyVersion)
|
return isBundler1Default(engine, rubyVersion) || isBundler2PlusDefault(engine, rubyVersion)
|
||||||
}
|
}
|
||||||
|
|
||||||
export function isBundler1Default(engine, rubyVersion) {
|
export function isBundler1Default(engine, rubyVersion) {
|
||||||
@@ -95,7 +97,7 @@ export function isBundler1Default(engine, rubyVersion) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export function isBundler2Default(engine, rubyVersion) {
|
export function isBundler2PlusDefault(engine, rubyVersion) {
|
||||||
if (engine === 'ruby') {
|
if (engine === 'ruby') {
|
||||||
return floatVersion(rubyVersion) >= 2.7
|
return floatVersion(rubyVersion) >= 2.7
|
||||||
} else if (engine.startsWith('truffleruby')) {
|
} else if (engine.startsWith('truffleruby')) {
|
||||||
@@ -107,7 +109,7 @@ export function isBundler2Default(engine, rubyVersion) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export function isBundler2dot2Default(engine, rubyVersion) {
|
export function isBundler2dot2PlusDefault(engine, rubyVersion) {
|
||||||
if (engine === 'ruby') {
|
if (engine === 'ruby') {
|
||||||
return floatVersion(rubyVersion) >= 3.0
|
return floatVersion(rubyVersion) >= 3.0
|
||||||
} else if (engine.startsWith('truffleruby')) {
|
} else if (engine.startsWith('truffleruby')) {
|
||||||
@@ -119,6 +121,13 @@ export function isBundler2dot2Default(engine, rubyVersion) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const UNKNOWN_TARGET_RUBY_VERSION = 9.9
|
||||||
|
|
||||||
|
export function isBundler4PlusDefault(engine, rubyVersion) {
|
||||||
|
const version = targetRubyVersion(engine, rubyVersion)
|
||||||
|
return version != UNKNOWN_TARGET_RUBY_VERSION && version >= 4.0
|
||||||
|
}
|
||||||
|
|
||||||
export function targetRubyVersion(engine, rubyVersion) {
|
export function targetRubyVersion(engine, rubyVersion) {
|
||||||
const version = floatVersion(rubyVersion)
|
const version = floatVersion(rubyVersion)
|
||||||
if (engine === 'ruby') {
|
if (engine === 'ruby') {
|
||||||
@@ -132,6 +141,8 @@ export function targetRubyVersion(engine, rubyVersion) {
|
|||||||
return 2.6
|
return 2.6
|
||||||
} else if (version === 9.4) {
|
} else if (version === 9.4) {
|
||||||
return 3.1
|
return 3.1
|
||||||
|
} else if (version === 10.0) {
|
||||||
|
return 3.4
|
||||||
}
|
}
|
||||||
} else if (engine.startsWith('truffleruby')) {
|
} else if (engine.startsWith('truffleruby')) {
|
||||||
if (version < 21.0) {
|
if (version < 21.0) {
|
||||||
@@ -147,11 +158,11 @@ export function targetRubyVersion(engine, rubyVersion) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return 9.9 // unknown, assume recent
|
return UNKNOWN_TARGET_RUBY_VERSION // unknown, assume recent
|
||||||
}
|
}
|
||||||
|
|
||||||
export function floatVersion(rubyVersion) {
|
export function floatVersion(rubyVersion) {
|
||||||
const match = rubyVersion.match(/^\d+\.\d+/)
|
const match = rubyVersion.match(/^\d+(\.\d+|$)/)
|
||||||
if (match) {
|
if (match) {
|
||||||
return parseFloat(match[0])
|
return parseFloat(match[0])
|
||||||
} else if (isHeadVersion(rubyVersion)) {
|
} else if (isHeadVersion(rubyVersion)) {
|
||||||
@@ -356,23 +367,22 @@ export function win2nix(path) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function setupPath(newPathEntries) {
|
export function setupPath(newPathEntries) {
|
||||||
const envPath = windows ? 'Path' : 'PATH'
|
const originalPath = process.env[PATH_ENV_VAR].split(path.delimiter)
|
||||||
const originalPath = process.env[envPath].split(path.delimiter)
|
|
||||||
let cleanPath = originalPath.filter(entry => !/\bruby\b/i.test(entry))
|
let cleanPath = originalPath.filter(entry => !/\bruby\b/i.test(entry))
|
||||||
|
|
||||||
core.group(`Modifying ${envPath}`, async () => {
|
core.group(`Modifying ${PATH_ENV_VAR}`, async () => {
|
||||||
// First remove the conflicting path entries
|
// First remove the conflicting path entries
|
||||||
if (cleanPath.length !== originalPath.length) {
|
if (cleanPath.length !== originalPath.length) {
|
||||||
console.log(`Entries removed from ${envPath} to avoid conflicts with default Ruby:`)
|
console.log(`Entries removed from ${PATH_ENV_VAR} to avoid conflicts with default Ruby:`)
|
||||||
for (const entry of originalPath) {
|
for (const entry of originalPath) {
|
||||||
if (!cleanPath.includes(entry)) {
|
if (!cleanPath.includes(entry)) {
|
||||||
console.log(` ${entry}`)
|
console.log(` ${entry}`)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
core.exportVariable(envPath, cleanPath.join(path.delimiter))
|
core.exportVariable(PATH_ENV_VAR, cleanPath.join(path.delimiter))
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log(`Entries added to ${envPath} to use selected Ruby:`)
|
console.log(`Entries added to ${PATH_ENV_VAR} to use selected Ruby:`)
|
||||||
for (const entry of newPathEntries) {
|
for (const entry of newPathEntries) {
|
||||||
console.log(` ${entry}`)
|
console.log(` ${entry}`)
|
||||||
}
|
}
|
||||||
@@ -406,14 +416,17 @@ export async function setupJavaHome(rubyPrefix) {
|
|||||||
// JAVA_HOME_21_X64 - https://github.com/actions/runner-images/blob/main/images/ubuntu/Ubuntu2404-Readme.md#java
|
// JAVA_HOME_21_X64 - https://github.com/actions/runner-images/blob/main/images/ubuntu/Ubuntu2404-Readme.md#java
|
||||||
let newHomeVar = `JAVA_HOME_21_${arch}`
|
let newHomeVar = `JAVA_HOME_21_${arch}`
|
||||||
let newHome = process.env[newHomeVar]
|
let newHome = process.env[newHomeVar]
|
||||||
|
let bin = path.join(newHome, 'bin')
|
||||||
|
|
||||||
if (newHome === "undefined") {
|
if (newHome === "undefined") {
|
||||||
throw new Error(`JAVA_HOME is not Java 21+ needed for JRuby and \$${newHomeVar} is not defined`)
|
throw new Error(`JAVA_HOME is not Java 21+ needed for JRuby and \$${newHomeVar} is not defined`)
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log(`Setting JAVA_HOME to ${newHomeVar} path ${newHome}`)
|
console.log(`Setting JAVA_HOME to ${newHomeVar} path ${newHome}`)
|
||||||
|
|
||||||
core.exportVariable("JAVA_HOME", newHome)
|
core.exportVariable("JAVA_HOME", newHome)
|
||||||
|
|
||||||
|
console.log(`Adding ${bin} to ${PATH_ENV_VAR}`)
|
||||||
|
core.addPath(bin)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -429,3 +442,8 @@ export function isExactCacheKeyMatch(key, cacheKey) {
|
|||||||
}) === 0
|
}) === 0
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export async function download(url) {
|
||||||
|
const auth = inputs.token ? `token ${inputs.token}` : undefined
|
||||||
|
return await tc.downloadTool(url, undefined, auth)
|
||||||
|
}
|
||||||
|
|||||||
+93
-51
File diff suppressed because one or more lines are too long
@@ -18,6 +18,7 @@ const inputDefaults = {
|
|||||||
'cache-version': bundler.DEFAULT_CACHE_VERSION,
|
'cache-version': bundler.DEFAULT_CACHE_VERSION,
|
||||||
'self-hosted': 'false',
|
'self-hosted': 'false',
|
||||||
'windows-toolchain': 'default',
|
'windows-toolchain': 'default',
|
||||||
|
'token': '',
|
||||||
}
|
}
|
||||||
|
|
||||||
// entry point when this action is run on its own
|
// entry point when this action is run on its own
|
||||||
@@ -45,6 +46,7 @@ export async function setupRuby(options = {}) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
common.inputs.selfHosted = inputs['self-hosted']
|
common.inputs.selfHosted = inputs['self-hosted']
|
||||||
|
common.inputs.token = inputs['token']
|
||||||
|
|
||||||
process.chdir(inputs['working-directory'])
|
process.chdir(inputs['working-directory'])
|
||||||
|
|
||||||
@@ -175,7 +177,7 @@ function validateRubyEngineAndVersion(platform, engineVersions, engine, parsedVe
|
|||||||
// Well known version-platform combinations which do not work:
|
// Well known version-platform combinations which do not work:
|
||||||
if (engine === 'ruby' && platform.startsWith('macos') && os.arch() === 'arm64' && common.floatVersion(version) < 2.6) {
|
if (engine === 'ruby' && platform.startsWith('macos') && os.arch() === 'arm64' && common.floatVersion(version) < 2.6) {
|
||||||
throw new Error(`CRuby < 2.6 does not support macos-arm64.
|
throw new Error(`CRuby < 2.6 does not support macos-arm64.
|
||||||
Either use a newer Ruby version or use a macOS image running on amd64, e.g., macos-13.
|
Either use a newer Ruby version or use a macOS image running on amd64, e.g., macos-15-intel.
|
||||||
Note that GitHub changed the meaning of macos-latest from macos-12 (amd64) to macos-14 (arm64):
|
Note that GitHub changed the meaning of macos-latest from macos-12 (amd64) to macos-14 (arm64):
|
||||||
https://github.blog/changelog/2024-04-01-macos-14-sonoma-is-generally-available-and-the-latest-macos-runner-image/
|
https://github.blog/changelog/2024-04-01-macos-14-sonoma-is-generally-available-and-the-latest-macos-runner-image/
|
||||||
|
|
||||||
@@ -188,8 +190,8 @@ function validateRubyEngineAndVersion(platform, engineVersions, engine, parsedVe
|
|||||||
- { os: macos-latest, ruby: '2.4' }
|
- { os: macos-latest, ruby: '2.4' }
|
||||||
- { os: macos-latest, ruby: '2.5' }
|
- { os: macos-latest, ruby: '2.5' }
|
||||||
include:
|
include:
|
||||||
- { os: macos-13, ruby: '2.4' }
|
- { os: macos-15-intel, ruby: '2.4' }
|
||||||
- { os: macos-13, ruby: '2.5' }
|
- { os: macos-15-intel, ruby: '2.5' }
|
||||||
|
|
||||||
But of course you should consider dropping support for these long-EOL Rubies, which cannot even be built on recent macOS machines.`)
|
But of course you should consider dropping support for these long-EOL Rubies, which cannot even be built on recent macOS machines.`)
|
||||||
} else if (engine === 'truffleruby' && platform.startsWith('windows')) {
|
} else if (engine === 'truffleruby' && platform.startsWith('windows')) {
|
||||||
|
|||||||
@@ -12,10 +12,11 @@
|
|||||||
"3.0.0-preview1", "3.0.0-preview2", "3.0.0-rc1", "3.0.0", "3.0.1", "3.0.2", "3.0.3", "3.0.4", "3.0.5", "3.0.6", "3.0.7",
|
"3.0.0-preview1", "3.0.0-preview2", "3.0.0-rc1", "3.0.0", "3.0.1", "3.0.2", "3.0.3", "3.0.4", "3.0.5", "3.0.6", "3.0.7",
|
||||||
"3.1.0-preview1", "3.1.0", "3.1.1", "3.1.2", "3.1.3", "3.1.4", "3.1.5", "3.1.6", "3.1.7",
|
"3.1.0-preview1", "3.1.0", "3.1.1", "3.1.2", "3.1.3", "3.1.4", "3.1.5", "3.1.6", "3.1.7",
|
||||||
"3.2.0-preview1", "3.2.0-preview2", "3.2.0-preview3", "3.2.0-rc1", "3.2.0", "3.2.1", "3.2.2", "3.2.3", "3.2.4", "3.2.5", "3.2.6", "3.2.7", "3.2.8", "3.2.9",
|
"3.2.0-preview1", "3.2.0-preview2", "3.2.0-preview3", "3.2.0-rc1", "3.2.0", "3.2.1", "3.2.2", "3.2.3", "3.2.4", "3.2.5", "3.2.6", "3.2.7", "3.2.8", "3.2.9",
|
||||||
"3.3.0-preview1", "3.3.0-preview2", "3.3.0-preview3", "3.3.0-rc1", "3.3.0", "3.3.1", "3.3.2", "3.3.3", "3.3.4", "3.3.5", "3.3.6", "3.3.7", "3.3.8", "3.3.9",
|
"3.3.0-preview1", "3.3.0-preview2", "3.3.0-preview3", "3.3.0-rc1", "3.3.0", "3.3.1", "3.3.2", "3.3.3", "3.3.4", "3.3.5", "3.3.6", "3.3.7", "3.3.8", "3.3.9", "3.3.10",
|
||||||
"3.4.0-preview1", "3.4.0-preview2", "3.4.0-rc1", "3.4.0", "3.4.1", "3.4.2", "3.4.3", "3.4.4", "3.4.5", "3.4.6", "3.4.7",
|
"3.4.0-preview1", "3.4.0-preview2", "3.4.0-rc1", "3.4.0", "3.4.1", "3.4.2", "3.4.3", "3.4.4", "3.4.5", "3.4.6", "3.4.7", "3.4.8",
|
||||||
"3.5.0-preview1",
|
"3.5.0-preview1",
|
||||||
"head", "debug", "asan", "3.4-asan"
|
"4.0.0-preview2", "4.0.0-preview3", "4.0.0",
|
||||||
|
"head", "debug", "asan", "asan-release"
|
||||||
],
|
],
|
||||||
"jruby": [
|
"jruby": [
|
||||||
"9.1.17.0",
|
"9.1.17.0",
|
||||||
|
|||||||
+1
-2
@@ -4,7 +4,6 @@ const path = require('path')
|
|||||||
const core = require('@actions/core')
|
const core = require('@actions/core')
|
||||||
const exec = require('@actions/exec')
|
const exec = require('@actions/exec')
|
||||||
const io = require('@actions/io')
|
const io = require('@actions/io')
|
||||||
const tc = require('@actions/tool-cache')
|
|
||||||
const common = require('./common')
|
const common = require('./common')
|
||||||
const rubyBuilderVersions = require('./ruby-builder-versions')
|
const rubyBuilderVersions = require('./ruby-builder-versions')
|
||||||
|
|
||||||
@@ -75,7 +74,7 @@ async function downloadAndExtract(platform, engine, version, rubyPrefix) {
|
|||||||
const url = getDownloadURL(platform, engine, version)
|
const url = getDownloadURL(platform, engine, version)
|
||||||
console.log(url)
|
console.log(url)
|
||||||
try {
|
try {
|
||||||
return await tc.downloadTool(url)
|
return await common.download(url)
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
if (error.message.includes('404')) {
|
if (error.message.includes('404')) {
|
||||||
throw new Error(`Unavailable version ${version} for ${engine} on ${platform}
|
throw new Error(`Unavailable version ${version} for ${engine} on ${platform}
|
||||||
|
|||||||
@@ -236,6 +236,9 @@
|
|||||||
"3.3.9": {
|
"3.3.9": {
|
||||||
"x64": "https://github.com/ruby/setup-msys2-gcc/releases/latest/download/msys2-ucrt64.7z"
|
"x64": "https://github.com/ruby/setup-msys2-gcc/releases/latest/download/msys2-ucrt64.7z"
|
||||||
},
|
},
|
||||||
|
"3.3.10": {
|
||||||
|
"x64": "https://github.com/ruby/setup-msys2-gcc/releases/latest/download/msys2-ucrt64.7z"
|
||||||
|
},
|
||||||
"3.4.1": {
|
"3.4.1": {
|
||||||
"arm64": "https://github.com/ruby/setup-msys2-gcc/releases/latest/download/msys2-clangarm64-mingw-w64@r688.7z",
|
"arm64": "https://github.com/ruby/setup-msys2-gcc/releases/latest/download/msys2-clangarm64-mingw-w64@r688.7z",
|
||||||
"x64": "https://github.com/ruby/setup-msys2-gcc/releases/latest/download/msys2-ucrt64-mingw-w64@r688-gcc@14.7z"
|
"x64": "https://github.com/ruby/setup-msys2-gcc/releases/latest/download/msys2-ucrt64-mingw-w64@r688-gcc@14.7z"
|
||||||
@@ -260,6 +263,18 @@
|
|||||||
"arm64": "https://github.com/ruby/setup-msys2-gcc/releases/latest/download/msys2-clangarm64.7z",
|
"arm64": "https://github.com/ruby/setup-msys2-gcc/releases/latest/download/msys2-clangarm64.7z",
|
||||||
"x64": "https://github.com/ruby/setup-msys2-gcc/releases/latest/download/msys2-ucrt64.7z"
|
"x64": "https://github.com/ruby/setup-msys2-gcc/releases/latest/download/msys2-ucrt64.7z"
|
||||||
},
|
},
|
||||||
|
"3.4.7": {
|
||||||
|
"arm64": "https://github.com/ruby/setup-msys2-gcc/releases/latest/download/msys2-clangarm64.7z",
|
||||||
|
"x64": "https://github.com/ruby/setup-msys2-gcc/releases/latest/download/msys2-ucrt64.7z"
|
||||||
|
},
|
||||||
|
"3.4.8": {
|
||||||
|
"arm64": "https://github.com/ruby/setup-msys2-gcc/releases/latest/download/msys2-clangarm64.7z",
|
||||||
|
"x64": "https://github.com/ruby/setup-msys2-gcc/releases/latest/download/msys2-ucrt64.7z"
|
||||||
|
},
|
||||||
|
"4.0.0": {
|
||||||
|
"arm64": "https://github.com/ruby/setup-msys2-gcc/releases/latest/download/msys2-clangarm64.7z",
|
||||||
|
"x64": "https://github.com/ruby/setup-msys2-gcc/releases/latest/download/msys2-ucrt64.7z"
|
||||||
|
},
|
||||||
"head": {
|
"head": {
|
||||||
"arm64": "https://github.com/ruby/setup-msys2-gcc/releases/latest/download/msys2-clangarm64.7z",
|
"arm64": "https://github.com/ruby/setup-msys2-gcc/releases/latest/download/msys2-clangarm64.7z",
|
||||||
"x64": "https://github.com/ruby/setup-msys2-gcc/releases/latest/download/msys2-ucrt64.7z"
|
"x64": "https://github.com/ruby/setup-msys2-gcc/releases/latest/download/msys2-ucrt64.7z"
|
||||||
|
|||||||
@@ -236,6 +236,9 @@
|
|||||||
"3.3.9": {
|
"3.3.9": {
|
||||||
"x64": "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-3.3.9-1/rubyinstaller-3.3.9-1-x64.7z"
|
"x64": "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-3.3.9-1/rubyinstaller-3.3.9-1-x64.7z"
|
||||||
},
|
},
|
||||||
|
"3.3.10": {
|
||||||
|
"x64": "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-3.3.10-1/rubyinstaller-3.3.10-1-x64.7z"
|
||||||
|
},
|
||||||
"3.4.1": {
|
"3.4.1": {
|
||||||
"arm64": "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-3.4.1-2/rubyinstaller-3.4.1-2-arm.7z",
|
"arm64": "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-3.4.1-2/rubyinstaller-3.4.1-2-arm.7z",
|
||||||
"x64": "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-3.4.1-2/rubyinstaller-3.4.1-2-x64.7z"
|
"x64": "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-3.4.1-2/rubyinstaller-3.4.1-2-x64.7z"
|
||||||
@@ -260,6 +263,18 @@
|
|||||||
"arm64": "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-3.4.6-1/rubyinstaller-3.4.6-1-arm.7z",
|
"arm64": "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-3.4.6-1/rubyinstaller-3.4.6-1-arm.7z",
|
||||||
"x64": "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-3.4.6-1/rubyinstaller-3.4.6-1-x64.7z"
|
"x64": "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-3.4.6-1/rubyinstaller-3.4.6-1-x64.7z"
|
||||||
},
|
},
|
||||||
|
"3.4.7": {
|
||||||
|
"arm64": "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-3.4.7-1/rubyinstaller-3.4.7-1-arm.7z",
|
||||||
|
"x64": "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-3.4.7-1/rubyinstaller-3.4.7-1-x64.7z"
|
||||||
|
},
|
||||||
|
"3.4.8": {
|
||||||
|
"arm64": "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-3.4.8-1/rubyinstaller-3.4.8-1-arm.7z",
|
||||||
|
"x64": "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-3.4.8-1/rubyinstaller-3.4.8-1-x64.7z"
|
||||||
|
},
|
||||||
|
"4.0.0": {
|
||||||
|
"arm64": "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-4.0.0-1/rubyinstaller-4.0.0-1-arm.7z",
|
||||||
|
"x64": "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-4.0.0-1/rubyinstaller-4.0.0-1-x64.7z"
|
||||||
|
},
|
||||||
"head": {
|
"head": {
|
||||||
"arm64": "https://github.com/oneclick/rubyinstaller2/releases/download/rubyinstaller-head/rubyinstaller-head-arm.7z",
|
"arm64": "https://github.com/oneclick/rubyinstaller2/releases/download/rubyinstaller-head/rubyinstaller-head-arm.7z",
|
||||||
"x64": "https://github.com/oneclick/rubyinstaller2/releases/download/rubyinstaller-head/rubyinstaller-head-x64.7z"
|
"x64": "https://github.com/oneclick/rubyinstaller2/releases/download/rubyinstaller-head/rubyinstaller-head-x64.7z"
|
||||||
|
|||||||
+4
-5
@@ -7,7 +7,6 @@ const path = require('path')
|
|||||||
const cp = require('child_process')
|
const cp = require('child_process')
|
||||||
const core = require('@actions/core')
|
const core = require('@actions/core')
|
||||||
const exec = require('@actions/exec')
|
const exec = require('@actions/exec')
|
||||||
const tc = require('@actions/tool-cache')
|
|
||||||
const common = require('./common')
|
const common = require('./common')
|
||||||
const rubyInstallerVersions = require('./windows-versions.json')
|
const rubyInstallerVersions = require('./windows-versions.json')
|
||||||
const toolchainVersions = require('./windows-toolchain-versions.json')
|
const toolchainVersions = require('./windows-toolchain-versions.json')
|
||||||
@@ -81,7 +80,7 @@ export async function install(platform, engine, version) {
|
|||||||
async function downloadAndExtract(engine, version, url, base, rubyPrefix) {
|
async function downloadAndExtract(engine, version, url, base, rubyPrefix) {
|
||||||
const downloadPath = await common.measure('Downloading Ruby', async () => {
|
const downloadPath = await common.measure('Downloading Ruby', async () => {
|
||||||
console.log(url)
|
console.log(url)
|
||||||
return await tc.downloadTool(url)
|
return await common.download(url)
|
||||||
})
|
})
|
||||||
|
|
||||||
const extractPath = process.env.RUNNER_TEMP
|
const extractPath = process.env.RUNNER_TEMP
|
||||||
@@ -113,7 +112,7 @@ export async function installJRubyTools() {
|
|||||||
async function installMSYS2(url, rubyPrefix = process.env.RUNNER_TEMP) {
|
async function installMSYS2(url, rubyPrefix = process.env.RUNNER_TEMP) {
|
||||||
const downloadPath = await common.measure('Downloading msys2 build tools', async () => {
|
const downloadPath = await common.measure('Downloading msys2 build tools', async () => {
|
||||||
console.log(url)
|
console.log(url)
|
||||||
return await tc.downloadTool(url)
|
return await common.download(url)
|
||||||
})
|
})
|
||||||
|
|
||||||
const extractPath = path.join(process.env.RUNNER_TEMP, 'msys64')
|
const extractPath = path.join(process.env.RUNNER_TEMP, 'msys64')
|
||||||
@@ -160,7 +159,7 @@ async function installMSYS1(url) {
|
|||||||
|
|
||||||
const downloadPath = await common.measure('Downloading msys1 build tools', async () => {
|
const downloadPath = await common.measure('Downloading msys1 build tools', async () => {
|
||||||
console.log(url)
|
console.log(url)
|
||||||
return await tc.downloadTool(url)
|
return await common.download(url)
|
||||||
})
|
})
|
||||||
|
|
||||||
const msys1Path = `${common.drive}:\\DevKit64`
|
const msys1Path = `${common.drive}:\\DevKit64`
|
||||||
@@ -196,7 +195,7 @@ async function installMSYS1(url) {
|
|||||||
async function installVCPKG(url) {
|
async function installVCPKG(url) {
|
||||||
const downloadPath = await common.measure('Downloading mswin vcpkg packages', async () => {
|
const downloadPath = await common.measure('Downloading mswin vcpkg packages', async () => {
|
||||||
console.log(url)
|
console.log(url)
|
||||||
return await tc.downloadTool(url)
|
return await common.download(url)
|
||||||
})
|
})
|
||||||
|
|
||||||
const extractPath = process.env.VCPKG_INSTALLATION_ROOT
|
const extractPath = process.env.VCPKG_INSTALLATION_ROOT
|
||||||
|
|||||||
Reference in New Issue
Block a user