append .exe on windows downloads

This commit is contained in:
Kevin Schoonover 2022-03-27 20:20:05 -07:00
parent 0aed17094f
commit 0b4e93eb4b
3 changed files with 12 additions and 13 deletions

16
dist/index.js vendored
View File

@ -14092,11 +14092,12 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
const core = __importStar(__nccwpck_require__(2186)); const core = __importStar(__nccwpck_require__(2186));
const tc = __importStar(__nccwpck_require__(7784)); const tc = __importStar(__nccwpck_require__(7784));
const os = __importStar(__nccwpck_require__(2037)); const os = __importStar(__nccwpck_require__(2037));
const fs = __importStar(__nccwpck_require__(3292)); const fs = __importStar(__nccwpck_require__(7147));
const io = __importStar(__nccwpck_require__(7436)); const io = __importStar(__nccwpck_require__(7436));
const path = __importStar(__nccwpck_require__(1017)); const path = __importStar(__nccwpck_require__(1017));
const get_version_1 = __nccwpck_require__(6052); const get_version_1 = __nccwpck_require__(6052);
const semver = __importStar(__nccwpck_require__(1383)); const semver = __importStar(__nccwpck_require__(1383));
const IS_WINDOWS = process.platform === "win32";
function run() { function run() {
return __awaiter(this, void 0, void 0, function* () { return __awaiter(this, void 0, void 0, function* () {
try { try {
@ -14130,7 +14131,8 @@ function run() {
.then(() => { .then(() => {
core.info(`Successfully deleted pre-existing ${path.join(destination, "bin")}`); core.info(`Successfully deleted pre-existing ${path.join(destination, "bin")}`);
}); });
const buildURL = `https://github.com/earthly/earthly/releases/download/${version.tag_name}/${pkgName}-${releasePlatform}-${releaseArch}`; const buildURL = `https://github.com/earthly/earthly/releases/download/${version.tag_name}/${pkgName}-${releasePlatform}-${releaseArch}${IS_WINDOWS ? ".exe" : ""}`;
core.debug(`downloading ${buildURL}`);
const downloaded = yield tc.downloadTool(buildURL); const downloaded = yield tc.downloadTool(buildURL);
core.debug(`successfully downloaded ${buildURL} to ${destination}`); core.debug(`successfully downloaded ${buildURL} to ${destination}`);
yield io.mkdirP(path.join(destination, "bin")); yield io.mkdirP(path.join(destination, "bin"));
@ -14139,7 +14141,7 @@ function run() {
const newPath = path.join(destination, "bin", pkgName); const newPath = path.join(destination, "bin", pkgName);
yield io.mv(oldPath, newPath); yield io.mv(oldPath, newPath);
core.info(`Successfully renamed ${oldPath} to ${newPath}`); core.info(`Successfully renamed ${oldPath} to ${newPath}`);
yield fs.chmod(newPath, 0o755); yield fs.promises.chmod(newPath, 0o755);
const cachedPath = yield tc.cacheDir(path.join(destination, "bin"), pkgName, semver.clean(version.tag_name) || version.tag_name.substring(1)); const cachedPath = yield tc.cacheDir(path.join(destination, "bin"), pkgName, semver.clean(version.tag_name) || version.tag_name.substring(1));
core.addPath(cachedPath); core.addPath(cachedPath);
core.exportVariable("FORCE_COLOR", "1"); core.exportVariable("FORCE_COLOR", "1");
@ -14207,14 +14209,6 @@ module.exports = require("fs");
/***/ }), /***/ }),
/***/ 3292:
/***/ ((module) => {
"use strict";
module.exports = require("fs/promises");
/***/ }),
/***/ 3685: /***/ 3685:
/***/ ((module) => { /***/ ((module) => {

2
dist/index.js.map vendored

File diff suppressed because one or more lines are too long

View File

@ -7,6 +7,8 @@ import * as path from "path";
import { getVersionObject } from "./lib/get-version"; import { getVersionObject } from "./lib/get-version";
import * as semver from "semver"; import * as semver from "semver";
const IS_WINDOWS = process.platform === "win32";
async function run() { async function run() {
try { try {
const nodeArchToReleaseArch = { const nodeArchToReleaseArch = {
@ -52,8 +54,11 @@ async function run() {
); );
}); });
const buildURL = `https://github.com/earthly/earthly/releases/download/${version.tag_name}/${pkgName}-${releasePlatform}-${releaseArch}`; const buildURL = `https://github.com/earthly/earthly/releases/download/${
version.tag_name
}/${pkgName}-${releasePlatform}-${releaseArch}${IS_WINDOWS ? ".exe" : ""}`;
core.debug(`downloading ${buildURL}`);
const downloaded = await tc.downloadTool(buildURL); const downloaded = await tc.downloadTool(buildURL);
core.debug(`successfully downloaded ${buildURL} to ${destination}`); core.debug(`successfully downloaded ${buildURL} to ${destination}`);