From b9d87ff3e1fede0f66ca0295670f22e9c96939d6 Mon Sep 17 00:00:00 2001 From: Bryan Paxton Date: Sat, 27 Mar 2021 16:53:29 -0500 Subject: [PATCH] Rename to setup-beam --- CONTRIBUTING.md | 6 +- README.md | 12 +- ...etup-elixir.test.js => setup-beam.test.js} | 2 +- dist/index.js | 174 +++++++++--------- dist/install-elixir | 4 +- dist/install-otp | 8 +- package-lock.json | 5 +- package.json | 4 +- src/install-elixir | 4 +- src/install-otp | 8 +- src/installer.js | 2 +- src/{setup-elixir.js => setup-beam.js} | 6 +- 12 files changed, 116 insertions(+), 119 deletions(-) rename __tests__/{setup-elixir.test.js => setup-beam.test.js} (88%) rename src/{setup-elixir.js => setup-beam.js} (94%) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 6e0745ce..ee44c105 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,8 +1,8 @@ ## Contributing -[fork]: https://github.com/erlef/setup-elixir/fork -[pr]: https://github.com/erlef/setup-elixir/compare -[code-of-conduct]: https://github.com/erlef/setup-elixir/blob/main/CODE_OF_CONDUCT.md +[fork]: https://github.com/erlef/setup-beam/fork +[pr]: https://github.com/erlef/setup-beam/compare +[code-of-conduct]: https://github.com/erlef/setup-beam/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. diff --git a/README.md b/README.md index 28e1b58e..6c0b119b 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ -# setup-elixir +# setup-beam -[![](https://github.com/erlef/setup-elixir/workflows/Test/badge.svg)](https://github.com/erlef/setup-elixir/actions) -[![](https://github.com/erlef/setup-elixir/workflows/Licensed/badge.svg)](https://github.com/erlef/setup-elixir/actions) +[![](https://github.com/erlef/setup-beam/workflows/Test/badge.svg)](https://github.com/erlef/setup-beam/actions) +[![](https://github.com/erlef/setup-beam/workflows/Licensed/badge.svg)](https://github.com/erlef/setup-beam/actions) This action sets up an Elixir environment for use in a GitHub Actions workflow by: @@ -39,7 +39,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - uses: erlef/setup-elixir@v1 + - uses: erlef/setup-beam@v1 with: otp-version: '22.2' elixir-version: '1.9.4' @@ -62,7 +62,7 @@ jobs: elixir: ['1.8.2', '1.9.4'] steps: - uses: actions/checkout@v2 - - uses: erlef/setup-elixir@v1 + - uses: erlef/setup-beam@v1 with: otp-version: ${{matrix.otp}} elixir-version: ${{matrix.elixir}} @@ -93,7 +93,7 @@ jobs: steps: - uses: actions/checkout@v2 - - uses: erlef/setup-elixir@v1 + - uses: erlef/setup-beam@v1 with: otp-version: '22.2' elixir-version: '1.9.4' diff --git a/__tests__/setup-elixir.test.js b/__tests__/setup-beam.test.js similarity index 88% rename from __tests__/setup-elixir.test.js rename to __tests__/setup-beam.test.js index ffba79b6..219e6afe 100644 --- a/__tests__/setup-elixir.test.js +++ b/__tests__/setup-beam.test.js @@ -1,4 +1,4 @@ -const {getElixirVersion} = require('../src/setup-elixir') +const {getElixirVersion} = require('../src/setup-beam') const {deepStrictEqual} = require('assert') async function test() { diff --git a/dist/index.js b/dist/index.js index 11c6d95a..7214b810 100644 --- a/dist/index.js +++ b/dist/index.js @@ -34,7 +34,7 @@ module.exports = /******/ // the startup function /******/ function startup() { /******/ // Load entry module and return exports -/******/ return __webpack_require__(986); +/******/ return __webpack_require__(562); /******/ }; /******/ /******/ // run startup @@ -2931,7 +2931,7 @@ function escapeProperty(s) { /***/ 449: /***/ (function(module, __unusedexports, __webpack_require__) { -const {exec} = __webpack_require__(917) +const {exec} = __webpack_require__(986) const path = __webpack_require__(622) const semver = __webpack_require__(280) @@ -2961,7 +2961,7 @@ async function installOTP(version, osVersion) { return } - throw new Error('@erlef/setup-elixir only supports Ubuntu Linux at this time') + throw new Error('@erlef/setup-beam only supports Ubuntu Linux at this time') } @@ -3212,90 +3212,11 @@ exports.getState = getState; /***/ }), -/***/ 614: -/***/ (function(module) { - -module.exports = require("events"); - -/***/ }), - -/***/ 622: -/***/ (function(module) { - -module.exports = require("path"); - -/***/ }), - -/***/ 669: -/***/ (function(module) { - -module.exports = require("util"); - -/***/ }), - -/***/ 747: -/***/ (function(module) { - -module.exports = require("fs"); - -/***/ }), - -/***/ 917: -/***/ (function(__unusedmodule, exports, __webpack_require__) { - -"use strict"; - -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; - result["default"] = mod; - return result; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -const tr = __importStar(__webpack_require__(9)); -/** - * Exec a command. - * Output will be streamed to the live console. - * Returns promise with return code - * - * @param commandLine command to execute (can include additional args). Must be correctly escaped. - * @param args optional arguments for tool. Escaping is handled by the lib. - * @param options optional exec options. See ExecOptions - * @returns Promise exit code - */ -function exec(commandLine, args, options) { - return __awaiter(this, void 0, void 0, function* () { - const commandArgs = tr.argStringToArray(commandLine); - if (commandArgs.length === 0) { - throw new Error(`Parameter 'commandLine' cannot be null or empty.`); - } - // Path to tool to execute should be first arg - const toolPath = commandArgs[0]; - args = commandArgs.slice(1).concat(args || []); - const runner = new tr.ToolRunner(toolPath, args, options); - return runner.exec(); - }); -} -exports.exec = exec; -//# sourceMappingURL=exec.js.map - -/***/ }), - -/***/ 986: +/***/ 562: /***/ (function(__unusedmodule, exports, __webpack_require__) { const core = __webpack_require__(470) -const {exec} = __webpack_require__(917) +const {exec} = __webpack_require__(986) const {installElixir, installOTP} = __webpack_require__(449) const path = __webpack_require__(622) const semver = __webpack_require__(280) @@ -3335,7 +3256,7 @@ async function main() { await installElixir(elixirVersion, otpMajor) console.log(`##[endgroup]`) - process.env.PATH = `${process.env.RUNNER_TEMP}/.setup-elixir/elixir/bin:${process.env.RUNNER_TEMP}/.setup-elixir/otp/bin:${process.env.PATH}` + process.env.PATH = `${process.env.RUNNER_TEMP}/.setup-beam/elixir/bin:${process.env.RUNNER_TEMP}/.setup-beam/otp/bin:${process.env.PATH}` if (installRebar === 'true') await exec('mix local.rebar --force') if (installHex === 'true') await exec('mix local.hex --force') @@ -3349,9 +3270,7 @@ async function main() { function checkPlatform() { if (process.platform !== 'linux') - throw new Error( - '@erlef/setup-elixir only supports Ubuntu Linux at this time' - ) + throw new Error('@erlef/setup-beam only supports Ubuntu Linux at this time') } async function getOtpVersion(spec, osVersion) { @@ -3469,6 +3388,85 @@ function get(url) { } +/***/ }), + +/***/ 614: +/***/ (function(module) { + +module.exports = require("events"); + +/***/ }), + +/***/ 622: +/***/ (function(module) { + +module.exports = require("path"); + +/***/ }), + +/***/ 669: +/***/ (function(module) { + +module.exports = require("util"); + +/***/ }), + +/***/ 747: +/***/ (function(module) { + +module.exports = require("fs"); + +/***/ }), + +/***/ 986: +/***/ (function(__unusedmodule, exports, __webpack_require__) { + +"use strict"; + +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; + result["default"] = mod; + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const tr = __importStar(__webpack_require__(9)); +/** + * Exec a command. + * Output will be streamed to the live console. + * Returns promise with return code + * + * @param commandLine command to execute (can include additional args). Must be correctly escaped. + * @param args optional arguments for tool. Escaping is handled by the lib. + * @param options optional exec options. See ExecOptions + * @returns Promise exit code + */ +function exec(commandLine, args, options) { + return __awaiter(this, void 0, void 0, function* () { + const commandArgs = tr.argStringToArray(commandLine); + if (commandArgs.length === 0) { + throw new Error(`Parameter 'commandLine' cannot be null or empty.`); + } + // Path to tool to execute should be first arg + const toolPath = commandArgs[0]; + args = commandArgs.slice(1).concat(args || []); + const runner = new tr.ToolRunner(toolPath, args, options); + return runner.exec(); + }); +} +exports.exec = exec; +//# sourceMappingURL=exec.js.map + /***/ }) /******/ }); \ No newline at end of file diff --git a/dist/install-elixir b/dist/install-elixir index 3d471cc1..45fbc2c7 100755 --- a/dist/install-elixir +++ b/dist/install-elixir @@ -5,6 +5,6 @@ set -eo pipefail cd $RUNNER_TEMP wget -q https://repo.hex.pm/builds/elixir/${1}${2}.zip -unzip -d .setup-elixir/elixir ${1}${2}.zip +unzip -d .setup-beam/elixir ${1}${2}.zip rm ${1}${2}.zip -echo "$(pwd)/.setup-elixir/elixir/bin" >> $GITHUB_PATH +echo "$(pwd)/.setup-beam/elixir/bin" >> $GITHUB_PATH diff --git a/dist/install-otp b/dist/install-otp index 1ef1bd68..2026e1b4 100755 --- a/dist/install-otp +++ b/dist/install-otp @@ -5,8 +5,8 @@ set -eo pipefail cd $RUNNER_TEMP wget -q -O otp.tar.gz https://repo.hex.pm/builds/otp/${2}/${1}.tar.gz -mkdir -p .setup-elixir/otp -tar zxf otp.tar.gz -C .setup-elixir/otp --strip-components=1 +mkdir -p .setup-beam/otp +tar zxf otp.tar.gz -C .setup-beam/otp --strip-components=1 rm otp.tar.gz -.setup-elixir/otp/Install -minimal $(pwd)/.setup-elixir/otp -echo "$(pwd)/.setup-elixir/otp/bin" >> $GITHUB_PATH +.setup-beam/otp/Install -minimal $(pwd)/.setup-beam/otp +echo "$(pwd)/.setup-beam/otp/bin" >> $GITHUB_PATH diff --git a/package-lock.json b/package-lock.json index 094e2b7f..05a54d73 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,11 +1,12 @@ { - "name": "setup-elixir", + "name": "setup-beam", "version": "1.6.0", "lockfileVersion": 2, "requires": true, "packages": { "": { - "version": "1.4.1", + "name": "setup-beam", + "version": "1.6.0", "license": "MIT", "dependencies": { "@actions/core": "^1.0.0", diff --git a/package.json b/package.json index c13bba26..a52747b6 100644 --- a/package.json +++ b/package.json @@ -1,10 +1,10 @@ { - "name": "setup-elixir", + "name": "setup-beam", "version": "1.6.0", "license": "MIT", "private": true, "scripts": { - "build": "ncc build src/setup-elixir.js", + "build": "ncc build src/setup-beam.js", "format": "prettier \"src/**/*.js\"" }, "husky": { diff --git a/src/install-elixir b/src/install-elixir index 3d471cc1..45fbc2c7 100755 --- a/src/install-elixir +++ b/src/install-elixir @@ -5,6 +5,6 @@ set -eo pipefail cd $RUNNER_TEMP wget -q https://repo.hex.pm/builds/elixir/${1}${2}.zip -unzip -d .setup-elixir/elixir ${1}${2}.zip +unzip -d .setup-beam/elixir ${1}${2}.zip rm ${1}${2}.zip -echo "$(pwd)/.setup-elixir/elixir/bin" >> $GITHUB_PATH +echo "$(pwd)/.setup-beam/elixir/bin" >> $GITHUB_PATH diff --git a/src/install-otp b/src/install-otp index 1ef1bd68..2026e1b4 100755 --- a/src/install-otp +++ b/src/install-otp @@ -5,8 +5,8 @@ set -eo pipefail cd $RUNNER_TEMP wget -q -O otp.tar.gz https://repo.hex.pm/builds/otp/${2}/${1}.tar.gz -mkdir -p .setup-elixir/otp -tar zxf otp.tar.gz -C .setup-elixir/otp --strip-components=1 +mkdir -p .setup-beam/otp +tar zxf otp.tar.gz -C .setup-beam/otp --strip-components=1 rm otp.tar.gz -.setup-elixir/otp/Install -minimal $(pwd)/.setup-elixir/otp -echo "$(pwd)/.setup-elixir/otp/bin" >> $GITHUB_PATH +.setup-beam/otp/Install -minimal $(pwd)/.setup-beam/otp +echo "$(pwd)/.setup-beam/otp/bin" >> $GITHUB_PATH diff --git a/src/installer.js b/src/installer.js index 79c8c436..c189e35b 100644 --- a/src/installer.js +++ b/src/installer.js @@ -28,5 +28,5 @@ async function installOTP(version, osVersion) { return } - throw new Error('@erlef/setup-elixir only supports Ubuntu Linux at this time') + throw new Error('@erlef/setup-beam only supports Ubuntu Linux at this time') } diff --git a/src/setup-elixir.js b/src/setup-beam.js similarity index 94% rename from src/setup-elixir.js rename to src/setup-beam.js index 6ca4ca88..385c3b39 100644 --- a/src/setup-elixir.js +++ b/src/setup-beam.js @@ -39,7 +39,7 @@ async function main() { await installElixir(elixirVersion, otpMajor) console.log(`##[endgroup]`) - process.env.PATH = `${process.env.RUNNER_TEMP}/.setup-elixir/elixir/bin:${process.env.RUNNER_TEMP}/.setup-elixir/otp/bin:${process.env.PATH}` + process.env.PATH = `${process.env.RUNNER_TEMP}/.setup-beam/elixir/bin:${process.env.RUNNER_TEMP}/.setup-beam/otp/bin:${process.env.PATH}` if (installRebar === 'true') await exec('mix local.rebar --force') if (installHex === 'true') await exec('mix local.hex --force') @@ -53,9 +53,7 @@ async function main() { function checkPlatform() { if (process.platform !== 'linux') - throw new Error( - '@erlef/setup-elixir only supports Ubuntu Linux at this time' - ) + throw new Error('@erlef/setup-beam only supports Ubuntu Linux at this time') } async function getOtpVersion(spec, osVersion) {