Skip to content

Commit

Permalink
Build
Browse files Browse the repository at this point in the history
  • Loading branch information
pbrisbin committed Dec 2, 2024
1 parent 6db3e95 commit ca7a716
Showing 1 changed file with 13 additions and 17 deletions.
30 changes: 13 additions & 17 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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];
}
});
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit ca7a716

Please sign in to comment.