0x80 / isolate-package

Isolate a monorepo package with its internal dependencies to form a self-contained directory with a pruned lockfile
MIT License
121 stars 13 forks source link

Github Actions Failing #10

Closed woutervroege closed 1 year ago

woutervroege commented 1 year ago

Thanks for this great package @0x80!

Unfortunately I keep having a critical error when deploying using Github actions. Locally isolate-package is working like a charm. However, using Github CI crashed because it cannot file a packages (.tgz) file.

@packages/server:deploy: Error: ENOENT: no such file or directory, open 'api-4.1.1.tgz' @packages/server:deploy:  ELIFECYCLE  Command failed with exit code 1. @packages/server:deploy: ERROR: command finished with error: command (/my/private/path) pnpm run deploy exited (1)

I am kinda stuck here. Would you know what is going on?

//isolate.config.json { "buildDirName": "./", "excludeLockfile": true }

0x80 commented 1 year ago

@woutervroege Your config looks odd to me. The buildDirName is supposed to be only a name, not a path. Hopefully that solves something... I haven't yet tried Github actions myself with isolate-package.

0x80 commented 1 year ago

@woutervroege did you figure it out eventually? If not, maybe you could share some code?

0x80 commented 1 year ago

@woutervroege I ran into a scenario where this was happening. It was the result of pnpm v7.3.0 that apparently doesn't have a reliable pack executable. I have changed the code so that npm pack is used if the pnpm version is below 8.

In addition I have implemented a fallback / wait mechanism where the unpack is waiting for a few seconds for the file to become available. This should not be needed and will probably be stripped later, but it's in there now anyway.

Please upgrade to 1.3.0 and let me know if it worked for you.

The debug logging is now also more complete, so if you set logLevel to "debug" in your isolate.config.json file, you should see a detailed analysis of what's going on.

0x80 commented 1 year ago

I'm going to assume this is solved, but feel free to reopen if you have additional findings