mirror of
https://github.com/imranismail/setup-kustomize.git
synced 2026-06-13 01:14:19 +00:00
Update bin
This commit is contained in:
@@ -69,11 +69,6 @@ function getKustomize(versionSpec) {
|
||||
toolPath = yield acquireKustomize(version);
|
||||
}
|
||||
}
|
||||
if (osPlat != 'win32') {
|
||||
toolPath = path.join(toolPath, 'bin');
|
||||
}
|
||||
//
|
||||
// prepend the tools path. instructs the agent to prepend for future tasks
|
||||
core.addPath(toolPath);
|
||||
});
|
||||
}
|
||||
@@ -103,7 +98,7 @@ function queryLatestMatch(versionSpec) {
|
||||
let kustomizeVersions = (yield rest.get(dataUrl)).result || [];
|
||||
kustomizeVersions.forEach((kustomizeVersion) => {
|
||||
if (kustomizeVersion.assets.some(asset => asset.name.includes(dataFileName))) {
|
||||
versions.push(kustomizeVersion.tag_name);
|
||||
versions.push(kustomizeVersion.name);
|
||||
}
|
||||
});
|
||||
// get the latest version that matches the version spec
|
||||
@@ -140,9 +135,7 @@ function evaluateVersions(versions, versionSpec) {
|
||||
function acquireKustomize(version) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
version = semver.clean(version) || '';
|
||||
|
||||
let fileName = `kustomize_${version}`;
|
||||
|
||||
switch (osPlat) {
|
||||
case 'linux':
|
||||
case 'darwin':
|
||||
@@ -152,7 +145,6 @@ function acquireKustomize(version) {
|
||||
default:
|
||||
throw new Error(`Unexpected OS '${osPlat}'`);
|
||||
}
|
||||
|
||||
switch (osArch) {
|
||||
case 'x64':
|
||||
fileName = `${fileName}_amd64`;
|
||||
@@ -160,9 +152,7 @@ function acquireKustomize(version) {
|
||||
default:
|
||||
fileName = `${fileName}_${osArch}`;
|
||||
}
|
||||
|
||||
let downloadUrl = `https://github.com/kubernetes-sigs/kustomize/releases/download/v${version}/${fileName}`;
|
||||
core.debug(downloadUrl);
|
||||
let downloadPath;
|
||||
try {
|
||||
downloadPath = yield tc.downloadTool(downloadUrl);
|
||||
@@ -171,7 +161,6 @@ function acquireKustomize(version) {
|
||||
core.debug(err);
|
||||
throw `Failed to download version ${version}: ${err}`;
|
||||
}
|
||||
let toolRoot = path.join(downloadPath, fileName);
|
||||
return yield tc.cacheDir(toolRoot, 'kustomize', version);
|
||||
return yield tc.cacheFile(downloadPath, 'kustomize', 'kustomize', version);
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user