8 Commits
v1.4.2 ... main

Author SHA1 Message Date
Jonathan Clem
a0a26e4197 Update README.md
Some checks failed
Licensed / Check licenses (push) Has been cancelled
Test / Unit tests (push) Has been cancelled
Test / OTP 23.0 / Elixir 1.11.0-rc.0 (push) Has been cancelled
Test / OTP 22.0 / Elixir 1.9.1 (push) Has been cancelled
Test / OTP 21.x / Elixir <1.9.1 (push) Has been cancelled
Test / OTP 22.0 / Elixir master (push) Has been cancelled
2021-01-19 16:04:46 -05:00
Jonathan Clem
f8a9598f26 Merge pull request #52 from actions/jclem-patch-1
Update README.md to point to Erlang Ecosystem Foundation
2021-01-19 15:58:56 -05:00
Jonathan Clem
6cc722249e Update README.md to point to Erlang Ecosystem Foundation 2021-01-19 15:56:14 -05:00
Jonathan Clem
96441ef64f Merge pull request #46 from deniskulicek/parametrize-otp-os-version
Fetch OTP release based on ImageOS environment variable
2020-11-17 08:26:49 -05:00
Denis Kulicek
6c1b312521 Update action.yml description 2020-10-29 14:30:42 +01:00
Denis Kulicek
2e57bfa4c5 Update action.yml with experimental-otp input 2020-10-29 14:28:26 +01:00
Denis Kulicek
7b728b73d0 Add experimental-otp input opt-in flag 2020-10-29 14:27:52 +01:00
Denis Kulicek
d114e80cc4 Add osVersion parameter based on ImageOS env variable 2020-10-28 16:20:42 +01:00
7 changed files with 47 additions and 10 deletions

View File

@@ -1,5 +1,7 @@
# setup-elixir
**Please note: This repository is currently unmaintained by a team of developers at GitHub. It is now maintained by the [Erlang Ecosystem Foundation](https://erlef.org) at [erlef/setup-elixir](https://github.com/erlef/setup-elixir). Rather than using actions/setup-elixir, please begin referring to that action in your workflows, instead.**
[![](https://github.com/actions/setup-elixir/workflows/Test/badge.svg)](https://github.com/actions/setup-elixir/actions)
[![](https://github.com/actions/setup-elixir/workflows/Licensed/badge.svg)](https://github.com/actions/setup-elixir/actions)

View File

@@ -9,6 +9,9 @@ inputs:
description: Version range or exact version of Elixir to use
otp-version:
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:
description: Whether to install Hex
default: true

24
dist/index.js vendored
View File

@@ -2955,9 +2955,9 @@ async function installElixir(version, otpMajor) {
*
* @param {string} version
*/
async function installOTP(version) {
async function installOTP(version, osVersion) {
if (process.platform === 'linux') {
await exec(__webpack_require__.ab + "install-otp", [version])
await exec(__webpack_require__.ab + "install-otp", [version, osVersion])
return
}
@@ -3324,11 +3324,16 @@ async function main() {
let installHex = core.getInput('install-hex')
installHex = installHex == null ? 'true' : installHex
let installRebar = core.getInput('install-rebar')
installRebar = installRebar == null ? 'true' : installRebar
console.log(`##[group]Installing OTP ${otpVersion}`)
await installOTP(otpVersion)
const experimentalOTP = core.getInput('experimental-otp')
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(`##[group]Installing Elixir ${elixirVersion}`)
@@ -3344,6 +3349,7 @@ async function main() {
console.log(`##[add-matcher]${path.join(matchersPath, 'elixir.json')}`)
core.setOutput('otp-version', otpVersion)
core.setOutput('elixir-version', elixirVersion)
core.setOutput('osVersion', osVersion)
}
function checkPlatform() {
@@ -3357,6 +3363,16 @@ async function getOtpVersion(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
async function getElixirVersion(spec, otpVersion) {

2
dist/install-otp vendored
View File

@@ -4,7 +4,7 @@ set -eo pipefail
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
tar zxf otp.tar.gz -C .setup-elixir/otp --strip-components=1
rm otp.tar.gz

View File

@@ -4,7 +4,7 @@ set -eo pipefail
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
tar zxf otp.tar.gz -C .setup-elixir/otp --strip-components=1
rm otp.tar.gz

View File

@@ -22,9 +22,9 @@ async function installElixir(version, otpMajor) {
*
* @param {string} version
*/
async function installOTP(version) {
async function installOTP(version, osVersion) {
if (process.platform === 'linux') {
await exec(path.join(__dirname, 'install-otp'), [version])
await exec(path.join(__dirname, 'install-otp'), [version, osVersion])
return
}

View File

@@ -26,11 +26,16 @@ async function main() {
let installHex = core.getInput('install-hex')
installHex = installHex == null ? 'true' : installHex
let installRebar = core.getInput('install-rebar')
installRebar = installRebar == null ? 'true' : installRebar
console.log(`##[group]Installing OTP ${otpVersion}`)
await installOTP(otpVersion)
const experimentalOTP = core.getInput('experimental-otp')
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(`##[group]Installing Elixir ${elixirVersion}`)
@@ -46,6 +51,7 @@ async function main() {
console.log(`##[add-matcher]${path.join(matchersPath, 'elixir.json')}`)
core.setOutput('otp-version', otpVersion)
core.setOutput('elixir-version', elixirVersion)
core.setOutput('osVersion', osVersion)
}
function checkPlatform() {
@@ -59,6 +65,16 @@ async function getOtpVersion(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
async function getElixirVersion(spec, otpVersion) {