Skip to content

Commit 6068b77

Browse files
committed
Generate artifacts
1 parent 109d71e commit 6068b77

File tree

219 files changed

+16406
-9
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

219 files changed

+16406
-9
lines changed

.gitignore

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
__tests__/runner/*
22

33
# comment out in distribution branches
4-
/node_modules/
54

65
# Rest pulled from https://github.com/github/gitignore/blob/master/Node.gitignore
76
# Logs
@@ -21,8 +20,6 @@ pids
2120
*.seed
2221
*.pid.lock
2322

24-
# Directory for instrumented libs generated by jscoverage/JSCover
25-
lib-cov
2623

2724
# Coverage directory used by tools like istanbul
2825
coverage
@@ -42,10 +39,8 @@ bower_components
4239
# sbt specific
4340
.cache
4441
.history
45-
.lib/
4642
dist/*
4743
target/
48-
lib_managed/
4944
src_managed/
5045
project/boot/
5146
project/plugins/project/
@@ -70,14 +65,10 @@ local.*
7065

7166
.DS_Store
7267

73-
node_modules
7468

75-
lib/core/metadata.js
76-
lib/core/MetadataBlog.js
7769

7870
website/translated_docs
7971
website/build/
8072
website/yarn.lock
81-
website/node_modules
8273
website/i18n/*
8374
!website/i18n/en.json

lib/install.js

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
"use strict";
2+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4+
return new (P || (P = Promise))(function (resolve, reject) {
5+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8+
step((generator = generator.apply(thisArg, _arguments || [])).next());
9+
});
10+
};
11+
var __importStar = (this && this.__importStar) || function (mod) {
12+
if (mod && mod.__esModule) return mod;
13+
var result = {};
14+
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
15+
result["default"] = mod;
16+
return result;
17+
};
18+
Object.defineProperty(exports, "__esModule", { value: true });
19+
const core = __importStar(require("@actions/core"));
20+
const shell = __importStar(require("shelljs"));
21+
const path = __importStar(require("path"));
22+
const homedir = require("os").homedir();
23+
const bin = path.join(homedir, "bin");
24+
function install(javaVersion, jabbaVersion) {
25+
return __awaiter(this, void 0, void 0, function* () {
26+
installJava(javaVersion, jabbaVersion);
27+
installSbt();
28+
});
29+
}
30+
exports.install = install;
31+
function jabbaUrlSuffix() {
32+
const runnerOs = shell.env["RUNNER_OS"] || "undefined";
33+
switch (runnerOs.toLowerCase()) {
34+
case "linux":
35+
return "linux-amd64";
36+
case "macos":
37+
return "darwin-amd64";
38+
case "windows":
39+
return "windows-amd64.exe";
40+
default:
41+
throw new Error(`unknown runner OS: ${runnerOs}, expected one of Linux, macOS or Windows.`);
42+
}
43+
}
44+
function isWindows() {
45+
return shell.env["RUNNER_OS"] === "Windows";
46+
}
47+
function jabbaName() {
48+
if (isWindows())
49+
return "jabba.exe";
50+
else
51+
return "jabba";
52+
}
53+
function installJava(javaVersion, jabbaVersion) {
54+
core.startGroup("Install Java");
55+
core.addPath(bin);
56+
const jabbaUrl = `https://github.com/shyiko/jabba/releases/download/${jabbaVersion}/jabba-${jabbaVersion}-${jabbaUrlSuffix()}`;
57+
shell.mkdir(bin);
58+
const jabba = path.join(bin, jabbaName());
59+
shell.set("-ev");
60+
shell.exec(`curl -sL -o ${jabba} ${jabbaUrl}`, { silent: true });
61+
shell.chmod(755, jabba);
62+
const toInstall = shell
63+
.exec(`${jabba} ls-remote`)
64+
.grep(javaVersion)
65+
.head({ "-n": 1 })
66+
.stdout.trim();
67+
console.log(`Installing ${toInstall}`);
68+
shell.exec(`${jabba} install ${toInstall}`);
69+
const javaHome = shell
70+
.exec(`${jabba} which --home ${toInstall}`)
71+
.stdout.trim();
72+
core.exportVariable("JAVA_HOME", javaHome);
73+
core.addPath(path.join(javaHome, "bin"));
74+
core.endGroup();
75+
}
76+
function installSbt() {
77+
core.startGroup("Install sbt");
78+
core.addPath(bin);
79+
curl("https://raw.githubusercontent.com/paulp/sbt-extras/master/sbt", path.join(bin, "sbt"));
80+
curl("https://raw.githubusercontent.com/coursier/sbt-extras/master/sbt", path.join(bin, "csbt"));
81+
core.endGroup();
82+
}
83+
function curl(url, outputFile) {
84+
shell.exec(`curl -sL ${url}`, { silent: true }).to(outputFile);
85+
shell.chmod(755, outputFile);
86+
shell.cat(outputFile);
87+
console.log(`Downloaded '${path.basename(outputFile)}' to ${outputFile}`);
88+
}

lib/main.js

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
"use strict";
2+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4+
return new (P || (P = Promise))(function (resolve, reject) {
5+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8+
step((generator = generator.apply(thisArg, _arguments || [])).next());
9+
});
10+
};
11+
var __importStar = (this && this.__importStar) || function (mod) {
12+
if (mod && mod.__esModule) return mod;
13+
var result = {};
14+
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
15+
result["default"] = mod;
16+
return result;
17+
};
18+
Object.defineProperty(exports, "__esModule", { value: true });
19+
const core = __importStar(require("@actions/core"));
20+
const install_1 = require("./install");
21+
function run() {
22+
return __awaiter(this, void 0, void 0, function* () {
23+
try {
24+
const javaVersion = core.getInput("java-version", { required: true });
25+
const jabbaVersion = core.getInput("jabba-version", { required: true });
26+
console.log(`Installing Java version '${javaVersion}'`);
27+
yield install_1.install(javaVersion, jabbaVersion);
28+
}
29+
catch (error) {
30+
core.setFailed(error.message);
31+
}
32+
});
33+
}
34+
run();

node_modules/.bin/shjs

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)