Rename to setup-beam (#21)

This commit is contained in:
Bryan Paxton
2021-03-29 14:51:27 -05:00
committed by GitHub
parent 885971a72e
commit 86521d7b4d
12 changed files with 116 additions and 119 deletions
+3 -3
View File
@@ -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.
+6 -6
View File
@@ -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'
@@ -1,4 +1,4 @@
const {getElixirVersion} = require('../src/setup-elixir')
const {getElixirVersion} = require('../src/setup-beam')
const {deepStrictEqual} = require('assert')
async function test() {
+86 -88
View File
@@ -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<number> 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<number> 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
/***/ })
/******/ });
+2 -2
View File
@@ -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
+4 -4
View File
@@ -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
+3 -2
View File
@@ -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",
+2 -2
View File
@@ -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": {
+2 -2
View File
@@ -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
+4 -4
View File
@@ -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
+1 -1
View File
@@ -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')
}
+2 -4
View File
@@ -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) {