Compare commits

..

1 Commits

Author SHA1 Message Date
Jonathan Clem 3c118cec41 v1.5.0 2020-11-17 08:29:07 -05:00
12 changed files with 56 additions and 685 deletions
+1 -3
View File
@@ -32,14 +32,12 @@ jobs:
# Branches # Branches
- otp-version: '22.0' - otp-version: '22.0'
elixir-version: master elixir-version: master
- otp-version: 'master'
elixir-version: '1.11.3'
# Pre-releases # Pre-releases
- otp-version: '23.0' - otp-version: '23.0'
elixir-version: '1.11.0-rc.0' elixir-version: '1.11.0-rc.0'
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: Use erlef/setup-elixir - name: Use actions/setup-elixir
id: setup-elixir id: setup-elixir
uses: ./ uses: ./
with: with:
+3 -3
View File
@@ -1,8 +1,8 @@
## Contributing ## Contributing
[fork]: https://github.com/erlef/setup-elixir/fork [fork]: https://github.com/actions/setup-elixir/fork
[pr]: https://github.com/erlef/setup-elixir/compare [pr]: https://github.com/actions/setup-elixir/compare
[code-of-conduct]: https://github.com/erlef/setup-elixir/blob/main/CODE_OF_CONDUCT.md [code-of-conduct]: https://github.com/actions/setup-elixir/blob/main/CODE_OF_CONDUCT.md
Hi there! We're thrilled that you'd like to contribute to this project. Your help is essential for keeping it great. Hi there! We're thrilled that you'd like to contribute to this project. Your help is essential for keeping it great.
+5 -5
View File
@@ -1,7 +1,7 @@
# setup-elixir # setup-elixir
[![](https://github.com/erlef/setup-elixir/workflows/Test/badge.svg)](https://github.com/erlef/setup-elixir/actions) [![](https://github.com/actions/setup-elixir/workflows/Test/badge.svg)](https://github.com/actions/setup-elixir/actions)
[![](https://github.com/erlef/setup-elixir/workflows/Licensed/badge.svg)](https://github.com/erlef/setup-elixir/actions) [![](https://github.com/actions/setup-elixir/workflows/Licensed/badge.svg)](https://github.com/actions/setup-elixir/actions)
This action sets up an Elixir environment for use in a GitHub Actions This action sets up an Elixir environment for use in a GitHub Actions
workflow by: workflow by:
@@ -39,7 +39,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- uses: erlef/setup-elixir@v1 - uses: actions/setup-elixir@v1
with: with:
otp-version: '22.2' otp-version: '22.2'
elixir-version: '1.9.4' elixir-version: '1.9.4'
@@ -62,7 +62,7 @@ jobs:
elixir: ['1.8.2', '1.9.4'] elixir: ['1.8.2', '1.9.4']
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- uses: erlef/setup-elixir@v1 - uses: actions/setup-elixir@v1
with: with:
otp-version: ${{matrix.otp}} otp-version: ${{matrix.otp}}
elixir-version: ${{matrix.elixir}} elixir-version: ${{matrix.elixir}}
@@ -93,7 +93,7 @@ jobs:
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- uses: erlef/setup-elixir@v1 - uses: actions/setup-elixir@v1
with: with:
otp-version: '22.2' otp-version: '22.2'
elixir-version: '1.9.4' elixir-version: '1.9.4'
+3
View File
@@ -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
+1 -3
View File
@@ -32,14 +32,12 @@ jobs:
# Branches # Branches
- otp-version: '22.0' - otp-version: '22.0'
elixir-version: master elixir-version: master
- otp-version: 'master'
elixir-version: '1.11.3'
# Pre-releases # Pre-releases
- otp-version: '23.0' - otp-version: '23.0'
elixir-version: '1.11.0-rc.0' elixir-version: '1.11.0-rc.0'
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: Use erlef/setup-elixir - name: Use actions/setup-elixir
id: setup-elixir id: setup-elixir
uses: ./ uses: ./
with: with:
+19 -21
View File
@@ -2961,7 +2961,9 @@ async function installOTP(version, osVersion) {
return return
} }
throw new Error('@erlef/setup-elixir only supports Ubuntu Linux at this time') throw new Error(
'@actions/setup-elixir only supports Ubuntu Linux at this time'
)
} }
@@ -3312,10 +3314,9 @@ main().catch(err => {
async function main() { async function main() {
checkPlatform() checkPlatform()
const osVersion = getRunnerOSVersion()
const otpSpec = core.getInput('otp-version', {required: true}) const otpSpec = core.getInput('otp-version', {required: true})
const elixirSpec = core.getInput('elixir-version', {required: true}) const elixirSpec = core.getInput('elixir-version', {required: true})
const otpVersion = await getOtpVersion(otpSpec, osVersion) const otpVersion = await getOtpVersion(otpSpec)
const [elixirVersion, otpMajor] = await getElixirVersion( const [elixirVersion, otpMajor] = await getElixirVersion(
elixirSpec, elixirSpec,
otpVersion otpVersion
@@ -3327,6 +3328,10 @@ async function main() {
let installRebar = core.getInput('install-rebar') let installRebar = core.getInput('install-rebar')
installRebar = installRebar == null ? 'true' : installRebar installRebar = installRebar == null ? 'true' : installRebar
const experimentalOTP = core.getInput('experimental-otp')
const osVersion =
experimentalOTP === 'true' ? getRunnerOSVersion() : 'ubuntu-14.04'
console.log(`##[group]Installing OTP ${otpVersion} - built on ${osVersion}`) console.log(`##[group]Installing OTP ${otpVersion} - built on ${osVersion}`)
await installOTP(otpVersion, osVersion) await installOTP(otpVersion, osVersion)
console.log(`##[endgroup]`) console.log(`##[endgroup]`)
@@ -3350,16 +3355,15 @@ async function main() {
function checkPlatform() { function checkPlatform() {
if (process.platform !== 'linux') if (process.platform !== 'linux')
throw new Error( throw new Error(
'@erlef/setup-elixir only supports Ubuntu Linux at this time' '@actions/setup-elixir only supports Ubuntu Linux at this time'
) )
} }
async function getOtpVersion(spec, osVersion) { async function getOtpVersion(spec) {
const version = getVersionFromSpec(spec, await getOtpVersions(osVersion)) return getVersionFromSpec(spec, await getOtpVersions()) || spec
return version ? `OTP-${version}` : spec
} }
function getRunnerOSVersion() { function getRunnerOSVersion(experimentalOTP) {
const mapToUbuntuVersion = { const mapToUbuntuVersion = {
ubuntu16: 'ubuntu-16.04', ubuntu16: 'ubuntu-16.04',
ubuntu18: 'ubuntu-18.04', ubuntu18: 'ubuntu-18.04',
@@ -3381,10 +3385,10 @@ async function getElixirVersion(spec, otpVersion) {
const version = getVersionFromSpec(spec, semverVersions) const version = getVersionFromSpec(spec, semverVersions)
const gitRef = version ? `v${version}` : spec const gitRef = version ? `v${version}` : spec
const otpMatch = otpVersion.match(/^OTP-([\.\d]+)/) const [otpMajor] = otpVersion.match(/^\d+/)
if (otpMatch != null && versions.get(gitRef).includes(otpMatch[0])) { if (versions.get(gitRef).includes(otpMajor)) {
return [gitRef, otpMatch[0]] return [gitRef, otpMajor]
} else { } else {
return [gitRef, null] return [gitRef, null]
} }
@@ -3399,23 +3403,17 @@ function getVersionFromSpec(spec, versions) {
} }
} }
async function getOtpVersions(osVersion) { async function getOtpVersions() {
const result = await get( const result = await get(
`https://repo.hex.pm/builds/otp/${osVersion}/builds.txt` 'https://raw.githubusercontent.com/erlang/otp/master/otp_versions.table'
) )
return result return result
.trim() .trim()
.split('\n') .split('\n')
.map(line => { .map(line => {
const match = line.match(/^OTP-([\.\d]+)/) const [_, version] = line.match(/^OTP-([\.\d]+)/)
return version
if (match) {
const [_, version] = match
return version
} else {
return line
}
}) })
} }
+1 -1
View File
@@ -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/${2}/${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 -626
View File
@@ -1,632 +1,8 @@
{ {
"name": "setup-elixir", "name": "setup-elixir",
"version": "1.6.0", "version": "1.5.0",
"lockfileVersion": 2, "lockfileVersion": 1,
"requires": true, "requires": true,
"packages": {
"": {
"version": "1.4.1",
"license": "MIT",
"dependencies": {
"@actions/core": "^1.0.0",
"@actions/exec": "^1.0.0",
"@actions/tool-cache": "^1.1.0",
"semver": "^6.3.0"
},
"devDependencies": {
"@zeit/ncc": "^0.22.1",
"husky": "^4.2.5",
"prettier": "^2.0.5"
}
},
"node_modules/@actions/core": {
"version": "1.2.6",
"resolved": "https://registry.npmjs.org/@actions/core/-/core-1.2.6.tgz",
"integrity": "sha512-ZQYitnqiyBc3D+k7LsgSBmMDVkOVidaagDG7j3fOym77jNunWRuYx7VSHa9GNfFZh+zh61xsCjRj4JxMZlDqTA=="
},
"node_modules/@actions/exec": {
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/@actions/exec/-/exec-1.0.4.tgz",
"integrity": "sha512-4DPChWow9yc9W3WqEbUj8Nr86xkpyE29ZzWjXucHItclLbEW6jr80Zx4nqv18QL6KK65+cifiQZXvnqgTV6oHw==",
"dependencies": {
"@actions/io": "^1.0.1"
}
},
"node_modules/@actions/exec/node_modules/@actions/io": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/@actions/io/-/io-1.0.2.tgz",
"integrity": "sha512-J8KuFqVPr3p6U8W93DOXlXW6zFvrQAJANdS+vw0YhusLIq+bszW8zmK2Fh1C2kDPX8FMvwIl1OUcFgvJoXLbAg=="
},
"node_modules/@actions/io": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/@actions/io/-/io-1.0.0.tgz",
"integrity": "sha512-ezrJSRdqtXtdx1WXlfYL85+40F7gB39jCK9P0jZVODW3W6xUYmu6ZOEc/UmmElUwhRyDRm1R4yNZu1Joq2kuQg=="
},
"node_modules/@actions/tool-cache": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/@actions/tool-cache/-/tool-cache-1.1.0.tgz",
"integrity": "sha512-Oe/R1Gxv0G699OUL9ypxk9cTwHf1uXHhpcK7kpZt8d/Sbw915ktMkfxXt9+awOfLDwyl54sLi86KGCuSvnRuIQ==",
"dependencies": {
"@actions/core": "^1.0.0",
"@actions/exec": "^1.0.0",
"@actions/io": "^1.0.0",
"semver": "^6.1.0",
"typed-rest-client": "^1.4.0",
"uuid": "^3.3.2"
}
},
"node_modules/@actions/tool-cache/node_modules/@actions/core": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/@actions/core/-/core-1.0.0.tgz",
"integrity": "sha512-aMIlkx96XH4E/2YZtEOeyrYQfhlas9jIRkfGPqMwXD095Rdkzo4lB6ZmbxPQSzD+e1M+Xsm98ZhuSMYGv/AlqA=="
},
"node_modules/@actions/tool-cache/node_modules/@actions/exec": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/@actions/exec/-/exec-1.0.0.tgz",
"integrity": "sha512-nquH0+XKng+Ll7rZfCojN7NWSbnGh+ltwUJhzfbLkmOJgxocGX2/yXcZLMyT9fa7+tByEow/NSTrBExNlEj9fw=="
},
"node_modules/@actions/tool-cache/node_modules/semver": {
"version": "6.3.0",
"resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz",
"integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==",
"bin": {
"semver": "bin/semver.js"
}
},
"node_modules/@babel/code-frame": {
"version": "7.8.3",
"resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.8.3.tgz",
"integrity": "sha512-a9gxpmdXtZEInkCSHUJDLHZVBgb1QS0jhss4cPP93EW7s+uC5bikET2twEF3KV+7rDblJcmNvTR7VJejqd2C2g==",
"dev": true,
"dependencies": {
"@babel/highlight": "^7.8.3"
}
},
"node_modules/@babel/helper-validator-identifier": {
"version": "7.9.5",
"resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.9.5.tgz",
"integrity": "sha512-/8arLKUFq882w4tWGj9JYzRpAlZgiWUJ+dtteNTDqrRBz9Iguck9Rn3ykuBDoUwh2TO4tSAJlrxDUOXWklJe4g==",
"dev": true
},
"node_modules/@babel/highlight": {
"version": "7.9.0",
"resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.9.0.tgz",
"integrity": "sha512-lJZPilxX7Op3Nv/2cvFdnlepPXDxi29wxteT57Q965oc5R9v86ztx0jfxVrTcBk8C2kcPkkDa2Z4T3ZsPPVWsQ==",
"dev": true,
"dependencies": {
"@babel/helper-validator-identifier": "^7.9.0",
"chalk": "^2.0.0",
"js-tokens": "^4.0.0"
}
},
"node_modules/@babel/highlight/node_modules/ansi-styles": {
"version": "3.2.1",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz",
"integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==",
"dev": true,
"dependencies": {
"color-convert": "^1.9.0"
},
"engines": {
"node": ">=4"
}
},
"node_modules/@babel/highlight/node_modules/chalk": {
"version": "2.4.2",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz",
"integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==",
"dev": true,
"dependencies": {
"ansi-styles": "^3.2.1",
"escape-string-regexp": "^1.0.5",
"supports-color": "^5.3.0"
},
"engines": {
"node": ">=4"
}
},
"node_modules/@babel/highlight/node_modules/color-convert": {
"version": "1.9.3",
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz",
"integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==",
"dev": true,
"dependencies": {
"color-name": "1.1.3"
}
},
"node_modules/@babel/highlight/node_modules/color-name": {
"version": "1.1.3",
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz",
"integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=",
"dev": true
},
"node_modules/@babel/highlight/node_modules/has-flag": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz",
"integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=",
"dev": true,
"engines": {
"node": ">=4"
}
},
"node_modules/@babel/highlight/node_modules/supports-color": {
"version": "5.5.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz",
"integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==",
"dev": true,
"dependencies": {
"has-flag": "^3.0.0"
},
"engines": {
"node": ">=4"
}
},
"node_modules/@babel/runtime": {
"version": "7.9.6",
"resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.9.6.tgz",
"integrity": "sha512-64AF1xY3OAkFHqOb9s4jpgk1Mm5vDZ4L3acHvAml+53nO1XbXLuDodsVpO4OIUsmemlUHMxNdYMNJmsvOwLrvQ==",
"dev": true,
"dependencies": {
"regenerator-runtime": "^0.13.4"
}
},
"node_modules/@types/color-name": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/@types/color-name/-/color-name-1.1.1.tgz",
"integrity": "sha512-rr+OQyAjxze7GgWrSaJwydHStIhHq2lvY3BOC2Mj7KnzI7XK0Uw1TOOdI9lDoajEbSWLiYgoo4f1R51erQfhPQ==",
"dev": true
},
"node_modules/@types/parse-json": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/@types/parse-json/-/parse-json-4.0.0.tgz",
"integrity": "sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA==",
"dev": true
},
"node_modules/@zeit/ncc": {
"version": "0.22.1",
"resolved": "https://registry.npmjs.org/@zeit/ncc/-/ncc-0.22.1.tgz",
"integrity": "sha512-Qq3bMuonkcnV/96jhy9SQYdh39NXHxNMJ1O31ZFzWG9n52fR2DLtgrNzhj/ahlEjnBziMLGVWDbaS9sf03/fEw==",
"dev": true,
"bin": {
"ncc": "dist/ncc/cli.js"
}
},
"node_modules/ansi-styles": {
"version": "4.2.1",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.1.tgz",
"integrity": "sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA==",
"dev": true,
"dependencies": {
"@types/color-name": "^1.1.1",
"color-convert": "^2.0.1"
},
"engines": {
"node": ">=8"
}
},
"node_modules/callsites": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz",
"integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==",
"dev": true,
"engines": {
"node": ">=6"
}
},
"node_modules/chalk": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-4.0.0.tgz",
"integrity": "sha512-N9oWFcegS0sFr9oh1oz2d7Npos6vNoWW9HvtCg5N1KRFpUhaAhvTv5Y58g880fZaEYSNm3qDz8SU1UrGvp+n7A==",
"dev": true,
"dependencies": {
"ansi-styles": "^4.1.0",
"supports-color": "^7.1.0"
},
"engines": {
"node": ">=10"
}
},
"node_modules/ci-info": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/ci-info/-/ci-info-2.0.0.tgz",
"integrity": "sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ==",
"dev": true
},
"node_modules/color-convert": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
"integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
"dev": true,
"dependencies": {
"color-name": "~1.1.4"
},
"engines": {
"node": ">=7.0.0"
}
},
"node_modules/color-name": {
"version": "1.1.4",
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
"dev": true
},
"node_modules/compare-versions": {
"version": "3.6.0",
"resolved": "https://registry.npmjs.org/compare-versions/-/compare-versions-3.6.0.tgz",
"integrity": "sha512-W6Af2Iw1z4CB7q4uU4hv646dW9GQuBM+YpC0UvUCWSD8w90SJjp+ujJuXaEMtAXBtSqGfMPuFOVn4/+FlaqfBA==",
"dev": true
},
"node_modules/cosmiconfig": {
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-6.0.0.tgz",
"integrity": "sha512-xb3ZL6+L8b9JLLCx3ZdoZy4+2ECphCMo2PwqgP1tlfVq6M6YReyzBJtvWWtbDSpNr9hn96pkCiZqUcFEc+54Qg==",
"dev": true,
"dependencies": {
"@types/parse-json": "^4.0.0",
"import-fresh": "^3.1.0",
"parse-json": "^5.0.0",
"path-type": "^4.0.0",
"yaml": "^1.7.2"
},
"engines": {
"node": ">=8"
}
},
"node_modules/error-ex": {
"version": "1.3.2",
"resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz",
"integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==",
"dev": true,
"dependencies": {
"is-arrayish": "^0.2.1"
}
},
"node_modules/escape-string-regexp": {
"version": "1.0.5",
"resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz",
"integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=",
"dev": true,
"engines": {
"node": ">=0.8.0"
}
},
"node_modules/find-up": {
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz",
"integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==",
"dev": true,
"dependencies": {
"locate-path": "^5.0.0",
"path-exists": "^4.0.0"
},
"engines": {
"node": ">=8"
}
},
"node_modules/find-versions": {
"version": "3.2.0",
"resolved": "https://registry.npmjs.org/find-versions/-/find-versions-3.2.0.tgz",
"integrity": "sha512-P8WRou2S+oe222TOCHitLy8zj+SIsVJh52VP4lvXkaFVnOFFdoWv1H1Jjvel1aI6NCFOAaeAVm8qrI0odiLcww==",
"dev": true,
"dependencies": {
"semver-regex": "^2.0.0"
},
"engines": {
"node": ">=6"
}
},
"node_modules/has-flag": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",
"integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
"dev": true,
"engines": {
"node": ">=8"
}
},
"node_modules/husky": {
"version": "4.2.5",
"resolved": "https://registry.npmjs.org/husky/-/husky-4.2.5.tgz",
"integrity": "sha512-SYZ95AjKcX7goYVZtVZF2i6XiZcHknw50iXvY7b0MiGoj5RwdgRQNEHdb+gPDPCXKlzwrybjFjkL6FOj8uRhZQ==",
"dev": true,
"hasInstallScript": true,
"dependencies": {
"chalk": "^4.0.0",
"ci-info": "^2.0.0",
"compare-versions": "^3.6.0",
"cosmiconfig": "^6.0.0",
"find-versions": "^3.2.0",
"opencollective-postinstall": "^2.0.2",
"pkg-dir": "^4.2.0",
"please-upgrade-node": "^3.2.0",
"slash": "^3.0.0",
"which-pm-runs": "^1.0.0"
},
"bin": {
"husky-run": "bin/run.js",
"husky-upgrade": "lib/upgrader/bin.js"
},
"engines": {
"node": ">=10"
}
},
"node_modules/import-fresh": {
"version": "3.2.1",
"resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.2.1.tgz",
"integrity": "sha512-6e1q1cnWP2RXD9/keSkxHScg508CdXqXWgWBaETNhyuBFz+kUZlKboh+ISK+bU++DmbHimVBrOz/zzPe0sZ3sQ==",
"dev": true,
"dependencies": {
"parent-module": "^1.0.0",
"resolve-from": "^4.0.0"
},
"engines": {
"node": ">=6"
}
},
"node_modules/is-arrayish": {
"version": "0.2.1",
"resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz",
"integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=",
"dev": true
},
"node_modules/js-tokens": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz",
"integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==",
"dev": true
},
"node_modules/json-parse-better-errors": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz",
"integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==",
"dev": true
},
"node_modules/lines-and-columns": {
"version": "1.1.6",
"resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.1.6.tgz",
"integrity": "sha1-HADHQ7QzzQpOgHWPe2SldEDZ/wA=",
"dev": true
},
"node_modules/locate-path": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz",
"integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==",
"dev": true,
"dependencies": {
"p-locate": "^4.1.0"
},
"engines": {
"node": ">=8"
}
},
"node_modules/opencollective-postinstall": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/opencollective-postinstall/-/opencollective-postinstall-2.0.2.tgz",
"integrity": "sha512-pVOEP16TrAO2/fjej1IdOyupJY8KDUM1CvsaScRbw6oddvpQoOfGk4ywha0HKKVAD6RkW4x6Q+tNBwhf3Bgpuw==",
"dev": true,
"bin": {
"opencollective-postinstall": "index.js"
}
},
"node_modules/p-limit": {
"version": "2.3.0",
"resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz",
"integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==",
"dev": true,
"dependencies": {
"p-try": "^2.0.0"
},
"engines": {
"node": ">=6"
}
},
"node_modules/p-locate": {
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz",
"integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==",
"dev": true,
"dependencies": {
"p-limit": "^2.2.0"
},
"engines": {
"node": ">=8"
}
},
"node_modules/p-try": {
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz",
"integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==",
"dev": true,
"engines": {
"node": ">=6"
}
},
"node_modules/parent-module": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz",
"integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==",
"dev": true,
"dependencies": {
"callsites": "^3.0.0"
},
"engines": {
"node": ">=6"
}
},
"node_modules/parse-json": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.0.0.tgz",
"integrity": "sha512-OOY5b7PAEFV0E2Fir1KOkxchnZNCdowAJgQ5NuxjpBKTRP3pQhwkrkxqQjeoKJ+fO7bCpmIZaogI4eZGDMEGOw==",
"dev": true,
"dependencies": {
"@babel/code-frame": "^7.0.0",
"error-ex": "^1.3.1",
"json-parse-better-errors": "^1.0.1",
"lines-and-columns": "^1.1.6"
},
"engines": {
"node": ">=8"
}
},
"node_modules/path-exists": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz",
"integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==",
"dev": true,
"engines": {
"node": ">=8"
}
},
"node_modules/path-type": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz",
"integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==",
"dev": true,
"engines": {
"node": ">=8"
}
},
"node_modules/pkg-dir": {
"version": "4.2.0",
"resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz",
"integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==",
"dev": true,
"dependencies": {
"find-up": "^4.0.0"
},
"engines": {
"node": ">=8"
}
},
"node_modules/please-upgrade-node": {
"version": "3.2.0",
"resolved": "https://registry.npmjs.org/please-upgrade-node/-/please-upgrade-node-3.2.0.tgz",
"integrity": "sha512-gQR3WpIgNIKwBMVLkpMUeR3e1/E1y42bqDQZfql+kDeXd8COYfM8PQA4X6y7a8u9Ua9FHmsrrmirW2vHs45hWg==",
"dev": true,
"dependencies": {
"semver-compare": "^1.0.0"
}
},
"node_modules/prettier": {
"version": "2.0.5",
"resolved": "https://registry.npmjs.org/prettier/-/prettier-2.0.5.tgz",
"integrity": "sha512-7PtVymN48hGcO4fGjybyBSIWDsLU4H4XlvOHfq91pz9kkGlonzwTfYkaIEwiRg/dAJF9YlbsduBAgtYLi+8cFg==",
"dev": true,
"bin": {
"prettier": "bin-prettier.js"
},
"engines": {
"node": ">=10.13.0"
}
},
"node_modules/regenerator-runtime": {
"version": "0.13.5",
"resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.5.tgz",
"integrity": "sha512-ZS5w8CpKFinUzOwW3c83oPeVXoNsrLsaCoLtJvAClH135j/R77RuymhiSErhm2lKcwSCIpmvIWSbDkIfAqKQlA==",
"dev": true
},
"node_modules/resolve-from": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz",
"integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==",
"dev": true,
"engines": {
"node": ">=4"
}
},
"node_modules/semver": {
"version": "6.3.0",
"resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz",
"integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==",
"bin": {
"semver": "bin/semver.js"
}
},
"node_modules/semver-compare": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/semver-compare/-/semver-compare-1.0.0.tgz",
"integrity": "sha1-De4hahyUGrN+nvsXiPavxf9VN/w=",
"dev": true
},
"node_modules/semver-regex": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/semver-regex/-/semver-regex-2.0.0.tgz",
"integrity": "sha512-mUdIBBvdn0PLOeP3TEkMH7HHeUP3GjsXCwKarjv/kGmUFOYg1VqEemKhoQpWMu6X2I8kHeuVdGibLGkVK+/5Qw==",
"dev": true,
"engines": {
"node": ">=6"
}
},
"node_modules/slash": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz",
"integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==",
"dev": true,
"engines": {
"node": ">=8"
}
},
"node_modules/supports-color": {
"version": "7.1.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz",
"integrity": "sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g==",
"dev": true,
"dependencies": {
"has-flag": "^4.0.0"
},
"engines": {
"node": ">=8"
}
},
"node_modules/tunnel": {
"version": "0.0.4",
"resolved": "https://registry.npmjs.org/tunnel/-/tunnel-0.0.4.tgz",
"integrity": "sha1-LTeFoVjBdMmhbcLARuxfxfF0IhM=",
"engines": {
"node": ">=0.6.11 <=0.7.0 || >=0.7.3"
}
},
"node_modules/typed-rest-client": {
"version": "1.5.0",
"resolved": "https://registry.npmjs.org/typed-rest-client/-/typed-rest-client-1.5.0.tgz",
"integrity": "sha512-DVZRlmsfnTjp6ZJaatcdyvvwYwbWvR4YDNFDqb+qdTxpvaVP99YCpBkA8rxsLtAPjBVoDe4fNsnMIdZTiPuKWg==",
"dependencies": {
"tunnel": "0.0.4",
"underscore": "1.8.3"
}
},
"node_modules/underscore": {
"version": "1.8.3",
"resolved": "https://registry.npmjs.org/underscore/-/underscore-1.8.3.tgz",
"integrity": "sha1-Tz+1OxBuYJf8+ctBCfKl6b36UCI="
},
"node_modules/uuid": {
"version": "3.3.3",
"resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.3.tgz",
"integrity": "sha512-pW0No1RGHgzlpHJO1nsVrHKpOEIxkGg1xB+v0ZmdNH5OAeAwzAVrCnI2/6Mtx+Uys6iaylxa+D3g4j63IKKjSQ==",
"bin": {
"uuid": "bin/uuid"
}
},
"node_modules/which-pm-runs": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/which-pm-runs/-/which-pm-runs-1.0.0.tgz",
"integrity": "sha1-Zws6+8VS4LVd9rd4DKdGFfI60cs=",
"dev": true
},
"node_modules/yaml": {
"version": "1.9.2",
"resolved": "https://registry.npmjs.org/yaml/-/yaml-1.9.2.tgz",
"integrity": "sha512-HPT7cGGI0DuRcsO51qC1j9O16Dh1mZ2bnXwsi0jrSpsLz0WxOLSLXfkABVl6bZO629py3CU+OMJtpNHDLB97kg==",
"dev": true,
"dependencies": {
"@babel/runtime": "^7.9.2"
},
"engines": {
"node": ">= 6"
}
}
},
"dependencies": { "dependencies": {
"@actions/core": { "@actions/core": {
"version": "1.2.6", "version": "1.2.6",
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "setup-elixir", "name": "setup-elixir",
"version": "1.6.0", "version": "1.5.0",
"license": "MIT", "license": "MIT",
"private": true, "private": true,
"scripts": { "scripts": {
+1 -1
View File
@@ -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/${2}/${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
+3 -1
View File
@@ -28,5 +28,7 @@ async function installOTP(version, osVersion) {
return return
} }
throw new Error('@erlef/setup-elixir only supports Ubuntu Linux at this time') throw new Error(
'@actions/setup-elixir only supports Ubuntu Linux at this time'
)
} }
+16 -20
View File
@@ -16,10 +16,9 @@ main().catch(err => {
async function main() { async function main() {
checkPlatform() checkPlatform()
const osVersion = getRunnerOSVersion()
const otpSpec = core.getInput('otp-version', {required: true}) const otpSpec = core.getInput('otp-version', {required: true})
const elixirSpec = core.getInput('elixir-version', {required: true}) const elixirSpec = core.getInput('elixir-version', {required: true})
const otpVersion = await getOtpVersion(otpSpec, osVersion) const otpVersion = await getOtpVersion(otpSpec)
const [elixirVersion, otpMajor] = await getElixirVersion( const [elixirVersion, otpMajor] = await getElixirVersion(
elixirSpec, elixirSpec,
otpVersion otpVersion
@@ -31,6 +30,10 @@ async function main() {
let installRebar = core.getInput('install-rebar') let installRebar = core.getInput('install-rebar')
installRebar = installRebar == null ? 'true' : installRebar installRebar = installRebar == null ? 'true' : installRebar
const experimentalOTP = core.getInput('experimental-otp')
const osVersion =
experimentalOTP === 'true' ? getRunnerOSVersion() : 'ubuntu-14.04'
console.log(`##[group]Installing OTP ${otpVersion} - built on ${osVersion}`) console.log(`##[group]Installing OTP ${otpVersion} - built on ${osVersion}`)
await installOTP(otpVersion, osVersion) await installOTP(otpVersion, osVersion)
console.log(`##[endgroup]`) console.log(`##[endgroup]`)
@@ -54,16 +57,15 @@ async function main() {
function checkPlatform() { function checkPlatform() {
if (process.platform !== 'linux') if (process.platform !== 'linux')
throw new Error( throw new Error(
'@erlef/setup-elixir only supports Ubuntu Linux at this time' '@actions/setup-elixir only supports Ubuntu Linux at this time'
) )
} }
async function getOtpVersion(spec, osVersion) { async function getOtpVersion(spec) {
const version = getVersionFromSpec(spec, await getOtpVersions(osVersion)) return getVersionFromSpec(spec, await getOtpVersions()) || spec
return version ? `OTP-${version}` : spec
} }
function getRunnerOSVersion() { function getRunnerOSVersion(experimentalOTP) {
const mapToUbuntuVersion = { const mapToUbuntuVersion = {
ubuntu16: 'ubuntu-16.04', ubuntu16: 'ubuntu-16.04',
ubuntu18: 'ubuntu-18.04', ubuntu18: 'ubuntu-18.04',
@@ -85,10 +87,10 @@ async function getElixirVersion(spec, otpVersion) {
const version = getVersionFromSpec(spec, semverVersions) const version = getVersionFromSpec(spec, semverVersions)
const gitRef = version ? `v${version}` : spec const gitRef = version ? `v${version}` : spec
const otpMatch = otpVersion.match(/^OTP-([\.\d]+)/) const [otpMajor] = otpVersion.match(/^\d+/)
if (otpMatch != null && versions.get(gitRef).includes(otpMatch[0])) { if (versions.get(gitRef).includes(otpMajor)) {
return [gitRef, otpMatch[0]] return [gitRef, otpMajor]
} else { } else {
return [gitRef, null] return [gitRef, null]
} }
@@ -103,23 +105,17 @@ function getVersionFromSpec(spec, versions) {
} }
} }
async function getOtpVersions(osVersion) { async function getOtpVersions() {
const result = await get( const result = await get(
`https://repo.hex.pm/builds/otp/${osVersion}/builds.txt` 'https://raw.githubusercontent.com/erlang/otp/master/otp_versions.table'
) )
return result return result
.trim() .trim()
.split('\n') .split('\n')
.map(line => { .map(line => {
const match = line.match(/^OTP-([\.\d]+)/) const [_, version] = line.match(/^OTP-([\.\d]+)/)
return version
if (match) {
const [_, version] = match
return version
} else {
return line
}
}) })
} }