This commit is contained in:
Caleb Gosiak 2021-09-30 16:13:35 -05:00
parent a51ff9983a
commit e4a331f6ce
2 changed files with 14 additions and 4 deletions

View file

@ -43299,6 +43299,7 @@ class CacheService {
}
saveCache(paths, key) {
return __awaiter(this, void 0, void 0, function* () {
const cacheId = this.getCacheId(key);
const compressionMethod = yield utils.getCompressionMethod();
const cachePaths = yield utils.resolvePaths(paths);
core.debug("Cache Paths:");
@ -43312,8 +43313,8 @@ class CacheService {
yield tar_1.listTar(archivePath, compressionMethod);
}
core.info(`Archive Size: ${filesize_1.default(fs_1.default.statSync(archivePath).size)}`);
core.debug(`Saving Cache (ID: ${key})`);
yield this.uploadToS3(key, archivePath);
core.debug(`Saving Cache (ID: ${cacheId})`);
yield this.uploadToS3(cacheId, archivePath);
}
finally {
// Try to delete the archive to save space
@ -43340,6 +43341,10 @@ class CacheService {
.promise();
});
}
getCacheId(primaryKey) {
var _a;
return `${(_a = process.env["GITHUB_REPOSITORY"]) === null || _a === void 0 ? void 0 : _a.replace("/", "-").toLowerCase()}-${primaryKey}`;
}
}
exports.CacheService = CacheService;