Add osVersion parameter based on ImageOS env variable
This commit is contained in:
@@ -23,14 +23,15 @@ async function main() {
|
||||
elixirSpec,
|
||||
otpVersion
|
||||
)
|
||||
const osVersion = getOSVersion()
|
||||
|
||||
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)
|
||||
console.log(`##[group]Installing OTP ${otpVersion} - built on ${osVersion}`)
|
||||
await installOTP(otpVersion, osVersion)
|
||||
console.log(`##[endgroup]`)
|
||||
|
||||
console.log(`##[group]Installing Elixir ${elixirVersion}`)
|
||||
@@ -46,6 +47,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 +61,16 @@ async function getOtpVersion(spec) {
|
||||
return getVersionFromSpec(spec, await getOtpVersions()) || spec
|
||||
}
|
||||
|
||||
function getOSVersion() {
|
||||
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) {
|
||||
|
||||
Reference in New Issue
Block a user