Fix missing extension in temporary tarball path

For some reason, this was breaking archive extraction on Windows only on
Forgejo Actions (not GitHub Actions).
This commit is contained in:
Matthew Lugg
2025-11-28 13:04:27 +00:00
parent a45b642579
commit 244f44ebd6
2 changed files with 3 additions and 7 deletions
-5
View File
@@ -248,15 +248,10 @@ function parseZigString(raw) {
return result;
}
async function getTarballCachePath() {
return path.join(process.env['RUNNER_TEMP'], await getTarballName());
}
module.exports = {
getVersion,
getTarballName,
getTarballExt,
getCachePrefix,
getZigCachePath,
getTarballCachePath,
};
+3 -2
View File
@@ -85,14 +85,15 @@ async function downloadTarball(tarball_filename) {
async function retrieveTarball(tarball_name, tarball_ext) {
const cache_key = `setup-zig-tarball-${tarball_name}`;
const tarball_cache_path = await common.getTarballCachePath();
const tarball_basename = `${tarball_name}${tarball_ext}`;
const tarball_cache_path = path.join(process.env['RUNNER_TEMP'], tarball_basename);
if (await cache.restoreCache([tarball_cache_path], cache_key)) {
return tarball_cache_path;
}
core.info(`Cache miss. Fetching Zig ${await common.getVersion()}`);
const downloaded_path = await downloadTarball(`${tarball_name}${tarball_ext}`);
const downloaded_path = await downloadTarball(tarball_basename);
await fs.copyFile(downloaded_path, tarball_cache_path)
await cache.saveCache([tarball_cache_path], cache_key);
return tarball_cache_path;