Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -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.

Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -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:
Expand Down Expand Up @@ -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'
Expand All @@ -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}}
Expand Down Expand Up @@ -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'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const {getElixirVersion} = require('../src/setup-elixir')
const {getElixirVersion} = require('../src/setup-beam')
const {deepStrictEqual} = require('assert')

async function test() {
Expand Down
174 changes: 86 additions & 88 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)

Expand Down Expand Up @@ -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')
}


Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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')
Expand All @@ -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) {
Expand Down Expand Up @@ -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

/***/ })

/******/ });
4 changes: 2 additions & 2 deletions dist/install-elixir
Original file line number Diff line number Diff line change
Expand Up @@ -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
8 changes: 4 additions & 4 deletions dist/install-otp
Original file line number Diff line number Diff line change
Expand Up @@ -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
5 changes: 3 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down
4 changes: 2 additions & 2 deletions src/install-elixir
Original file line number Diff line number Diff line change
Expand Up @@ -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
8 changes: 4 additions & 4 deletions src/install-otp
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion src/installer.js
Original file line number Diff line number Diff line change
Expand Up @@ -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')
}
6 changes: 2 additions & 4 deletions src/setup-elixir.js → src/setup-beam.js
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand All @@ -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) {
Expand Down