mirror of
https://github.com/ruby/setup-ruby.git
synced 2026-09-13 22:44:20 +02:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
da846ef6db | ||
|
|
1fe99df431 | ||
|
|
c28669c4da | ||
|
|
9f60be7c73 | ||
|
|
29eefdda13 |
@@ -0,0 +1,10 @@
|
|||||||
|
name: Update the v1 branch when a release is published
|
||||||
|
on:
|
||||||
|
release:
|
||||||
|
types: [published]
|
||||||
|
jobs:
|
||||||
|
release:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- run: git push origin HEAD:v1
|
||||||
@@ -9,7 +9,7 @@ on:
|
|||||||
paths-ignore:
|
paths-ignore:
|
||||||
- README.md
|
- README.md
|
||||||
jobs:
|
jobs:
|
||||||
common:
|
test:
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
@@ -78,7 +78,6 @@ jobs:
|
|||||||
echo ''
|
echo ''
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
lint:
|
lint:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
|
|||||||
@@ -134,6 +134,11 @@ This uses the [cache action](https://github.com/actions/cache).
|
|||||||
The code above is a more complete version of the [Ruby - Bundler example](https://github.com/actions/cache/blob/master/examples.md#ruby---bundler).
|
The code above is a more complete version of the [Ruby - Bundler example](https://github.com/actions/cache/blob/master/examples.md#ruby---bundler).
|
||||||
Make sure to include `use-ruby` in the `key` to avoid conflicting with previous caches.
|
Make sure to include `use-ruby` in the `key` to avoid conflicting with previous caches.
|
||||||
|
|
||||||
|
### Working Directory
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
## 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.
|
||||||
|
|||||||
+5
-1
@@ -6,13 +6,17 @@ branding:
|
|||||||
icon: download
|
icon: download
|
||||||
inputs:
|
inputs:
|
||||||
ruby-version:
|
ruby-version:
|
||||||
description: 'Engine and version to use, see the syntax in the README. Reads from .ruby-version 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'
|
||||||
bundler:
|
bundler:
|
||||||
description: 'The version of Bundler to install. Either none, 1, 2, latest or Gemfile.lock. The default tries Gemfile.lock and otherwise uses latest.'
|
description: 'The version of Bundler to install. Either none, 1, 2, latest or Gemfile.lock. The default tries Gemfile.lock and otherwise uses latest.'
|
||||||
required: false
|
required: false
|
||||||
default: 'default'
|
default: 'default'
|
||||||
|
working-directory:
|
||||||
|
description: 'The working directory to use for resolving paths for .ruby-version, .tool-versions and Gemfile.lock.'
|
||||||
|
required: false
|
||||||
|
default: '.'
|
||||||
outputs:
|
outputs:
|
||||||
ruby-prefix:
|
ruby-prefix:
|
||||||
description: 'The prefix of the installed ruby'
|
description: 'The prefix of the installed ruby'
|
||||||
|
|||||||
+31
-25
@@ -965,36 +965,42 @@ const common = __webpack_require__(239)
|
|||||||
|
|
||||||
async function run() {
|
async function run() {
|
||||||
try {
|
try {
|
||||||
const platform = common.getVirtualEnvironmentName()
|
await main()
|
||||||
const [engine, version] = parseRubyEngineAndVersion(core.getInput('ruby-version'))
|
|
||||||
|
|
||||||
let installer
|
|
||||||
if (platform === 'windows-latest' && engine !== 'jruby') {
|
|
||||||
installer = __webpack_require__(826)
|
|
||||||
} else {
|
|
||||||
installer = __webpack_require__(489)
|
|
||||||
}
|
|
||||||
|
|
||||||
const engineVersions = installer.getAvailableVersions(platform, engine)
|
|
||||||
const ruby = validateRubyEngineAndVersion(platform, engineVersions, engine, version)
|
|
||||||
|
|
||||||
createGemRC()
|
|
||||||
|
|
||||||
const [rubyPrefix, newPathEntries] = await installer.install(platform, ruby)
|
|
||||||
|
|
||||||
setupPath(ruby, newPathEntries)
|
|
||||||
|
|
||||||
if (core.getInput('bundler') !== 'none') {
|
|
||||||
await common.measure('Installing Bundler', async () =>
|
|
||||||
installBundler(platform, rubyPrefix, engine, version))
|
|
||||||
}
|
|
||||||
|
|
||||||
core.setOutput('ruby-prefix', rubyPrefix)
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
core.setFailed(error.message)
|
core.setFailed(error.message)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function main() {
|
||||||
|
process.chdir(core.getInput('working-directory'))
|
||||||
|
|
||||||
|
const platform = common.getVirtualEnvironmentName()
|
||||||
|
const [engine, version] = parseRubyEngineAndVersion(core.getInput('ruby-version'))
|
||||||
|
|
||||||
|
let installer
|
||||||
|
if (platform === 'windows-latest' && engine !== 'jruby') {
|
||||||
|
installer = __webpack_require__(826)
|
||||||
|
} else {
|
||||||
|
installer = __webpack_require__(489)
|
||||||
|
}
|
||||||
|
|
||||||
|
const engineVersions = installer.getAvailableVersions(platform, engine)
|
||||||
|
const ruby = validateRubyEngineAndVersion(platform, engineVersions, engine, version)
|
||||||
|
|
||||||
|
createGemRC()
|
||||||
|
|
||||||
|
const [rubyPrefix, newPathEntries] = await installer.install(platform, ruby)
|
||||||
|
|
||||||
|
setupPath(ruby, newPathEntries)
|
||||||
|
|
||||||
|
if (core.getInput('bundler') !== 'none') {
|
||||||
|
await common.measure('Installing Bundler', async () =>
|
||||||
|
installBundler(platform, rubyPrefix, engine, version))
|
||||||
|
}
|
||||||
|
|
||||||
|
core.setOutput('ruby-prefix', rubyPrefix)
|
||||||
|
}
|
||||||
|
|
||||||
function parseRubyEngineAndVersion(rubyVersion) {
|
function parseRubyEngineAndVersion(rubyVersion) {
|
||||||
if (rubyVersion === 'default') {
|
if (rubyVersion === 'default') {
|
||||||
if (fs.existsSync('.ruby-version')) {
|
if (fs.existsSync('.ruby-version')) {
|
||||||
|
|||||||
@@ -7,36 +7,42 @@ const common = require('./common')
|
|||||||
|
|
||||||
export async function run() {
|
export async function run() {
|
||||||
try {
|
try {
|
||||||
const platform = common.getVirtualEnvironmentName()
|
await main()
|
||||||
const [engine, version] = parseRubyEngineAndVersion(core.getInput('ruby-version'))
|
|
||||||
|
|
||||||
let installer
|
|
||||||
if (platform === 'windows-latest' && engine !== 'jruby') {
|
|
||||||
installer = require('./windows')
|
|
||||||
} else {
|
|
||||||
installer = require('./ruby-builder')
|
|
||||||
}
|
|
||||||
|
|
||||||
const engineVersions = installer.getAvailableVersions(platform, engine)
|
|
||||||
const ruby = validateRubyEngineAndVersion(platform, engineVersions, engine, version)
|
|
||||||
|
|
||||||
createGemRC()
|
|
||||||
|
|
||||||
const [rubyPrefix, newPathEntries] = await installer.install(platform, ruby)
|
|
||||||
|
|
||||||
setupPath(ruby, newPathEntries)
|
|
||||||
|
|
||||||
if (core.getInput('bundler') !== 'none') {
|
|
||||||
await common.measure('Installing Bundler', async () =>
|
|
||||||
installBundler(platform, rubyPrefix, engine, version))
|
|
||||||
}
|
|
||||||
|
|
||||||
core.setOutput('ruby-prefix', rubyPrefix)
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
core.setFailed(error.message)
|
core.setFailed(error.message)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function main() {
|
||||||
|
process.chdir(core.getInput('working-directory'))
|
||||||
|
|
||||||
|
const platform = common.getVirtualEnvironmentName()
|
||||||
|
const [engine, version] = parseRubyEngineAndVersion(core.getInput('ruby-version'))
|
||||||
|
|
||||||
|
let installer
|
||||||
|
if (platform === 'windows-latest' && engine !== 'jruby') {
|
||||||
|
installer = require('./windows')
|
||||||
|
} else {
|
||||||
|
installer = require('./ruby-builder')
|
||||||
|
}
|
||||||
|
|
||||||
|
const engineVersions = installer.getAvailableVersions(platform, engine)
|
||||||
|
const ruby = validateRubyEngineAndVersion(platform, engineVersions, engine, version)
|
||||||
|
|
||||||
|
createGemRC()
|
||||||
|
|
||||||
|
const [rubyPrefix, newPathEntries] = await installer.install(platform, ruby)
|
||||||
|
|
||||||
|
setupPath(ruby, newPathEntries)
|
||||||
|
|
||||||
|
if (core.getInput('bundler') !== 'none') {
|
||||||
|
await common.measure('Installing Bundler', async () =>
|
||||||
|
installBundler(platform, rubyPrefix, engine, version))
|
||||||
|
}
|
||||||
|
|
||||||
|
core.setOutput('ruby-prefix', rubyPrefix)
|
||||||
|
}
|
||||||
|
|
||||||
function parseRubyEngineAndVersion(rubyVersion) {
|
function parseRubyEngineAndVersion(rubyVersion) {
|
||||||
if (rubyVersion === 'default') {
|
if (rubyVersion === 'default') {
|
||||||
if (fs.existsSync('.ruby-version')) {
|
if (fs.existsSync('.ruby-version')) {
|
||||||
|
|||||||
Reference in New Issue
Block a user