Skip to content

Commit

Permalink
Generate artifacts
Browse files Browse the repository at this point in the history
  • Loading branch information
olafurpg committed Sep 22, 2019
1 parent 9200616 commit 1c7629d
Show file tree
Hide file tree
Showing 218 changed files with 15,749 additions and 1 deletion.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
__tests__/runner/*

# comment out in distribution branches
/node_modules/

# Rest pulled from https://github.com/github/gitignore/blob/master/Node.gitignore
# Logs
Expand Down
65 changes: 65 additions & 0 deletions lib/install.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
"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 core = __importStar(require("@actions/core"));
const shell = __importStar(require("shelljs"));
const path = __importStar(require("path"));
const homedir = require("os").homedir();
function install(javaVersion) {
return __awaiter(this, void 0, void 0, function* () {
installJava(javaVersion);
installSbt();
});
}
exports.install = install;
function installJava(javaVersion) {
core.startGroup("Install Java");
shell
.exec("curl -sL https://github.com/shyiko/jabba/raw/master/install.sh", {
silent: true
})
.exec("bash");
const jabba = path.join(homedir, ".jabba", "bin", "jabba");
const toInstall = shell
.exec(`${jabba} ls-remote`)
.grep(javaVersion)
.head({ "-n": 1 })
.stdout.trim();
console.log(`Installing ${toInstall}`);
shell.exec(`${jabba} install ${toInstall}`);
const javaHome = shell
.exec(`${jabba} which --home ${toInstall}`)
.stdout.trim();
core.exportVariable("JAVA_HOME", javaHome);
core.addPath(path.join(javaHome, "bin"));
core.endGroup();
}
function installSbt() {
core.startGroup("Install sbt");
const bin = path.join(homedir, "bin");
shell.mkdir(bin);
core.addPath(bin);
curl("https://raw.githubusercontent.com/paulp/sbt-extras/master/sbt", "sbt");
curl("https://raw.githubusercontent.com/coursier/sbt-extras/master/sbt", path.join(bin, "csbt"));
core.endGroup();
}
function curl(url, outputFile) {
shell.exec(`curl -sL ${url}`, { silent: true }).to(outputFile);
shell.chmod("+x", outputFile);
console.log(`Downloaded '${path.basename(outputFile)}'`);
}
33 changes: 33 additions & 0 deletions lib/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
"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 core = __importStar(require("@actions/core"));
const install_1 = require("./install");
function run() {
return __awaiter(this, void 0, void 0, function* () {
try {
const version = core.getInput("java-version", { required: true });
console.log(`Installing Java version '${version}'`);
yield install_1.install(version);
}
catch (error) {
core.setFailed(error.message);
}
});
}
run();
1 change: 1 addition & 0 deletions node_modules/.bin/shjs

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

97 changes: 97 additions & 0 deletions node_modules/@actions/core/README.md

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

16 changes: 16 additions & 0 deletions node_modules/@actions/core/lib/command.d.ts

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

66 changes: 66 additions & 0 deletions node_modules/@actions/core/lib/command.js

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

1 change: 1 addition & 0 deletions node_modules/@actions/core/lib/command.js.map

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

99 changes: 99 additions & 0 deletions node_modules/@actions/core/lib/core.d.ts

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

Loading

0 comments on commit 1c7629d

Please sign in to comment.