From 444f3afcddbe04e2c5994f3e3624001dae88d539 Mon Sep 17 00:00:00 2001 From: Manas Jayanth <3097018+ManasJayanth@users.noreply.github.com> Date: Mon, 20 May 2024 13:10:17 +0530 Subject: [PATCH] wip --- dist/index.js | 14 ++++++++------ index.ts | 10 +++++----- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/dist/index.js b/dist/index.js index aa15c2d..a6c3a58 100644 --- a/dist/index.js +++ b/dist/index.js @@ -180750,16 +180750,16 @@ function run(name, command, args) { function runEsyCommand(name, args) { return run(name, "esy", manifestKey ? [`@${manifestKey}`, ...args] : args); } +const index_platform = external_os_.platform(); +const arch = external_os_.arch(); function main() { return __awaiter(this, void 0, void 0, function* () { try { const workingDirectory = core.getInput("working-directory") || process.cwd(); external_fs_.statSync(workingDirectory); process.chdir(workingDirectory); - const platform = external_os_.platform(); - const arch = external_os_.arch(); const installPath = ["~/.esy/source"]; - const installKey = `source-${platform}-${arch}-${sourceCacheKey}`; + const installKey = `source-${index_platform}-${arch}-${sourceCacheKey}`; core.startGroup("Restoring install cache"); const installCacheKey = yield cache.restoreCache(installPath, installKey, []); if (installCacheKey) { @@ -180776,8 +180776,8 @@ function main() { .sort() .pop(); const depsPath = [external_path_.join(ESY_FOLDER, esy3, "i")]; - const buildKey = `build-${platform}-${arch}-${cacheKey}`; - const restoreKeys = [`build-${platform}-${arch}-`, `build-`]; + const buildKey = `build-${index_platform}-${arch}-${cacheKey}`; + const restoreKeys = [`build-${index_platform}-${arch}-`, `build-`]; core.startGroup("Restoring build cache"); const buildCacheKey = yield cache.restoreCache(depsPath, buildKey, restoreKeys); if (buildCacheKey) { @@ -180829,7 +180829,9 @@ function prepareNPMArtifacts() { let tarFile = `npm-tarball.tgz`; yield compress("_release", tarFile); const context = github.context; - const { id, size } = yield artifact.uploadArtifact(`npm-${context.job.replace(" ", "_")}`, [tarFile], process.env.GITHUB_WORKSPACE, { + const artifactName = `npm-${context.job.replace(" ", "_")}-${index_platform}-${arch}-${new Date().getTime()}`; + console.log("Artifact name: ", artifactName); + const { id, size } = yield artifact.uploadArtifact(artifactName, [tarFile], process.env.GITHUB_WORKSPACE, { // The level of compression for Zlib to be applied to the artifact archive. // - 0: No compression // - 1: Best speed diff --git a/index.ts b/index.ts index 618074a..42e4658 100644 --- a/index.ts +++ b/index.ts @@ -42,7 +42,7 @@ async function main() { const installCacheKey = await cache.restoreCache( installPath, installKey, - [], + [] ); if (installCacheKey) { console.log("Restored the install cache"); @@ -70,7 +70,7 @@ async function main() { const buildCacheKey = await cache.restoreCache( depsPath, buildKey, - restoreKeys, + restoreKeys ); if (buildCacheKey) { console.log("Restored the build cache"); @@ -113,7 +113,7 @@ async function prepareNPMArtifacts() { const statusCmd = manifestKey ? `esy ${manifestKey} status` : "esy status"; try { const manifestFilePath = JSON.parse( - cp.execSync(statusCmd).toString(), + cp.execSync(statusCmd).toString() ).rootPackageConfigPath; const manifest = JSON.parse(fs.readFileSync(manifestFilePath).toString()); if (manifest.esy.release) { @@ -126,7 +126,7 @@ async function prepareNPMArtifacts() { const context = github.context; const artifactName = `npm-${context.job.replace( " ", - "_", + "_" )}-${platform}-${arch}-${new Date().getTime()}`; console.log("Artifact name: ", artifactName); const { id, size } = await artifact.uploadArtifact( @@ -143,7 +143,7 @@ async function prepareNPMArtifacts() { // optional: how long to retain the artifact // if unspecified, defaults to repository/org retention settings (the limit of this value) retentionDays: 10, - }, + } ); console.log(`Created artifact with id: ${id} (bytes: ${size}`);