async function downloadAndCache()

in src/release.ts [131:157]


async function downloadAndCache(artifact: KubeloginArtifact): Promise<string> {
  const artifactZipball = await tc.downloadTool(artifact.artifactUrl);
  core.debug(`Downloaded ${artifact.artifactUrl} to ${artifactZipball}`);

  const artifactChecksum = await tc.downloadTool(artifact.checksumUrl);
  core.debug(`Downloaded ${artifact.checksumUrl} to ${artifactChecksum}`);

  await verifyZipballChecksum(
    artifactZipball,
    artifact.artifactName,
    artifactChecksum
  );
  core.debug(`Verified checksum of ${artifactZipball}`);

  const artifactFolder = await tc.extractZip(artifactZipball);
  core.debug(`Extracted ${artifactZipball} to ${artifactFolder}`);

  const cachedDir = await tc.cacheDir(
    artifactFolder,
    TOOL_NAME,
    artifact.version
  );
  const rv = resolveBinaryPath(artifact, cachedDir);
  core.debug(`Cached kubelogin to ${rv}`);

  return rv;
}