From ca7a716875f168ebf503bcdeac798ad1904b7cd4 Mon Sep 17 00:00:00 2001 From: patrick brisbin Date: Mon, 2 Dec 2024 12:01:21 -0500 Subject: [PATCH] Build --- dist/index.js | 30 +++++++++++++----------------- 1 file changed, 13 insertions(+), 17 deletions(-) diff --git a/dist/index.js b/dist/index.js index b1016c2..db7aec8 100644 --- a/dist/index.js +++ b/dist/index.js @@ -171,7 +171,7 @@ function getLatestRelease(url, githubToken) { data = (_a.sent()).data; version = data.tag_name; core.debug("Latest release: ".concat(JSON.stringify(data))); - core.info("Using version: ".concat(version)); + core.info("Using latest release name as version: ".concat(version)); return [2, version]; } }); @@ -358,40 +358,36 @@ function getExtract(ext) { } function mkReleaseConfig(platform, osArch) { return __awaiter(this, void 0, void 0, function () { - var _a, name, version, urlTemplate, subdirTemplate, os, arch, ext, noExtract, githubToken, githubTokenForLatest, templateVars, interpolateLatest, interpolateUrl, url, _b, subdir; + var _a, name, rawVersion, urlTemplate, subdirTemplate, os, arch, ext, noExtract, githubToken, githubTokenForLatest, inferVersion, version, _b, templateVars, url, subdir; var _this = this; return __generator(this, function (_c) { switch (_c.label) { case 0: return [4, (0, inputs_1.getInputs)(platform, osArch, core)]; case 1: - _a = _c.sent(), name = _a.name, version = _a.version, urlTemplate = _a.url, subdirTemplate = _a.subdir, os = _a.os, arch = _a.arch, ext = _a.ext, noExtract = _a.noExtract, githubToken = _a.githubToken, githubTokenForLatest = _a.githubTokenForLatest; - templateVars = { name: name, version: version, os: os, arch: arch, ext: ext }; - interpolateLatest = function () { return __awaiter(_this, void 0, void 0, function () { - var url, latest; + _a = _c.sent(), name = _a.name, rawVersion = _a.version, urlTemplate = _a.url, subdirTemplate = _a.subdir, os = _a.os, arch = _a.arch, ext = _a.ext, noExtract = _a.noExtract, githubToken = _a.githubToken, githubTokenForLatest = _a.githubTokenForLatest; + inferVersion = function () { return __awaiter(_this, void 0, void 0, function () { + var url; return __generator(this, function (_a) { switch (_a.label) { case 0: - url = interpolateUrl({ name: name, os: os, arch: arch, ext: ext }); + url = (0, interpolate_1.interpolate)(urlTemplate, { name: name, os: os, arch: arch, ext: ext }); return [4, github.getLatestRelease(url, githubTokenForLatest)]; - case 1: - latest = _a.sent(); - return [2, interpolateUrl({ name: name, version: latest, os: os, arch: arch, ext: ext })]; + case 1: return [2, _a.sent()]; } }); }); }; - interpolateUrl = function (vars) { - return (0, interpolate_1.interpolate)(urlTemplate, vars); - }; - if (!(version === "")) return [3, 3]; - return [4, interpolateLatest()]; + if (!(rawVersion === "")) return [3, 3]; + return [4, inferVersion()]; case 2: _b = _c.sent(); return [3, 4]; case 3: - _b = interpolateUrl(templateVars); + _b = rawVersion; _c.label = 4; case 4: - url = _b; + version = _b; + templateVars = { name: name, version: version, os: os, arch: arch, ext: ext }; + url = (0, interpolate_1.interpolate)(urlTemplate, templateVars); subdir = subdirTemplate ? (0, interpolate_1.interpolate)(subdirTemplate, templateVars) : null;