Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3c118cec41 | ||
|
|
96441ef64f | ||
|
|
6c1b312521 | ||
|
|
2e57bfa4c5 | ||
|
|
7b728b73d0 | ||
|
|
d114e80cc4 |
@@ -9,6 +9,9 @@ inputs:
|
|||||||
description: Version range or exact version of Elixir to use
|
description: Version range or exact version of Elixir to use
|
||||||
otp-version:
|
otp-version:
|
||||||
description: Version range or exact version of OTP to use
|
description: Version range or exact version of OTP to use
|
||||||
|
experimental-otp:
|
||||||
|
description: Whether to use experimental builds of OTP (images that have not yet been fully tested include ubuntu-16.04, ubuntu-18.04, ubuntu-20.04)
|
||||||
|
default: false
|
||||||
install-hex:
|
install-hex:
|
||||||
description: Whether to install Hex
|
description: Whether to install Hex
|
||||||
default: true
|
default: true
|
||||||
|
|||||||
24
dist/index.js
vendored
24
dist/index.js
vendored
@@ -2955,9 +2955,9 @@ async function installElixir(version, otpMajor) {
|
|||||||
*
|
*
|
||||||
* @param {string} version
|
* @param {string} version
|
||||||
*/
|
*/
|
||||||
async function installOTP(version) {
|
async function installOTP(version, osVersion) {
|
||||||
if (process.platform === 'linux') {
|
if (process.platform === 'linux') {
|
||||||
await exec(__webpack_require__.ab + "install-otp", [version])
|
await exec(__webpack_require__.ab + "install-otp", [version, osVersion])
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3324,11 +3324,16 @@ async function main() {
|
|||||||
|
|
||||||
let installHex = core.getInput('install-hex')
|
let installHex = core.getInput('install-hex')
|
||||||
installHex = installHex == null ? 'true' : installHex
|
installHex = installHex == null ? 'true' : installHex
|
||||||
|
|
||||||
let installRebar = core.getInput('install-rebar')
|
let installRebar = core.getInput('install-rebar')
|
||||||
installRebar = installRebar == null ? 'true' : installRebar
|
installRebar = installRebar == null ? 'true' : installRebar
|
||||||
|
|
||||||
console.log(`##[group]Installing OTP ${otpVersion}`)
|
const experimentalOTP = core.getInput('experimental-otp')
|
||||||
await installOTP(otpVersion)
|
const osVersion =
|
||||||
|
experimentalOTP === 'true' ? getRunnerOSVersion() : 'ubuntu-14.04'
|
||||||
|
|
||||||
|
console.log(`##[group]Installing OTP ${otpVersion} - built on ${osVersion}`)
|
||||||
|
await installOTP(otpVersion, osVersion)
|
||||||
console.log(`##[endgroup]`)
|
console.log(`##[endgroup]`)
|
||||||
|
|
||||||
console.log(`##[group]Installing Elixir ${elixirVersion}`)
|
console.log(`##[group]Installing Elixir ${elixirVersion}`)
|
||||||
@@ -3344,6 +3349,7 @@ async function main() {
|
|||||||
console.log(`##[add-matcher]${path.join(matchersPath, 'elixir.json')}`)
|
console.log(`##[add-matcher]${path.join(matchersPath, 'elixir.json')}`)
|
||||||
core.setOutput('otp-version', otpVersion)
|
core.setOutput('otp-version', otpVersion)
|
||||||
core.setOutput('elixir-version', elixirVersion)
|
core.setOutput('elixir-version', elixirVersion)
|
||||||
|
core.setOutput('osVersion', osVersion)
|
||||||
}
|
}
|
||||||
|
|
||||||
function checkPlatform() {
|
function checkPlatform() {
|
||||||
@@ -3357,6 +3363,16 @@ async function getOtpVersion(spec) {
|
|||||||
return getVersionFromSpec(spec, await getOtpVersions()) || spec
|
return getVersionFromSpec(spec, await getOtpVersions()) || spec
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getRunnerOSVersion(experimentalOTP) {
|
||||||
|
const mapToUbuntuVersion = {
|
||||||
|
ubuntu16: 'ubuntu-16.04',
|
||||||
|
ubuntu18: 'ubuntu-18.04',
|
||||||
|
ubuntu20: 'ubuntu-20.04',
|
||||||
|
}
|
||||||
|
|
||||||
|
return mapToUbuntuVersion[process.env.ImageOS] || 'ubuntu-18.04'
|
||||||
|
}
|
||||||
|
|
||||||
exports.getElixirVersion = getElixirVersion
|
exports.getElixirVersion = getElixirVersion
|
||||||
|
|
||||||
async function getElixirVersion(spec, otpVersion) {
|
async function getElixirVersion(spec, otpVersion) {
|
||||||
|
|||||||
2
dist/install-otp
vendored
2
dist/install-otp
vendored
@@ -4,7 +4,7 @@ set -eo pipefail
|
|||||||
|
|
||||||
cd $RUNNER_TEMP
|
cd $RUNNER_TEMP
|
||||||
|
|
||||||
wget -q -O otp.tar.gz https://repo.hex.pm/builds/otp/ubuntu-14.04/OTP-${1}.tar.gz
|
wget -q -O otp.tar.gz https://repo.hex.pm/builds/otp/${2}/OTP-${1}.tar.gz
|
||||||
mkdir -p .setup-elixir/otp
|
mkdir -p .setup-elixir/otp
|
||||||
tar zxf otp.tar.gz -C .setup-elixir/otp --strip-components=1
|
tar zxf otp.tar.gz -C .setup-elixir/otp --strip-components=1
|
||||||
rm otp.tar.gz
|
rm otp.tar.gz
|
||||||
|
|||||||
2
package-lock.json
generated
2
package-lock.json
generated
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "setup-elixir",
|
"name": "setup-elixir",
|
||||||
"version": "1.4.1",
|
"version": "1.5.0",
|
||||||
"lockfileVersion": 1,
|
"lockfileVersion": 1,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "setup-elixir",
|
"name": "setup-elixir",
|
||||||
"version": "1.4.1",
|
"version": "1.5.0",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ set -eo pipefail
|
|||||||
|
|
||||||
cd $RUNNER_TEMP
|
cd $RUNNER_TEMP
|
||||||
|
|
||||||
wget -q -O otp.tar.gz https://repo.hex.pm/builds/otp/ubuntu-14.04/OTP-${1}.tar.gz
|
wget -q -O otp.tar.gz https://repo.hex.pm/builds/otp/${2}/OTP-${1}.tar.gz
|
||||||
mkdir -p .setup-elixir/otp
|
mkdir -p .setup-elixir/otp
|
||||||
tar zxf otp.tar.gz -C .setup-elixir/otp --strip-components=1
|
tar zxf otp.tar.gz -C .setup-elixir/otp --strip-components=1
|
||||||
rm otp.tar.gz
|
rm otp.tar.gz
|
||||||
|
|||||||
@@ -22,9 +22,9 @@ async function installElixir(version, otpMajor) {
|
|||||||
*
|
*
|
||||||
* @param {string} version
|
* @param {string} version
|
||||||
*/
|
*/
|
||||||
async function installOTP(version) {
|
async function installOTP(version, osVersion) {
|
||||||
if (process.platform === 'linux') {
|
if (process.platform === 'linux') {
|
||||||
await exec(path.join(__dirname, 'install-otp'), [version])
|
await exec(path.join(__dirname, 'install-otp'), [version, osVersion])
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -26,11 +26,16 @@ async function main() {
|
|||||||
|
|
||||||
let installHex = core.getInput('install-hex')
|
let installHex = core.getInput('install-hex')
|
||||||
installHex = installHex == null ? 'true' : installHex
|
installHex = installHex == null ? 'true' : installHex
|
||||||
|
|
||||||
let installRebar = core.getInput('install-rebar')
|
let installRebar = core.getInput('install-rebar')
|
||||||
installRebar = installRebar == null ? 'true' : installRebar
|
installRebar = installRebar == null ? 'true' : installRebar
|
||||||
|
|
||||||
console.log(`##[group]Installing OTP ${otpVersion}`)
|
const experimentalOTP = core.getInput('experimental-otp')
|
||||||
await installOTP(otpVersion)
|
const osVersion =
|
||||||
|
experimentalOTP === 'true' ? getRunnerOSVersion() : 'ubuntu-14.04'
|
||||||
|
|
||||||
|
console.log(`##[group]Installing OTP ${otpVersion} - built on ${osVersion}`)
|
||||||
|
await installOTP(otpVersion, osVersion)
|
||||||
console.log(`##[endgroup]`)
|
console.log(`##[endgroup]`)
|
||||||
|
|
||||||
console.log(`##[group]Installing Elixir ${elixirVersion}`)
|
console.log(`##[group]Installing Elixir ${elixirVersion}`)
|
||||||
@@ -46,6 +51,7 @@ async function main() {
|
|||||||
console.log(`##[add-matcher]${path.join(matchersPath, 'elixir.json')}`)
|
console.log(`##[add-matcher]${path.join(matchersPath, 'elixir.json')}`)
|
||||||
core.setOutput('otp-version', otpVersion)
|
core.setOutput('otp-version', otpVersion)
|
||||||
core.setOutput('elixir-version', elixirVersion)
|
core.setOutput('elixir-version', elixirVersion)
|
||||||
|
core.setOutput('osVersion', osVersion)
|
||||||
}
|
}
|
||||||
|
|
||||||
function checkPlatform() {
|
function checkPlatform() {
|
||||||
@@ -59,6 +65,16 @@ async function getOtpVersion(spec) {
|
|||||||
return getVersionFromSpec(spec, await getOtpVersions()) || spec
|
return getVersionFromSpec(spec, await getOtpVersions()) || spec
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getRunnerOSVersion(experimentalOTP) {
|
||||||
|
const mapToUbuntuVersion = {
|
||||||
|
ubuntu16: 'ubuntu-16.04',
|
||||||
|
ubuntu18: 'ubuntu-18.04',
|
||||||
|
ubuntu20: 'ubuntu-20.04',
|
||||||
|
}
|
||||||
|
|
||||||
|
return mapToUbuntuVersion[process.env.ImageOS] || 'ubuntu-18.04'
|
||||||
|
}
|
||||||
|
|
||||||
exports.getElixirVersion = getElixirVersion
|
exports.getElixirVersion = getElixirVersion
|
||||||
|
|
||||||
async function getElixirVersion(spec, otpVersion) {
|
async function getElixirVersion(spec, otpVersion) {
|
||||||
|
|||||||
Reference in New Issue
Block a user