Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
ManasJayanth committed May 20, 2024
1 parent 3cfcfe4 commit 444f3af
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
14 changes: 8 additions & 6 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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) {
Expand Down Expand Up @@ -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
Expand Down
10 changes: 5 additions & 5 deletions index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ async function main() {
const installCacheKey = await cache.restoreCache(
installPath,
installKey,
[],
[]
);
if (installCacheKey) {
console.log("Restored the install cache");
Expand Down Expand Up @@ -70,7 +70,7 @@ async function main() {
const buildCacheKey = await cache.restoreCache(
depsPath,
buildKey,
restoreKeys,
restoreKeys
);
if (buildCacheKey) {
console.log("Restored the build cache");
Expand Down Expand Up @@ -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) {
Expand All @@ -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(
Expand All @@ -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}`);
Expand Down

0 comments on commit 444f3af

Please sign in to comment.