mirror of
https://github.com/ruby/setup-ruby.git
synced 2026-09-13 22:44:20 +02:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d359377deb | ||
|
|
4a1b0853ab | ||
|
|
c36d5afe85 | ||
|
|
8781aa98b4 | ||
|
|
578365d08b | ||
|
|
c3f0cb18af | ||
|
|
180e1d1f1c | ||
|
|
238b81ee64 | ||
|
|
8f312efe12 | ||
|
|
26470672e5 | ||
|
|
fb94cfb62e | ||
|
|
f51e04d8c5 | ||
|
|
e9c1c1bf40 | ||
|
|
24d6deea38 | ||
|
|
3b96304b91 | ||
|
|
18485596cf | ||
|
|
70ec766ec5 | ||
|
|
ffd46bd1d2 | ||
|
|
480fe921a2 | ||
|
|
4fbcf63963 | ||
|
|
66308367ad | ||
|
|
b0aab3e1cf | ||
|
|
23b44d8ec5 | ||
|
|
6cc535991c | ||
|
|
226c4cceaa | ||
|
|
4726835508 | ||
|
|
bee16c98fd | ||
|
|
168d6a54b4 | ||
|
|
f0971f0dd4 |
+42
-10
@@ -15,27 +15,26 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
os: [ ubuntu-18.04, ubuntu-20.04, macos-10.15, macos-11.0, windows-2016, windows-2019 ]
|
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 ]
|
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:
|
include:
|
||||||
- { os: windows-2016, ruby: mingw }
|
|
||||||
- { os: windows-2019, ruby: mingw }
|
- { os: windows-2019, ruby: mingw }
|
||||||
- { os: windows-2019, ruby: mswin }
|
- { os: windows-2019, ruby: mswin }
|
||||||
|
- { os: windows-2022, ruby: mingw }
|
||||||
|
- { os: windows-2022, ruby: ucrt }
|
||||||
exclude:
|
exclude:
|
||||||
- { os: windows-2016, ruby: 1.9 }
|
|
||||||
- { os: windows-2016, ruby: 3.1 }
|
|
||||||
- { os: windows-2016, ruby: debug }
|
|
||||||
- { os: windows-2016, ruby: truffleruby }
|
|
||||||
- { os: windows-2016, ruby: truffleruby-head }
|
|
||||||
- { os: windows-2016, ruby: truffleruby+graalvm }
|
|
||||||
- { os: windows-2016, ruby: truffleruby+graalvm-head }
|
|
||||||
- { os: windows-2019, ruby: 1.9 }
|
- { os: windows-2019, ruby: 1.9 }
|
||||||
- { os: windows-2019, ruby: 3.1 }
|
|
||||||
- { os: windows-2019, ruby: debug }
|
- { os: windows-2019, ruby: debug }
|
||||||
- { os: windows-2019, ruby: truffleruby }
|
- { os: windows-2019, ruby: truffleruby }
|
||||||
- { os: windows-2019, ruby: truffleruby-head }
|
- { os: windows-2019, ruby: truffleruby-head }
|
||||||
- { os: windows-2019, ruby: truffleruby+graalvm }
|
- { os: windows-2019, ruby: truffleruby+graalvm }
|
||||||
- { os: windows-2019, ruby: truffleruby+graalvm-head }
|
- { os: windows-2019, ruby: truffleruby+graalvm-head }
|
||||||
|
- { os: windows-2022, ruby: 1.9 }
|
||||||
|
- { os: windows-2022, ruby: debug }
|
||||||
|
- { os: windows-2022, ruby: truffleruby }
|
||||||
|
- { os: windows-2022, ruby: truffleruby-head }
|
||||||
|
- { os: windows-2022, ruby: truffleruby+graalvm }
|
||||||
|
- { os: windows-2022, ruby: truffleruby+graalvm-head }
|
||||||
|
|
||||||
name: ${{ matrix.os }} ${{ matrix.ruby }}
|
name: ${{ matrix.os }} ${{ matrix.ruby }}
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
@@ -113,6 +112,39 @@ jobs:
|
|||||||
if: startsWith(matrix.os, 'windows') && startsWith(matrix.ruby, 'jruby')
|
if: startsWith(matrix.os, 'windows') && startsWith(matrix.ruby, 'jruby')
|
||||||
run: gem install sassc
|
run: gem install sassc
|
||||||
|
|
||||||
|
testLatestRubygemsVersion:
|
||||||
|
name: "Test rubygems input set to latest upgrades the default RubyGems version"
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- uses: ./
|
||||||
|
with:
|
||||||
|
ruby-version: 2.6
|
||||||
|
rubygems: latest
|
||||||
|
- run: ruby -e "exit(Gem.rubygems_version > Gem::Version.new('3.0.3'))"
|
||||||
|
|
||||||
|
testFixedRubygemsVersionUpgrades:
|
||||||
|
name: "Test rubygems input set to a fixed version upgrades RubyGems to that version if the default is older"
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- uses: ./
|
||||||
|
with:
|
||||||
|
ruby-version: 2.6
|
||||||
|
rubygems: 3.2.3
|
||||||
|
- run: gem --version | grep -F "3.2.3"
|
||||||
|
|
||||||
|
testFixedRubygemsVersionNoop:
|
||||||
|
name: "Test rubygems input set to a fixed version noops if the default is newer"
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- uses: ./
|
||||||
|
with:
|
||||||
|
ruby-version: 3.1
|
||||||
|
rubygems: 3.2.3
|
||||||
|
- run: gem --version | grep -F "3.3.3"
|
||||||
|
|
||||||
testExactBundlerVersion:
|
testExactBundlerVersion:
|
||||||
name: "Test with an exact Bundler version"
|
name: "Test with an exact Bundler version"
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|||||||
@@ -14,7 +14,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.1.0-preview1, head, debug, mingw, mswin |
|
| `ruby` | 1.9.3, 2.0.0, 2.1.9, 2.2, all versions from 2.3.0 until 3.1.0, head, debug, mingw, mswin |
|
||||||
| `jruby` | 9.1.17.0 - 9.3.2.0, head |
|
| `jruby` | 9.1.17.0 - 9.3.2.0, head |
|
||||||
| `truffleruby` | 19.3.0 - 21.3.0, head |
|
| `truffleruby` | 19.3.0 - 21.3.0, head |
|
||||||
| `truffleruby+graalvm` | 21.2.0 - 21.3.0, head |
|
| `truffleruby+graalvm` | 21.2.0 - 21.3.0, head |
|
||||||
@@ -41,7 +41,7 @@ The action works for all [GitHub-hosted runners](https://help.github.com/en/acti
|
|||||||
| ----------- | -------- | -------- |
|
| ----------- | -------- | -------- |
|
||||||
| Ubuntu | `ubuntu-latest` (= `ubuntu-20.04`) | `ubuntu-18.04`, `ubuntu-16.04` |
|
| Ubuntu | `ubuntu-latest` (= `ubuntu-20.04`) | `ubuntu-18.04`, `ubuntu-16.04` |
|
||||||
| macOS | `macos-latest` (= `macos-10.15`) | `macos-11.0` |
|
| macOS | `macos-latest` (= `macos-10.15`) | `macos-11.0` |
|
||||||
| Windows | `windows-latest` (= `windows-2019`) | `windows-2016` |
|
| Windows | `windows-latest` (= `windows-2019`) | `windows-2022` |
|
||||||
|
|
||||||
The prebuilt releases are generated by [ruby-builder](https://github.com/ruby/ruby-builder)
|
The prebuilt releases are generated by [ruby-builder](https://github.com/ruby/ruby-builder)
|
||||||
and on Windows by [RubyInstaller2](https://github.com/oneclick/rubyinstaller2).
|
and on Windows by [RubyInstaller2](https://github.com/oneclick/rubyinstaller2).
|
||||||
@@ -86,7 +86,7 @@ jobs:
|
|||||||
matrix:
|
matrix:
|
||||||
os: [ubuntu-latest, macos-latest]
|
os: [ubuntu-latest, macos-latest]
|
||||||
# Due to https://github.com/actions/runner/issues/849, we have to use quotes for '3.0'
|
# Due to https://github.com/actions/runner/issues/849, we have to use quotes for '3.0'
|
||||||
ruby: [2.5, 2.6, 2.7, '3.0', head, jruby, jruby-head, truffleruby, truffleruby-head]
|
ruby: [2.6, 2.7, '3.0', 3.1, head, jruby, jruby-head, truffleruby, truffleruby-head]
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
@@ -139,6 +139,18 @@ and the [condition and expression syntax](https://help.github.com/en/actions/ref
|
|||||||
The `working-directory` input can be set to resolve `.ruby-version`, `.tool-versions` and `Gemfile.lock`
|
The `working-directory` input can be set to resolve `.ruby-version`, `.tool-versions` and `Gemfile.lock`
|
||||||
if they are not at the root of the repository, see [action.yml](action.yml) for details.
|
if they are not at the root of the repository, see [action.yml](action.yml) for details.
|
||||||
|
|
||||||
|
### RubyGems
|
||||||
|
|
||||||
|
By default, the default RubyGems version that comes with each Ruby is used.
|
||||||
|
However, users can optionally customize the RubyGems version that they want by
|
||||||
|
setting the `rubygems` input.
|
||||||
|
|
||||||
|
See [action.yml](action.yml) for more details about the `rubygems` input.
|
||||||
|
|
||||||
|
If you're running into `ArgumentError: wrong number of arguments (given 4,
|
||||||
|
expected 1)` errors with a stacktrace including Psych and RubyGems entries, you
|
||||||
|
should be able to fix them by setting `rubygems: 3.0.0` or higher.
|
||||||
|
|
||||||
### Bundler
|
### Bundler
|
||||||
|
|
||||||
By default, if there is a `Gemfile.lock` file (or `$BUNDLE_GEMFILE.lock` or `gems.locked`) with a `BUNDLED WITH` section,
|
By default, if there is a `Gemfile.lock` file (or `$BUNDLE_GEMFILE.lock` or `gems.locked`) with a `BUNDLED WITH` section,
|
||||||
|
|||||||
@@ -9,6 +9,13 @@ inputs:
|
|||||||
description: 'Engine and version to use, see the syntax in the README. Reads from .ruby-version or .tool-versions if unset.'
|
description: 'Engine and version to use, see the syntax in the README. Reads from .ruby-version or .tool-versions if unset.'
|
||||||
required: false
|
required: false
|
||||||
default: 'default'
|
default: 'default'
|
||||||
|
rubygems:
|
||||||
|
description: |
|
||||||
|
The version of RubyGems to use. Either '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 RubyGems version.
|
||||||
|
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.
|
||||||
|
Defaults to 'default'.
|
||||||
bundler:
|
bundler:
|
||||||
description: |
|
description: |
|
||||||
The version of Bundler to install. Either 'none', 'latest', 'Gemfile.lock', or a version number (e.g., 1, 2, 2.1.4).
|
The version of Bundler to install. Either 'none', 'latest', 'Gemfile.lock', or a version number (e.g., 1, 2, 2.1.4).
|
||||||
|
|||||||
+3
-1
@@ -91,7 +91,9 @@ export async function installBundler(bundlerVersionInput, lockFile, platform, ru
|
|||||||
} else {
|
} else {
|
||||||
const gem = path.join(rubyPrefix, 'bin', 'gem')
|
const gem = path.join(rubyPrefix, 'bin', 'gem')
|
||||||
const bundlerVersionConstraint = /^\d+\.\d+\.\d+/.test(bundlerVersion) ? bundlerVersion : `~> ${bundlerVersion}`
|
const bundlerVersionConstraint = /^\d+\.\d+\.\d+/.test(bundlerVersion) ? bundlerVersion : `~> ${bundlerVersion}`
|
||||||
await exec.exec(gem, ['install', 'bundler', '-v', bundlerVersionConstraint])
|
// Workaround for https://github.com/rubygems/rubygems/issues/5245
|
||||||
|
const force = (platform.startsWith('windows-') && engine === 'ruby' && common.floatVersion(rubyVersion) >= 3.1) ? ['--force'] : []
|
||||||
|
await exec.exec(gem, ['install', 'bundler', ...force, '-v', bundlerVersionConstraint])
|
||||||
}
|
}
|
||||||
|
|
||||||
return bundlerVersion
|
return bundlerVersion
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ export async function measure(name, block) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function isHeadVersion(rubyVersion) {
|
export function isHeadVersion(rubyVersion) {
|
||||||
return rubyVersion === 'head' || rubyVersion === 'debug' || rubyVersion === 'mingw' || rubyVersion === 'mswin'
|
return ['head', 'debug', 'mingw', 'mswin', 'ucrt'].includes(rubyVersion)
|
||||||
}
|
}
|
||||||
|
|
||||||
export function isStableVersion(rubyVersion) {
|
export function isStableVersion(rubyVersion) {
|
||||||
@@ -155,7 +155,15 @@ export function win2nix(path) {
|
|||||||
return path.replace(/\\/g, '/').replace(/ /g, '\\ ')
|
return path.replace(/\\/g, '/').replace(/ /g, '\\ ')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// JRuby is installed after setupPath is called, so folder doesn't exist
|
||||||
|
function rubyIsUCRT(path) {
|
||||||
|
return !!(fs.existsSync(path) &&
|
||||||
|
fs.readdirSync(path, { withFileTypes: true }).find(dirent =>
|
||||||
|
dirent.isFile() && dirent.name.match(/^x64-ucrt-ruby\d{3}\.dll$/)))
|
||||||
|
}
|
||||||
|
|
||||||
export function setupPath(newPathEntries) {
|
export function setupPath(newPathEntries) {
|
||||||
|
let msys2Type = null
|
||||||
const envPath = windows ? 'Path' : 'PATH'
|
const envPath = windows ? 'Path' : 'PATH'
|
||||||
const originalPath = process.env[envPath].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))
|
||||||
@@ -176,8 +184,11 @@ export function setupPath(newPathEntries) {
|
|||||||
// Then add new path entries using core.addPath()
|
// Then add new path entries using core.addPath()
|
||||||
let newPath
|
let newPath
|
||||||
if (windows) {
|
if (windows) {
|
||||||
|
// main Ruby dll determines whether mingw or ucrt build
|
||||||
|
msys2Type = rubyIsUCRT(newPathEntries[0]) ? 'ucrt64' : 'mingw64'
|
||||||
|
|
||||||
// add MSYS2 in path for all Rubies on Windows, as it provides a better bash shell and a native toolchain
|
// add MSYS2 in path for all Rubies on Windows, as it provides a better bash shell and a native toolchain
|
||||||
const msys2 = ['C:\\msys64\\mingw64\\bin', 'C:\\msys64\\usr\\bin']
|
const msys2 = [`C:\\msys64\\${msys2Type}\\bin`, 'C:\\msys64\\usr\\bin']
|
||||||
newPath = [...newPathEntries, ...msys2]
|
newPath = [...newPathEntries, ...msys2]
|
||||||
} else {
|
} else {
|
||||||
newPath = newPathEntries
|
newPath = newPathEntries
|
||||||
@@ -189,4 +200,5 @@ export function setupPath(newPathEntries) {
|
|||||||
core.endGroup()
|
core.endGroup()
|
||||||
|
|
||||||
core.addPath(newPath.join(path.delimiter))
|
core.addPath(newPath.join(path.delimiter))
|
||||||
|
return msys2Type
|
||||||
}
|
}
|
||||||
|
|||||||
+232
-41
@@ -105,7 +105,9 @@ async function installBundler(bundlerVersionInput, lockFile, platform, rubyPrefi
|
|||||||
} else {
|
} else {
|
||||||
const gem = path.join(rubyPrefix, 'bin', 'gem')
|
const gem = path.join(rubyPrefix, 'bin', 'gem')
|
||||||
const bundlerVersionConstraint = /^\d+\.\d+\.\d+/.test(bundlerVersion) ? bundlerVersion : `~> ${bundlerVersion}`
|
const bundlerVersionConstraint = /^\d+\.\d+\.\d+/.test(bundlerVersion) ? bundlerVersion : `~> ${bundlerVersion}`
|
||||||
await exec.exec(gem, ['install', 'bundler', '-v', bundlerVersionConstraint])
|
// Workaround for https://github.com/rubygems/rubygems/issues/5245
|
||||||
|
const force = (platform.startsWith('windows-') && engine === 'ruby' && common.floatVersion(rubyVersion) >= 3.1) ? ['--force'] : []
|
||||||
|
await exec.exec(gem, ['install', 'bundler', ...force, '-v', bundlerVersionConstraint])
|
||||||
}
|
}
|
||||||
|
|
||||||
return bundlerVersion
|
return bundlerVersion
|
||||||
@@ -294,7 +296,7 @@ async function measure(name, block) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function isHeadVersion(rubyVersion) {
|
function isHeadVersion(rubyVersion) {
|
||||||
return rubyVersion === 'head' || rubyVersion === 'debug' || rubyVersion === 'mingw' || rubyVersion === 'mswin'
|
return ['head', 'debug', 'mingw', 'mswin', 'ucrt'].includes(rubyVersion)
|
||||||
}
|
}
|
||||||
|
|
||||||
function isStableVersion(rubyVersion) {
|
function isStableVersion(rubyVersion) {
|
||||||
@@ -401,7 +403,15 @@ function win2nix(path) {
|
|||||||
return path.replace(/\\/g, '/').replace(/ /g, '\\ ')
|
return path.replace(/\\/g, '/').replace(/ /g, '\\ ')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// JRuby is installed after setupPath is called, so folder doesn't exist
|
||||||
|
function rubyIsUCRT(path) {
|
||||||
|
return !!(fs.existsSync(path) &&
|
||||||
|
fs.readdirSync(path, { withFileTypes: true }).find(dirent =>
|
||||||
|
dirent.isFile() && dirent.name.match(/^x64-ucrt-ruby\d{3}\.dll$/)))
|
||||||
|
}
|
||||||
|
|
||||||
function setupPath(newPathEntries) {
|
function setupPath(newPathEntries) {
|
||||||
|
let msys2Type = null
|
||||||
const envPath = windows ? 'Path' : 'PATH'
|
const envPath = windows ? 'Path' : 'PATH'
|
||||||
const originalPath = process.env[envPath].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))
|
||||||
@@ -422,8 +432,11 @@ function setupPath(newPathEntries) {
|
|||||||
// Then add new path entries using core.addPath()
|
// Then add new path entries using core.addPath()
|
||||||
let newPath
|
let newPath
|
||||||
if (windows) {
|
if (windows) {
|
||||||
|
// main Ruby dll determines whether mingw or ucrt build
|
||||||
|
msys2Type = rubyIsUCRT(newPathEntries[0]) ? 'ucrt64' : 'mingw64'
|
||||||
|
|
||||||
// add MSYS2 in path for all Rubies on Windows, as it provides a better bash shell and a native toolchain
|
// add MSYS2 in path for all Rubies on Windows, as it provides a better bash shell and a native toolchain
|
||||||
const msys2 = ['C:\\msys64\\mingw64\\bin', 'C:\\msys64\\usr\\bin']
|
const msys2 = [`C:\\msys64\\${msys2Type}\\bin`, 'C:\\msys64\\usr\\bin']
|
||||||
newPath = [...newPathEntries, ...msys2]
|
newPath = [...newPathEntries, ...msys2]
|
||||||
} else {
|
} else {
|
||||||
newPath = newPathEntries
|
newPath = newPathEntries
|
||||||
@@ -435,6 +448,7 @@ function setupPath(newPathEntries) {
|
|||||||
core.endGroup()
|
core.endGroup()
|
||||||
|
|
||||||
core.addPath(newPath.join(path.delimiter))
|
core.addPath(newPath.join(path.delimiter))
|
||||||
|
return msys2Type
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -58788,7 +58802,7 @@ function getVersions(platform) {
|
|||||||
"2.6.0", "2.6.1", "2.6.2", "2.6.3", "2.6.4", "2.6.5", "2.6.6", "2.6.7", "2.6.8", "2.6.9",
|
"2.6.0", "2.6.1", "2.6.2", "2.6.3", "2.6.4", "2.6.5", "2.6.6", "2.6.7", "2.6.8", "2.6.9",
|
||||||
"2.7.0", "2.7.1", "2.7.2", "2.7.3", "2.7.4", "2.7.5",
|
"2.7.0", "2.7.1", "2.7.2", "2.7.3", "2.7.4", "2.7.5",
|
||||||
"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.0-preview1", "3.0.0-preview2", "3.0.0-rc1", "3.0.0", "3.0.1", "3.0.2", "3.0.3",
|
||||||
"3.1.0-preview1",
|
"3.1.0-preview1", "3.1.0",
|
||||||
"head", "debug"
|
"head", "debug"
|
||||||
],
|
],
|
||||||
"jruby": [
|
"jruby": [
|
||||||
@@ -58905,7 +58919,7 @@ async function downloadAndExtract(platform, engine, version, rubyPrefix) {
|
|||||||
return await tc.downloadTool(url)
|
return await tc.downloadTool(url)
|
||||||
})
|
})
|
||||||
|
|
||||||
await common.measure('Extracting Ruby', async () => {
|
await common.measure('Extracting Ruby', async () => {
|
||||||
if (windows) {
|
if (windows) {
|
||||||
// Windows 2016 doesn't have system tar, use MSYS2's, it needs unix style paths
|
// Windows 2016 doesn't have system tar, use MSYS2's, it needs unix style paths
|
||||||
await exec.exec('tar', ['-xz', '-C', common.win2nix(parentDir), '-f', common.win2nix(downloadPath)])
|
await exec.exec('tar', ['-xz', '-C', common.win2nix(parentDir), '-f', common.win2nix(downloadPath)])
|
||||||
@@ -58939,6 +58953,48 @@ function getLatestHeadBuildURL(platform, engine, version) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ 160:
|
||||||
|
/***/ ((__unused_webpack_module, __webpack_exports__, __nccwpck_require__) => {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
__nccwpck_require__.r(__webpack_exports__);
|
||||||
|
/* harmony export */ __nccwpck_require__.d(__webpack_exports__, {
|
||||||
|
/* harmony export */ "rubygemsUpdate": () => (/* binding */ rubygemsUpdate)
|
||||||
|
/* harmony export */ });
|
||||||
|
const path = __nccwpck_require__(5622)
|
||||||
|
const exec = __nccwpck_require__(1514)
|
||||||
|
const semver = __nccwpck_require__(5911)
|
||||||
|
|
||||||
|
async function rubygemsUpdate(rubygemsVersionInput, rubyPrefix) {
|
||||||
|
const gem = path.join(rubyPrefix, 'bin', 'gem')
|
||||||
|
|
||||||
|
let gemVersion = ''
|
||||||
|
|
||||||
|
await exec.exec(gem, ['--version'], {
|
||||||
|
listeners: {
|
||||||
|
stdout: (data) => (gemVersion += data.toString()),
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
gemVersion = semver.coerce(gemVersion.trim())
|
||||||
|
console.log(`Default RubyGems version is ${gemVersion}`)
|
||||||
|
|
||||||
|
if (rubygemsVersionInput === 'latest') {
|
||||||
|
console.log('Updating RubyGems to latest version')
|
||||||
|
await exec.exec(gem, ['update', '--system'])
|
||||||
|
} else if (semver.gt(rubygemsVersionInput, gemVersion)) {
|
||||||
|
console.log(`Updating RubyGems to ${rubygemsVersionInput}`)
|
||||||
|
await exec.exec(gem, ['update', '--system', rubygemsVersionInput])
|
||||||
|
} else {
|
||||||
|
console.log(`Skipping RubyGems update because the given version (${rubygemsVersionInput}) is not newer than the default version (${gemVersion})`)
|
||||||
|
}
|
||||||
|
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
||||||
/***/ 7223:
|
/***/ 7223:
|
||||||
@@ -58992,9 +59048,11 @@ const versions = {
|
|||||||
"3.0.1": "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-3.0.1-1/rubyinstaller-3.0.1-1-x64.7z",
|
"3.0.1": "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-3.0.1-1/rubyinstaller-3.0.1-1-x64.7z",
|
||||||
"3.0.2": "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-3.0.2-1/rubyinstaller-3.0.2-1-x64.7z",
|
"3.0.2": "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-3.0.2-1/rubyinstaller-3.0.2-1-x64.7z",
|
||||||
"3.0.3": "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-3.0.3-1/rubyinstaller-3.0.3-1-x64.7z",
|
"3.0.3": "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-3.0.3-1/rubyinstaller-3.0.3-1-x64.7z",
|
||||||
|
"3.1.0": "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-3.1.0-1/rubyinstaller-3.1.0-1-x64.7z",
|
||||||
"head": "https://github.com/oneclick/rubyinstaller2/releases/download/rubyinstaller-head/rubyinstaller-head-x64.7z",
|
"head": "https://github.com/oneclick/rubyinstaller2/releases/download/rubyinstaller-head/rubyinstaller-head-x64.7z",
|
||||||
"mingw": "https://github.com/MSP-Greg/ruby-loco/releases/download/ruby-master/ruby-mingw.7z",
|
"mingw": "https://github.com/MSP-Greg/ruby-loco/releases/download/ruby-master/ruby-mingw.7z",
|
||||||
"mswin": "https://github.com/MSP-Greg/ruby-loco/releases/download/ruby-master/ruby-mswin.7z"
|
"mswin": "https://github.com/MSP-Greg/ruby-loco/releases/download/ruby-master/ruby-mswin.7z",
|
||||||
|
"ucrt": "https://github.com/MSP-Greg/ruby-loco/releases/download/ruby-master/ruby-ucrt.7z"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -59008,6 +59066,7 @@ __nccwpck_require__.r(__webpack_exports__);
|
|||||||
/* harmony export */ __nccwpck_require__.d(__webpack_exports__, {
|
/* harmony export */ __nccwpck_require__.d(__webpack_exports__, {
|
||||||
/* harmony export */ "getAvailableVersions": () => (/* binding */ getAvailableVersions),
|
/* harmony export */ "getAvailableVersions": () => (/* binding */ getAvailableVersions),
|
||||||
/* harmony export */ "install": () => (/* binding */ install),
|
/* harmony export */ "install": () => (/* binding */ install),
|
||||||
|
/* harmony export */ "installJRubyTools": () => (/* binding */ installJRubyTools),
|
||||||
/* harmony export */ "addVCVARSEnv": () => (/* binding */ addVCVARSEnv)
|
/* harmony export */ "addVCVARSEnv": () => (/* binding */ addVCVARSEnv)
|
||||||
/* harmony export */ });
|
/* harmony export */ });
|
||||||
// Most of this logic is from
|
// Most of this logic is from
|
||||||
@@ -59025,12 +59084,16 @@ const rubyInstallerVersions = __nccwpck_require__(7223)/* .versions */ .d
|
|||||||
|
|
||||||
const drive = common.drive
|
const drive = common.drive
|
||||||
|
|
||||||
|
const msys2BasePath = 'C:\\msys64'
|
||||||
|
|
||||||
// needed for 2.0-2.3, and mswin, cert file used by Git for Windows
|
// needed for 2.0-2.3, and mswin, cert file used by Git for Windows
|
||||||
const certFile = 'C:\\Program Files\\Git\\mingw64\\ssl\\cert.pem'
|
const certFile = 'C:\\Program Files\\Git\\mingw64\\ssl\\cert.pem'
|
||||||
|
|
||||||
// location & path for old RubyInstaller DevKit (MSYS), Ruby 2.0-2.3
|
// location & path for old RubyInstaller DevKit (MSYS1), Ruby 2.0-2.3
|
||||||
const msys = `${drive}:\\DevKit64`
|
const msys1 = `${drive}:\\DevKit64`
|
||||||
const msysPathEntries = [`${msys}\\mingw\\x86_64-w64-mingw32\\bin`, `${msys}\\mingw\\bin`, `${msys}\\bin`]
|
const msysPathEntries = [`${msys1}\\mingw\\x86_64-w64-mingw32\\bin`, `${msys1}\\mingw\\bin`, `${msys1}\\bin`]
|
||||||
|
|
||||||
|
const virtualEnv = common.getVirtualEnvironmentName()
|
||||||
|
|
||||||
function getAvailableVersions(platform, engine) {
|
function getAvailableVersions(platform, engine) {
|
||||||
if (engine === 'ruby') {
|
if (engine === 'ruby') {
|
||||||
@@ -59043,6 +59106,10 @@ function getAvailableVersions(platform, engine) {
|
|||||||
async function install(platform, engine, version) {
|
async function install(platform, engine, version) {
|
||||||
const url = rubyInstallerVersions[version]
|
const url = rubyInstallerVersions[version]
|
||||||
|
|
||||||
|
// The windows-2016 and windows-2019 images have MSYS2 build tools (C:/msys64/usr)
|
||||||
|
// and MinGW build tools installed. The windows-2022 image has neither.
|
||||||
|
const hasMSYS2PreInstalled = ['windows-2019', 'windows-2016'].includes(virtualEnv)
|
||||||
|
|
||||||
if (!url.endsWith('.7z')) {
|
if (!url.endsWith('.7z')) {
|
||||||
throw new Error(`URL should end in .7z: ${url}`)
|
throw new Error(`URL should end in .7z: ${url}`)
|
||||||
}
|
}
|
||||||
@@ -59062,15 +59129,71 @@ async function install(platform, engine, version) {
|
|||||||
|
|
||||||
let toolchainPaths = (version === 'mswin') ? await setupMSWin() : await setupMingw(version)
|
let toolchainPaths = (version === 'mswin') ? await setupMSWin() : await setupMingw(version)
|
||||||
|
|
||||||
common.setupPath([`${rubyPrefix}\\bin`, ...toolchainPaths])
|
|
||||||
|
|
||||||
if (!inToolCache) {
|
if (!inToolCache) {
|
||||||
await downloadAndExtract(engine, version, url, base, rubyPrefix);
|
await downloadAndExtract(engine, version, url, base, rubyPrefix);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const msys2Type = common.setupPath([`${rubyPrefix}\\bin`, ...toolchainPaths])
|
||||||
|
|
||||||
|
// install msys2 tools for all Ruby versions, only install mingw or ucrt for Rubies >= 2.4
|
||||||
|
|
||||||
|
if (!hasMSYS2PreInstalled) {
|
||||||
|
await installMSYS2Tools()
|
||||||
|
}
|
||||||
|
|
||||||
|
// windows 2016 and 2019 need ucrt64 installed, 2022 and future images need
|
||||||
|
// ucrt64 or mingw64 installed, depending on Ruby version
|
||||||
|
if (((msys2Type === 'ucrt64') || !hasMSYS2PreInstalled) && common.floatVersion(version) >= 2.4) {
|
||||||
|
await installGCCTools(msys2Type)
|
||||||
|
}
|
||||||
|
|
||||||
|
const ridk = `${rubyPrefix}\\bin\\ridk.cmd`
|
||||||
|
if (fs.existsSync(ridk)) {
|
||||||
|
await common.measure('Adding ridk env variables', async () => addRidkEnv(ridk))
|
||||||
|
}
|
||||||
|
|
||||||
return rubyPrefix
|
return rubyPrefix
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Actions windows-2022 image does not contain any mingw or ucrt build tools. Install tools for it,
|
||||||
|
// 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`
|
||||||
|
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 }))
|
||||||
|
}
|
||||||
|
|
||||||
|
// Actions windows-2022 image does not contain any MSYS2 build tools. Install tools for it.
|
||||||
|
// 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`
|
||||||
|
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 })
|
||||||
|
|
||||||
|
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 }))
|
||||||
|
}
|
||||||
|
|
||||||
|
// Windows JRuby can install gems that require compile tools, only needed for
|
||||||
|
// windows-2022 and later images
|
||||||
|
async function installJRubyTools() {
|
||||||
|
await installMSYS2Tools()
|
||||||
|
await installGCCTools('mingw64')
|
||||||
|
}
|
||||||
|
|
||||||
async function downloadAndExtract(engine, version, url, base, rubyPrefix) {
|
async function downloadAndExtract(engine, version, url, base, rubyPrefix) {
|
||||||
const parentDir = path.dirname(rubyPrefix)
|
const parentDir = path.dirname(rubyPrefix)
|
||||||
|
|
||||||
@@ -59079,8 +59202,9 @@ async function downloadAndExtract(engine, version, url, base, rubyPrefix) {
|
|||||||
return await tc.downloadTool(url)
|
return await tc.downloadTool(url)
|
||||||
})
|
})
|
||||||
|
|
||||||
await common.measure('Extracting Ruby', async () =>
|
await common.measure('Extracting Ruby', async () =>
|
||||||
exec.exec('7z', ['x', downloadPath, `-xr!${base}\\share\\doc`, `-o${parentDir}`], { silent: true }))
|
// -bd disable progress indicator, -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)) {
|
if (base !== path.basename(rubyPrefix)) {
|
||||||
await io.mv(path.join(parentDir, base), rubyPrefix)
|
await io.mv(path.join(parentDir, base), rubyPrefix)
|
||||||
@@ -59094,23 +59218,29 @@ async function downloadAndExtract(engine, version, url, base, rubyPrefix) {
|
|||||||
async function setupMingw(version) {
|
async function setupMingw(version) {
|
||||||
core.exportVariable('MAKE', 'make.exe')
|
core.exportVariable('MAKE', 'make.exe')
|
||||||
|
|
||||||
|
// rename these to avoid confusion when Ruby is using OpenSSL 1.0.2.
|
||||||
|
// most current extconf files look for 1.1.x dll files first, which is the version of the renamed files
|
||||||
|
if (common.floatVersion(version) <= 2.4) {
|
||||||
|
renameSystem32Dlls()
|
||||||
|
}
|
||||||
|
|
||||||
if (common.floatVersion(version) <= 2.3) {
|
if (common.floatVersion(version) <= 2.3) {
|
||||||
core.exportVariable('SSL_CERT_FILE', certFile)
|
core.exportVariable('SSL_CERT_FILE', certFile)
|
||||||
await common.measure('Installing MSYS', async () => installMSYS(version))
|
await common.measure('Installing MSYS1', async () => installMSYS1(version))
|
||||||
return msysPathEntries
|
return msysPathEntries
|
||||||
} else {
|
} else {
|
||||||
return []
|
return []
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Ruby 2.0, 2.1, 2.2 and 2.3
|
// Ruby 2.0-2.3
|
||||||
async function installMSYS(version) {
|
async function installMSYS1(version) {
|
||||||
const url = 'https://github.com/oneclick/rubyinstaller/releases/download/devkit-4.7.2/DevKit-mingw64-64-4.7.2-20130224-1432-sfx.exe'
|
const url = 'https://github.com/oneclick/rubyinstaller/releases/download/devkit-4.7.2/DevKit-mingw64-64-4.7.2-20130224-1432-sfx.exe'
|
||||||
const downloadPath = await tc.downloadTool(url)
|
const downloadPath = await tc.downloadTool(url)
|
||||||
await exec.exec('7z', ['x', downloadPath, `-o${msys}`], { silent: true })
|
await exec.exec('7z', ['x', downloadPath, `-o${msys1}`], { silent: true })
|
||||||
|
|
||||||
// below are set in the old devkit.rb file ?
|
// below are set in the old devkit.rb file ?
|
||||||
core.exportVariable('RI_DEVKIT', msys)
|
core.exportVariable('RI_DEVKIT', msys1)
|
||||||
core.exportVariable('CC' , 'gcc')
|
core.exportVariable('CC' , 'gcc')
|
||||||
core.exportVariable('CXX', 'g++')
|
core.exportVariable('CXX', 'g++')
|
||||||
core.exportVariable('CPP', 'cpp')
|
core.exportVariable('CPP', 'cpp')
|
||||||
@@ -59138,9 +59268,22 @@ async function setupMSWin() {
|
|||||||
/* Sets MSVC environment for use in Actions
|
/* Sets MSVC environment for use in Actions
|
||||||
* allows steps to run without running vcvars*.bat, also for PowerShell
|
* allows steps to run without running vcvars*.bat, also for PowerShell
|
||||||
* adds a convenience VCVARS environment variable
|
* adds a convenience VCVARS environment variable
|
||||||
* this assumes a single Visual Studio version being available in the windows-latest image */
|
* this assumes a single Visual Studio version being available in the Windows images */
|
||||||
function addVCVARSEnv() {
|
function addVCVARSEnv() {
|
||||||
const vcVars = '"C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\VC\\Auxiliary\\Build\\vcvars64.bat"'
|
let vcVars = ''
|
||||||
|
switch (virtualEnv) {
|
||||||
|
case 'windows-2016':
|
||||||
|
vcVars = '"C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Enterprise\\VC\\Auxiliary\\Build\\vcvars64.bat"'
|
||||||
|
break
|
||||||
|
case 'windows-2019':
|
||||||
|
vcVars = '"C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\VC\\Auxiliary\\Build\\vcvars64.bat"'
|
||||||
|
break
|
||||||
|
case 'windows-2022':
|
||||||
|
vcVars = '"C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise\\VC\\Auxiliary\\Build\\vcvars64.bat"'
|
||||||
|
break
|
||||||
|
default:
|
||||||
|
throw new Error(`Unknown Windows Image: ${virtualEnv}`)
|
||||||
|
}
|
||||||
core.exportVariable('VCVARS', vcVars)
|
core.exportVariable('VCVARS', vcVars)
|
||||||
|
|
||||||
let newEnv = new Map()
|
let newEnv = new Map()
|
||||||
@@ -59166,6 +59309,38 @@ function addVCVARSEnv() {
|
|||||||
return newPathEntries
|
return newPathEntries
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ssl files cause issues with non RI2 Rubies (<2.4) and ruby/ruby's CI from build folder due to dll resolution
|
||||||
|
function renameSystem32Dlls() {
|
||||||
|
const sys32 = 'C:\\Windows\\System32\\'
|
||||||
|
const badFiles = [`${sys32}libcrypto-1_1-x64.dll`, `${sys32}libssl-1_1-x64.dll`]
|
||||||
|
const existing = badFiles.filter((dll) => fs.existsSync(dll))
|
||||||
|
if (existing.length > 0) {
|
||||||
|
console.log(`Renaming ${existing.join(' and ')} to avoid dll resolution conflicts on Ruby <= 2.4`)
|
||||||
|
existing.forEach(dll => fs.renameSync(dll, `${dll}_`))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Sets MSYS2 ENV variables set from running `ridk enable`
|
||||||
|
function addRidkEnv(ridk) {
|
||||||
|
let newEnv = new Map()
|
||||||
|
let cmd = `cmd.exe /c "${ridk} enable && set"`
|
||||||
|
let newSet = cp.execSync(cmd).toString().trim().split(/\r?\n/)
|
||||||
|
newSet = newSet.filter(line => /^\S+=\S+/.test(line))
|
||||||
|
newSet.forEach(s => {
|
||||||
|
let [k, v] = common.partition(s, '=')
|
||||||
|
newEnv.set(k, v)
|
||||||
|
})
|
||||||
|
|
||||||
|
for (let [k, v] of newEnv) {
|
||||||
|
if (process.env[k] !== v) {
|
||||||
|
if (!/^Path$/i.test(k)) {
|
||||||
|
console.log(`${k}=${v}`)
|
||||||
|
core.exportVariable(k, v)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
||||||
@@ -59197,7 +59372,7 @@ module.exports = JSON.parse('["ac","com.ac","edu.ac","gov.ac","net.ac","mil.ac",
|
|||||||
/***/ ((module) => {
|
/***/ ((module) => {
|
||||||
|
|
||||||
"use strict";
|
"use strict";
|
||||||
module.exports = require("assert");;
|
module.exports = require("assert");
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
||||||
@@ -59205,7 +59380,7 @@ module.exports = require("assert");;
|
|||||||
/***/ ((module) => {
|
/***/ ((module) => {
|
||||||
|
|
||||||
"use strict";
|
"use strict";
|
||||||
module.exports = require("buffer");;
|
module.exports = require("buffer");
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
||||||
@@ -59213,7 +59388,7 @@ module.exports = require("buffer");;
|
|||||||
/***/ ((module) => {
|
/***/ ((module) => {
|
||||||
|
|
||||||
"use strict";
|
"use strict";
|
||||||
module.exports = require("child_process");;
|
module.exports = require("child_process");
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
||||||
@@ -59221,7 +59396,7 @@ module.exports = require("child_process");;
|
|||||||
/***/ ((module) => {
|
/***/ ((module) => {
|
||||||
|
|
||||||
"use strict";
|
"use strict";
|
||||||
module.exports = require("crypto");;
|
module.exports = require("crypto");
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
||||||
@@ -59229,7 +59404,7 @@ module.exports = require("crypto");;
|
|||||||
/***/ ((module) => {
|
/***/ ((module) => {
|
||||||
|
|
||||||
"use strict";
|
"use strict";
|
||||||
module.exports = require("events");;
|
module.exports = require("events");
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
||||||
@@ -59237,7 +59412,7 @@ module.exports = require("events");;
|
|||||||
/***/ ((module) => {
|
/***/ ((module) => {
|
||||||
|
|
||||||
"use strict";
|
"use strict";
|
||||||
module.exports = require("fs");;
|
module.exports = require("fs");
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
||||||
@@ -59245,7 +59420,7 @@ module.exports = require("fs");;
|
|||||||
/***/ ((module) => {
|
/***/ ((module) => {
|
||||||
|
|
||||||
"use strict";
|
"use strict";
|
||||||
module.exports = require("http");;
|
module.exports = require("http");
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
||||||
@@ -59253,7 +59428,7 @@ module.exports = require("http");;
|
|||||||
/***/ ((module) => {
|
/***/ ((module) => {
|
||||||
|
|
||||||
"use strict";
|
"use strict";
|
||||||
module.exports = require("https");;
|
module.exports = require("https");
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
||||||
@@ -59261,7 +59436,7 @@ module.exports = require("https");;
|
|||||||
/***/ ((module) => {
|
/***/ ((module) => {
|
||||||
|
|
||||||
"use strict";
|
"use strict";
|
||||||
module.exports = require("net");;
|
module.exports = require("net");
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
||||||
@@ -59269,7 +59444,7 @@ module.exports = require("net");;
|
|||||||
/***/ ((module) => {
|
/***/ ((module) => {
|
||||||
|
|
||||||
"use strict";
|
"use strict";
|
||||||
module.exports = require("os");;
|
module.exports = require("os");
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
||||||
@@ -59277,7 +59452,7 @@ module.exports = require("os");;
|
|||||||
/***/ ((module) => {
|
/***/ ((module) => {
|
||||||
|
|
||||||
"use strict";
|
"use strict";
|
||||||
module.exports = require("path");;
|
module.exports = require("path");
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
||||||
@@ -59285,7 +59460,7 @@ module.exports = require("path");;
|
|||||||
/***/ ((module) => {
|
/***/ ((module) => {
|
||||||
|
|
||||||
"use strict";
|
"use strict";
|
||||||
module.exports = require("perf_hooks");;
|
module.exports = require("perf_hooks");
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
||||||
@@ -59293,7 +59468,7 @@ module.exports = require("perf_hooks");;
|
|||||||
/***/ ((module) => {
|
/***/ ((module) => {
|
||||||
|
|
||||||
"use strict";
|
"use strict";
|
||||||
module.exports = require("punycode");;
|
module.exports = require("punycode");
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
||||||
@@ -59301,7 +59476,7 @@ module.exports = require("punycode");;
|
|||||||
/***/ ((module) => {
|
/***/ ((module) => {
|
||||||
|
|
||||||
"use strict";
|
"use strict";
|
||||||
module.exports = require("stream");;
|
module.exports = require("stream");
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
||||||
@@ -59309,7 +59484,7 @@ module.exports = require("stream");;
|
|||||||
/***/ ((module) => {
|
/***/ ((module) => {
|
||||||
|
|
||||||
"use strict";
|
"use strict";
|
||||||
module.exports = require("string_decoder");;
|
module.exports = require("string_decoder");
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
||||||
@@ -59317,7 +59492,7 @@ module.exports = require("string_decoder");;
|
|||||||
/***/ ((module) => {
|
/***/ ((module) => {
|
||||||
|
|
||||||
"use strict";
|
"use strict";
|
||||||
module.exports = require("timers");;
|
module.exports = require("timers");
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
||||||
@@ -59325,7 +59500,7 @@ module.exports = require("timers");;
|
|||||||
/***/ ((module) => {
|
/***/ ((module) => {
|
||||||
|
|
||||||
"use strict";
|
"use strict";
|
||||||
module.exports = require("tls");;
|
module.exports = require("tls");
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
||||||
@@ -59333,7 +59508,7 @@ module.exports = require("tls");;
|
|||||||
/***/ ((module) => {
|
/***/ ((module) => {
|
||||||
|
|
||||||
"use strict";
|
"use strict";
|
||||||
module.exports = require("url");;
|
module.exports = require("url");
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
||||||
@@ -59341,7 +59516,7 @@ module.exports = require("url");;
|
|||||||
/***/ ((module) => {
|
/***/ ((module) => {
|
||||||
|
|
||||||
"use strict";
|
"use strict";
|
||||||
module.exports = require("util");;
|
module.exports = require("util");
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
||||||
@@ -59349,7 +59524,7 @@ module.exports = require("util");;
|
|||||||
/***/ ((module) => {
|
/***/ ((module) => {
|
||||||
|
|
||||||
"use strict";
|
"use strict";
|
||||||
module.exports = require("zlib");;
|
module.exports = require("zlib");
|
||||||
|
|
||||||
/***/ })
|
/***/ })
|
||||||
|
|
||||||
@@ -59416,7 +59591,9 @@ module.exports = require("zlib");;
|
|||||||
/******/
|
/******/
|
||||||
/******/ /* webpack/runtime/compat */
|
/******/ /* webpack/runtime/compat */
|
||||||
/******/
|
/******/
|
||||||
/******/ if (typeof __nccwpck_require__ !== 'undefined') __nccwpck_require__.ab = __dirname + "/";/************************************************************************/
|
/******/ if (typeof __nccwpck_require__ !== 'undefined') __nccwpck_require__.ab = __dirname + "/";
|
||||||
|
/******/
|
||||||
|
/************************************************************************/
|
||||||
var __webpack_exports__ = {};
|
var __webpack_exports__ = {};
|
||||||
// This entry need to be wrapped in an IIFE because it need to be in strict mode.
|
// This entry need to be wrapped in an IIFE because it need to be in strict mode.
|
||||||
(() => {
|
(() => {
|
||||||
@@ -59431,12 +59608,14 @@ const fs = __nccwpck_require__(5747)
|
|||||||
const path = __nccwpck_require__(5622)
|
const path = __nccwpck_require__(5622)
|
||||||
const core = __nccwpck_require__(2186)
|
const core = __nccwpck_require__(2186)
|
||||||
const common = __nccwpck_require__(4717)
|
const common = __nccwpck_require__(4717)
|
||||||
|
const rubygems = __nccwpck_require__(160)
|
||||||
const bundler = __nccwpck_require__(1641)
|
const bundler = __nccwpck_require__(1641)
|
||||||
|
|
||||||
const windows = common.windows
|
const windows = common.windows
|
||||||
|
|
||||||
const inputDefaults = {
|
const inputDefaults = {
|
||||||
'ruby-version': 'default',
|
'ruby-version': 'default',
|
||||||
|
'rubygems': 'default',
|
||||||
'bundler': 'default',
|
'bundler': 'default',
|
||||||
'bundler-cache': 'true',
|
'bundler-cache': 'true',
|
||||||
'working-directory': '.',
|
'working-directory': '.',
|
||||||
@@ -59479,8 +59658,20 @@ async function setupRuby(options = {}) {
|
|||||||
createGemRC(engine, version)
|
createGemRC(engine, version)
|
||||||
envPreInstall()
|
envPreInstall()
|
||||||
|
|
||||||
|
// JRuby can use compiled extension code, so make sure gcc exists.
|
||||||
|
// As of Jan-2022, JRuby compiles against msvcrt.
|
||||||
|
if (platform.startsWith('windows') && (engine === 'jruby') &&
|
||||||
|
!fs.existsSync('C:\\msys64\\mingw64\\bin\\gcc.exe')) {
|
||||||
|
await __nccwpck_require__(3216).installJRubyTools()
|
||||||
|
}
|
||||||
|
|
||||||
const rubyPrefix = await installer.install(platform, engine, version)
|
const rubyPrefix = await installer.install(platform, engine, version)
|
||||||
|
|
||||||
|
if (inputs['rubygems'] !== 'default') {
|
||||||
|
await common.measure('Updating RubyGems', async () =>
|
||||||
|
rubygems.rubygemsUpdate(inputs['rubygems'], rubyPrefix))
|
||||||
|
}
|
||||||
|
|
||||||
// When setup-ruby is used by other actions, this allows code in them to run
|
// When setup-ruby is used by other actions, this allows code in them to run
|
||||||
// before 'bundle install'. Installed dependencies may require additional
|
// before 'bundle install'. Installed dependencies may require additional
|
||||||
// libraries & headers, build tools, etc.
|
// libraries & headers, build tools, etc.
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ versions = entries.select { |entry|
|
|||||||
versions['head'] = 'https://github.com/oneclick/rubyinstaller2/releases/download/rubyinstaller-head/rubyinstaller-head-x64.7z'
|
versions['head'] = 'https://github.com/oneclick/rubyinstaller2/releases/download/rubyinstaller-head/rubyinstaller-head-x64.7z'
|
||||||
versions['mingw'] = 'https://github.com/MSP-Greg/ruby-loco/releases/download/ruby-master/ruby-mingw.7z'
|
versions['mingw'] = 'https://github.com/MSP-Greg/ruby-loco/releases/download/ruby-master/ruby-mingw.7z'
|
||||||
versions['mswin'] = 'https://github.com/MSP-Greg/ruby-loco/releases/download/ruby-master/ruby-mswin.7z'
|
versions['mswin'] = 'https://github.com/MSP-Greg/ruby-loco/releases/download/ruby-master/ruby-mswin.7z'
|
||||||
|
versions['ucrt'] = 'https://github.com/MSP-Greg/ruby-loco/releases/download/ruby-master/ruby-ucrt.7z'
|
||||||
|
|
||||||
js = "export const versions = #{JSON.pretty_generate(versions)}\n"
|
js = "export const versions = #{JSON.pretty_generate(versions)}\n"
|
||||||
File.binwrite 'windows-versions.js', js
|
File.binwrite 'windows-versions.js', js
|
||||||
|
|||||||
@@ -3,12 +3,14 @@ const fs = require('fs')
|
|||||||
const path = require('path')
|
const path = require('path')
|
||||||
const core = require('@actions/core')
|
const core = require('@actions/core')
|
||||||
const common = require('./common')
|
const common = require('./common')
|
||||||
|
const rubygems = require('./rubygems')
|
||||||
const bundler = require('./bundler')
|
const bundler = require('./bundler')
|
||||||
|
|
||||||
const windows = common.windows
|
const windows = common.windows
|
||||||
|
|
||||||
const inputDefaults = {
|
const inputDefaults = {
|
||||||
'ruby-version': 'default',
|
'ruby-version': 'default',
|
||||||
|
'rubygems': 'default',
|
||||||
'bundler': 'default',
|
'bundler': 'default',
|
||||||
'bundler-cache': 'true',
|
'bundler-cache': 'true',
|
||||||
'working-directory': '.',
|
'working-directory': '.',
|
||||||
@@ -51,8 +53,20 @@ export async function setupRuby(options = {}) {
|
|||||||
createGemRC(engine, version)
|
createGemRC(engine, version)
|
||||||
envPreInstall()
|
envPreInstall()
|
||||||
|
|
||||||
|
// JRuby can use compiled extension code, so make sure gcc exists.
|
||||||
|
// As of Jan-2022, JRuby compiles against msvcrt.
|
||||||
|
if (platform.startsWith('windows') && (engine === 'jruby') &&
|
||||||
|
!fs.existsSync('C:\\msys64\\mingw64\\bin\\gcc.exe')) {
|
||||||
|
await require('./windows').installJRubyTools()
|
||||||
|
}
|
||||||
|
|
||||||
const rubyPrefix = await installer.install(platform, engine, version)
|
const rubyPrefix = await installer.install(platform, engine, version)
|
||||||
|
|
||||||
|
if (inputs['rubygems'] !== 'default') {
|
||||||
|
await common.measure('Updating RubyGems', async () =>
|
||||||
|
rubygems.rubygemsUpdate(inputs['rubygems'], rubyPrefix))
|
||||||
|
}
|
||||||
|
|
||||||
// When setup-ruby is used by other actions, this allows code in them to run
|
// When setup-ruby is used by other actions, this allows code in them to run
|
||||||
// before 'bundle install'. Installed dependencies may require additional
|
// before 'bundle install'. Installed dependencies may require additional
|
||||||
// libraries & headers, build tools, etc.
|
// libraries & headers, build tools, etc.
|
||||||
|
|||||||
+3
-2
@@ -26,9 +26,10 @@
|
|||||||
"@actions/core": "^1.4.0",
|
"@actions/core": "^1.4.0",
|
||||||
"@actions/exec": "^1.1.0",
|
"@actions/exec": "^1.1.0",
|
||||||
"@actions/io": "^1.1.1",
|
"@actions/io": "^1.1.1",
|
||||||
"@actions/tool-cache": "^1.7.1"
|
"@actions/tool-cache": "^1.7.1",
|
||||||
|
"semver": "^6.1.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@vercel/ncc": "^0.28.6"
|
"@vercel/ncc": "^0.31.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ export function getVersions(platform) {
|
|||||||
"2.6.0", "2.6.1", "2.6.2", "2.6.3", "2.6.4", "2.6.5", "2.6.6", "2.6.7", "2.6.8", "2.6.9",
|
"2.6.0", "2.6.1", "2.6.2", "2.6.3", "2.6.4", "2.6.5", "2.6.6", "2.6.7", "2.6.8", "2.6.9",
|
||||||
"2.7.0", "2.7.1", "2.7.2", "2.7.3", "2.7.4", "2.7.5",
|
"2.7.0", "2.7.1", "2.7.2", "2.7.3", "2.7.4", "2.7.5",
|
||||||
"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.0-preview1", "3.0.0-preview2", "3.0.0-rc1", "3.0.0", "3.0.1", "3.0.2", "3.0.3",
|
||||||
"3.1.0-preview1",
|
"3.1.0-preview1", "3.1.0",
|
||||||
"head", "debug"
|
"head", "debug"
|
||||||
],
|
],
|
||||||
"jruby": [
|
"jruby": [
|
||||||
|
|||||||
+1
-1
@@ -79,7 +79,7 @@ async function downloadAndExtract(platform, engine, version, rubyPrefix) {
|
|||||||
return await tc.downloadTool(url)
|
return await tc.downloadTool(url)
|
||||||
})
|
})
|
||||||
|
|
||||||
await common.measure('Extracting Ruby', async () => {
|
await common.measure('Extracting Ruby', async () => {
|
||||||
if (windows) {
|
if (windows) {
|
||||||
// Windows 2016 doesn't have system tar, use MSYS2's, it needs unix style paths
|
// Windows 2016 doesn't have system tar, use MSYS2's, it needs unix style paths
|
||||||
await exec.exec('tar', ['-xz', '-C', common.win2nix(parentDir), '-f', common.win2nix(downloadPath)])
|
await exec.exec('tar', ['-xz', '-C', common.win2nix(parentDir), '-f', common.win2nix(downloadPath)])
|
||||||
|
|||||||
+30
@@ -0,0 +1,30 @@
|
|||||||
|
const path = require('path')
|
||||||
|
const exec = require('@actions/exec')
|
||||||
|
const semver = require('semver')
|
||||||
|
|
||||||
|
export async function rubygemsUpdate(rubygemsVersionInput, rubyPrefix) {
|
||||||
|
const gem = path.join(rubyPrefix, 'bin', 'gem')
|
||||||
|
|
||||||
|
let gemVersion = ''
|
||||||
|
|
||||||
|
await exec.exec(gem, ['--version'], {
|
||||||
|
listeners: {
|
||||||
|
stdout: (data) => (gemVersion += data.toString()),
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
gemVersion = semver.coerce(gemVersion.trim())
|
||||||
|
console.log(`Default RubyGems version is ${gemVersion}`)
|
||||||
|
|
||||||
|
if (rubygemsVersionInput === 'latest') {
|
||||||
|
console.log('Updating RubyGems to latest version')
|
||||||
|
await exec.exec(gem, ['update', '--system'])
|
||||||
|
} else if (semver.gt(rubygemsVersionInput, gemVersion)) {
|
||||||
|
console.log(`Updating RubyGems to ${rubygemsVersionInput}`)
|
||||||
|
await exec.exec(gem, ['update', '--system', rubygemsVersionInput])
|
||||||
|
} else {
|
||||||
|
console.log(`Skipping RubyGems update because the given version (${rubygemsVersionInput}) is not newer than the default version (${gemVersion})`)
|
||||||
|
}
|
||||||
|
|
||||||
|
return true
|
||||||
|
}
|
||||||
+3
-1
@@ -42,7 +42,9 @@ export const versions = {
|
|||||||
"3.0.1": "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-3.0.1-1/rubyinstaller-3.0.1-1-x64.7z",
|
"3.0.1": "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-3.0.1-1/rubyinstaller-3.0.1-1-x64.7z",
|
||||||
"3.0.2": "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-3.0.2-1/rubyinstaller-3.0.2-1-x64.7z",
|
"3.0.2": "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-3.0.2-1/rubyinstaller-3.0.2-1-x64.7z",
|
||||||
"3.0.3": "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-3.0.3-1/rubyinstaller-3.0.3-1-x64.7z",
|
"3.0.3": "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-3.0.3-1/rubyinstaller-3.0.3-1-x64.7z",
|
||||||
|
"3.1.0": "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-3.1.0-1/rubyinstaller-3.1.0-1-x64.7z",
|
||||||
"head": "https://github.com/oneclick/rubyinstaller2/releases/download/rubyinstaller-head/rubyinstaller-head-x64.7z",
|
"head": "https://github.com/oneclick/rubyinstaller2/releases/download/rubyinstaller-head/rubyinstaller-head-x64.7z",
|
||||||
"mingw": "https://github.com/MSP-Greg/ruby-loco/releases/download/ruby-master/ruby-mingw.7z",
|
"mingw": "https://github.com/MSP-Greg/ruby-loco/releases/download/ruby-master/ruby-mingw.7z",
|
||||||
"mswin": "https://github.com/MSP-Greg/ruby-loco/releases/download/ruby-master/ruby-mswin.7z"
|
"mswin": "https://github.com/MSP-Greg/ruby-loco/releases/download/ruby-master/ruby-mswin.7z",
|
||||||
|
"ucrt": "https://github.com/MSP-Greg/ruby-loco/releases/download/ruby-master/ruby-ucrt.7z"
|
||||||
}
|
}
|
||||||
|
|||||||
+130
-14
@@ -13,12 +13,16 @@ const rubyInstallerVersions = require('./windows-versions').versions
|
|||||||
|
|
||||||
const drive = common.drive
|
const drive = common.drive
|
||||||
|
|
||||||
|
const msys2BasePath = 'C:\\msys64'
|
||||||
|
|
||||||
// needed for 2.0-2.3, and mswin, cert file used by Git for Windows
|
// needed for 2.0-2.3, and mswin, cert file used by Git for Windows
|
||||||
const certFile = 'C:\\Program Files\\Git\\mingw64\\ssl\\cert.pem'
|
const certFile = 'C:\\Program Files\\Git\\mingw64\\ssl\\cert.pem'
|
||||||
|
|
||||||
// location & path for old RubyInstaller DevKit (MSYS), Ruby 2.0-2.3
|
// location & path for old RubyInstaller DevKit (MSYS1), Ruby 2.0-2.3
|
||||||
const msys = `${drive}:\\DevKit64`
|
const msys1 = `${drive}:\\DevKit64`
|
||||||
const msysPathEntries = [`${msys}\\mingw\\x86_64-w64-mingw32\\bin`, `${msys}\\mingw\\bin`, `${msys}\\bin`]
|
const msysPathEntries = [`${msys1}\\mingw\\x86_64-w64-mingw32\\bin`, `${msys1}\\mingw\\bin`, `${msys1}\\bin`]
|
||||||
|
|
||||||
|
const virtualEnv = common.getVirtualEnvironmentName()
|
||||||
|
|
||||||
export function getAvailableVersions(platform, engine) {
|
export function getAvailableVersions(platform, engine) {
|
||||||
if (engine === 'ruby') {
|
if (engine === 'ruby') {
|
||||||
@@ -31,6 +35,10 @@ export function getAvailableVersions(platform, engine) {
|
|||||||
export async function install(platform, engine, version) {
|
export async function install(platform, engine, version) {
|
||||||
const url = rubyInstallerVersions[version]
|
const url = rubyInstallerVersions[version]
|
||||||
|
|
||||||
|
// The windows-2016 and windows-2019 images have MSYS2 build tools (C:/msys64/usr)
|
||||||
|
// and MinGW build tools installed. The windows-2022 image has neither.
|
||||||
|
const hasMSYS2PreInstalled = ['windows-2019', 'windows-2016'].includes(virtualEnv)
|
||||||
|
|
||||||
if (!url.endsWith('.7z')) {
|
if (!url.endsWith('.7z')) {
|
||||||
throw new Error(`URL should end in .7z: ${url}`)
|
throw new Error(`URL should end in .7z: ${url}`)
|
||||||
}
|
}
|
||||||
@@ -50,15 +58,71 @@ export async function install(platform, engine, version) {
|
|||||||
|
|
||||||
let toolchainPaths = (version === 'mswin') ? await setupMSWin() : await setupMingw(version)
|
let toolchainPaths = (version === 'mswin') ? await setupMSWin() : await setupMingw(version)
|
||||||
|
|
||||||
common.setupPath([`${rubyPrefix}\\bin`, ...toolchainPaths])
|
|
||||||
|
|
||||||
if (!inToolCache) {
|
if (!inToolCache) {
|
||||||
await downloadAndExtract(engine, version, url, base, rubyPrefix);
|
await downloadAndExtract(engine, version, url, base, rubyPrefix);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const msys2Type = common.setupPath([`${rubyPrefix}\\bin`, ...toolchainPaths])
|
||||||
|
|
||||||
|
// install msys2 tools for all Ruby versions, only install mingw or ucrt for Rubies >= 2.4
|
||||||
|
|
||||||
|
if (!hasMSYS2PreInstalled) {
|
||||||
|
await installMSYS2Tools()
|
||||||
|
}
|
||||||
|
|
||||||
|
// windows 2016 and 2019 need ucrt64 installed, 2022 and future images need
|
||||||
|
// ucrt64 or mingw64 installed, depending on Ruby version
|
||||||
|
if (((msys2Type === 'ucrt64') || !hasMSYS2PreInstalled) && common.floatVersion(version) >= 2.4) {
|
||||||
|
await installGCCTools(msys2Type)
|
||||||
|
}
|
||||||
|
|
||||||
|
const ridk = `${rubyPrefix}\\bin\\ridk.cmd`
|
||||||
|
if (fs.existsSync(ridk)) {
|
||||||
|
await common.measure('Adding ridk env variables', async () => addRidkEnv(ridk))
|
||||||
|
}
|
||||||
|
|
||||||
return rubyPrefix
|
return rubyPrefix
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Actions windows-2022 image does not contain any mingw or ucrt build tools. Install tools for it,
|
||||||
|
// 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`
|
||||||
|
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 }))
|
||||||
|
}
|
||||||
|
|
||||||
|
// Actions windows-2022 image does not contain any MSYS2 build tools. Install tools for it.
|
||||||
|
// 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`
|
||||||
|
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 })
|
||||||
|
|
||||||
|
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 }))
|
||||||
|
}
|
||||||
|
|
||||||
|
// Windows JRuby can install gems that require compile tools, only needed for
|
||||||
|
// windows-2022 and later images
|
||||||
|
export async function installJRubyTools() {
|
||||||
|
await installMSYS2Tools()
|
||||||
|
await installGCCTools('mingw64')
|
||||||
|
}
|
||||||
|
|
||||||
async function downloadAndExtract(engine, version, url, base, rubyPrefix) {
|
async function downloadAndExtract(engine, version, url, base, rubyPrefix) {
|
||||||
const parentDir = path.dirname(rubyPrefix)
|
const parentDir = path.dirname(rubyPrefix)
|
||||||
|
|
||||||
@@ -67,8 +131,9 @@ async function downloadAndExtract(engine, version, url, base, rubyPrefix) {
|
|||||||
return await tc.downloadTool(url)
|
return await tc.downloadTool(url)
|
||||||
})
|
})
|
||||||
|
|
||||||
await common.measure('Extracting Ruby', async () =>
|
await common.measure('Extracting Ruby', async () =>
|
||||||
exec.exec('7z', ['x', downloadPath, `-xr!${base}\\share\\doc`, `-o${parentDir}`], { silent: true }))
|
// -bd disable progress indicator, -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)) {
|
if (base !== path.basename(rubyPrefix)) {
|
||||||
await io.mv(path.join(parentDir, base), rubyPrefix)
|
await io.mv(path.join(parentDir, base), rubyPrefix)
|
||||||
@@ -82,23 +147,29 @@ async function downloadAndExtract(engine, version, url, base, rubyPrefix) {
|
|||||||
async function setupMingw(version) {
|
async function setupMingw(version) {
|
||||||
core.exportVariable('MAKE', 'make.exe')
|
core.exportVariable('MAKE', 'make.exe')
|
||||||
|
|
||||||
|
// rename these to avoid confusion when Ruby is using OpenSSL 1.0.2.
|
||||||
|
// most current extconf files look for 1.1.x dll files first, which is the version of the renamed files
|
||||||
|
if (common.floatVersion(version) <= 2.4) {
|
||||||
|
renameSystem32Dlls()
|
||||||
|
}
|
||||||
|
|
||||||
if (common.floatVersion(version) <= 2.3) {
|
if (common.floatVersion(version) <= 2.3) {
|
||||||
core.exportVariable('SSL_CERT_FILE', certFile)
|
core.exportVariable('SSL_CERT_FILE', certFile)
|
||||||
await common.measure('Installing MSYS', async () => installMSYS(version))
|
await common.measure('Installing MSYS1', async () => installMSYS1(version))
|
||||||
return msysPathEntries
|
return msysPathEntries
|
||||||
} else {
|
} else {
|
||||||
return []
|
return []
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Ruby 2.0, 2.1, 2.2 and 2.3
|
// Ruby 2.0-2.3
|
||||||
async function installMSYS(version) {
|
async function installMSYS1(version) {
|
||||||
const url = 'https://github.com/oneclick/rubyinstaller/releases/download/devkit-4.7.2/DevKit-mingw64-64-4.7.2-20130224-1432-sfx.exe'
|
const url = 'https://github.com/oneclick/rubyinstaller/releases/download/devkit-4.7.2/DevKit-mingw64-64-4.7.2-20130224-1432-sfx.exe'
|
||||||
const downloadPath = await tc.downloadTool(url)
|
const downloadPath = await tc.downloadTool(url)
|
||||||
await exec.exec('7z', ['x', downloadPath, `-o${msys}`], { silent: true })
|
await exec.exec('7z', ['x', downloadPath, `-o${msys1}`], { silent: true })
|
||||||
|
|
||||||
// below are set in the old devkit.rb file ?
|
// below are set in the old devkit.rb file ?
|
||||||
core.exportVariable('RI_DEVKIT', msys)
|
core.exportVariable('RI_DEVKIT', msys1)
|
||||||
core.exportVariable('CC' , 'gcc')
|
core.exportVariable('CC' , 'gcc')
|
||||||
core.exportVariable('CXX', 'g++')
|
core.exportVariable('CXX', 'g++')
|
||||||
core.exportVariable('CPP', 'cpp')
|
core.exportVariable('CPP', 'cpp')
|
||||||
@@ -126,9 +197,22 @@ async function setupMSWin() {
|
|||||||
/* Sets MSVC environment for use in Actions
|
/* Sets MSVC environment for use in Actions
|
||||||
* allows steps to run without running vcvars*.bat, also for PowerShell
|
* allows steps to run without running vcvars*.bat, also for PowerShell
|
||||||
* adds a convenience VCVARS environment variable
|
* adds a convenience VCVARS environment variable
|
||||||
* this assumes a single Visual Studio version being available in the windows-latest image */
|
* this assumes a single Visual Studio version being available in the Windows images */
|
||||||
export function addVCVARSEnv() {
|
export function addVCVARSEnv() {
|
||||||
const vcVars = '"C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\VC\\Auxiliary\\Build\\vcvars64.bat"'
|
let vcVars = ''
|
||||||
|
switch (virtualEnv) {
|
||||||
|
case 'windows-2016':
|
||||||
|
vcVars = '"C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Enterprise\\VC\\Auxiliary\\Build\\vcvars64.bat"'
|
||||||
|
break
|
||||||
|
case 'windows-2019':
|
||||||
|
vcVars = '"C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\VC\\Auxiliary\\Build\\vcvars64.bat"'
|
||||||
|
break
|
||||||
|
case 'windows-2022':
|
||||||
|
vcVars = '"C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise\\VC\\Auxiliary\\Build\\vcvars64.bat"'
|
||||||
|
break
|
||||||
|
default:
|
||||||
|
throw new Error(`Unknown Windows Image: ${virtualEnv}`)
|
||||||
|
}
|
||||||
core.exportVariable('VCVARS', vcVars)
|
core.exportVariable('VCVARS', vcVars)
|
||||||
|
|
||||||
let newEnv = new Map()
|
let newEnv = new Map()
|
||||||
@@ -153,3 +237,35 @@ export function addVCVARSEnv() {
|
|||||||
}
|
}
|
||||||
return newPathEntries
|
return newPathEntries
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ssl files cause issues with non RI2 Rubies (<2.4) and ruby/ruby's CI from build folder due to dll resolution
|
||||||
|
function renameSystem32Dlls() {
|
||||||
|
const sys32 = 'C:\\Windows\\System32\\'
|
||||||
|
const badFiles = [`${sys32}libcrypto-1_1-x64.dll`, `${sys32}libssl-1_1-x64.dll`]
|
||||||
|
const existing = badFiles.filter((dll) => fs.existsSync(dll))
|
||||||
|
if (existing.length > 0) {
|
||||||
|
console.log(`Renaming ${existing.join(' and ')} to avoid dll resolution conflicts on Ruby <= 2.4`)
|
||||||
|
existing.forEach(dll => fs.renameSync(dll, `${dll}_`))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Sets MSYS2 ENV variables set from running `ridk enable`
|
||||||
|
function addRidkEnv(ridk) {
|
||||||
|
let newEnv = new Map()
|
||||||
|
let cmd = `cmd.exe /c "${ridk} enable && set"`
|
||||||
|
let newSet = cp.execSync(cmd).toString().trim().split(/\r?\n/)
|
||||||
|
newSet = newSet.filter(line => /^\S+=\S+/.test(line))
|
||||||
|
newSet.forEach(s => {
|
||||||
|
let [k, v] = common.partition(s, '=')
|
||||||
|
newEnv.set(k, v)
|
||||||
|
})
|
||||||
|
|
||||||
|
for (let [k, v] of newEnv) {
|
||||||
|
if (process.env[k] !== v) {
|
||||||
|
if (!/^Path$/i.test(k)) {
|
||||||
|
console.log(`${k}=${v}`)
|
||||||
|
core.exportVariable(k, v)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -195,10 +195,10 @@
|
|||||||
dependencies:
|
dependencies:
|
||||||
"@types/node" "*"
|
"@types/node" "*"
|
||||||
|
|
||||||
"@vercel/ncc@^0.28.6":
|
"@vercel/ncc@^0.31.1":
|
||||||
version "0.28.6"
|
version "0.31.1"
|
||||||
resolved "https://registry.yarnpkg.com/@vercel/ncc/-/ncc-0.28.6.tgz#073c0ce8e0269210c0a9f180fb0bf949eecc20e0"
|
resolved "https://registry.yarnpkg.com/@vercel/ncc/-/ncc-0.31.1.tgz#9346c7e59326f5eeac75c0286e47df94c2d6d8f7"
|
||||||
integrity sha512-t4BoSSuyK8BZaUE0gV18V6bkFs4st7baumtFGa50dv1tMu2GDBEBF8sUZaKBdKiL6DzJ2D2+XVCwYWWDcQOYdQ==
|
integrity sha512-g0FAxwdViI6UzsiVz5HssIHqjcPa1EHL6h+2dcJD893SoCJaGdqqgUF09xnMW6goWnnhbLvgiKlgJWrJa+7qYA==
|
||||||
|
|
||||||
abort-controller@^3.0.0:
|
abort-controller@^3.0.0:
|
||||||
version "3.0.0"
|
version "3.0.0"
|
||||||
|
|||||||
Reference in New Issue
Block a user