Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Runtime error: PKG_INVALID_ZIP Invalid package. #89

Open
1 task done
dmitrif opened this issue Sep 29, 2021 · 3 comments
Open
1 task done

Runtime error: PKG_INVALID_ZIP Invalid package. #89

dmitrif opened this issue Sep 29, 2021 · 3 comments
Labels
bug Something isn't working

Comments

@dmitrif
Copy link

dmitrif commented Sep 29, 2021

Issue

  • I have searched the issues of this repository and believe that this is not a duplicate.

Your Environment

  • semantic-release-chrome version: 1.1.3
  • node version: 16.6.1
  • npm version: 7.20.3

Relevant code or config

  "release": {
    "branches": [
      "main"
    ],
    "plugins": [
      "@semantic-release/release-notes-generator",
      [
        "semantic-release-chrome",
        {
          "asset": "asset.zip",
          "extensionId": "XXX"
        }
      ],
      [
        "@semantic-release/github",
        {
          "assets": [
            "asset.zip"
          ]
        }
      ]
    ]
  },

What you did and problem description

Running with above configuration results in the following error, failing the rest of the release steps:

Invalid package. Please make sure it is a valid zip file and the file manifest.json is at the root directory of the zip package.

Upon further inspection, it seems like the archived asset file contains the entire working directory instead of just the dist folder contents.

Theory: It seems like the path resolution points to a non-existent folder, and the archiver falls back to current folder.

What happened

[6:02:33 AM] [semantic-release] › ✖  PKG_INVALID_ZIP Invalid package. Please make sure it is a valid zip file and the file manifest.json is at the root directory of the zip package.
AggregateError: 
    SemanticReleaseError: Invalid package. Please make sure it is a valid zip file and the file manifest.json is at the root directory of the zip package.
        at /home/runner/work/xx/xx/node_modules/semantic-release-chrome/dist/publish.js:52:29
        at Array.forEach (<anonymous>)
        at publish (/home/runner/work/xx/xx/node_modules/semantic-release-chrome/dist/publish.js:51:25)
        at runMicrotasks (<anonymous>)
        at async validator (/home/runner/work/xx/xx/node_modules/semantic-release/lib/plugins/normalize.js:34:24)
        at async /home/runner/work/xx/xx/node_modules/semantic-release/lib/plugins/pipeline.js:37:34
        at async Promise.all (index 0)
        at async next (/home/runner/work/xx/xx/node_modules/p-reduce/index.js:16:18)
    at publish (/home/runner/work/xx/xx/node_modules/semantic-release-chrome/dist/publish.js:55:11)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
    at async validator (/home/runner/work/xx/xx/node_modules/semantic-release/lib/plugins/normalize.js:34:24)
    at async /home/runner/work/xx/xx/node_modules/semantic-release/lib/plugins/pipeline.js:37:34
    at async Promise.all (index 0)
    at async next (/home/runner/work/xx/xx/node_modules/p-reduce/index.js:16:18)
  • archived asset file contains the entire working directory instead of just the dist folder contents.

Suggested solution

  • Fix path resolution for the archive step to deflate the correct folder.
@GabeDuarteM GabeDuarteM added the bug Something isn't working label Jul 5, 2022
@GabeDuarteM
Copy link
Owner

Hey 👋👋

Thats weird, I've been using it for a few extensions and its been working normally...

Some questions:

  • Do you maybe have a minimal repo where this problem happens?
  • Is the build folder ./dist?

@mormubis
Copy link

Hey @GabrielDuarteM, I had the same issue as the issue author.

I forked the project and removed this line. It worked :\

I am not sure the reason, but it worked

@DannyAziz
Copy link

Also getting this problem all of a sudden, was working fine for ages and just stopped working today

RupertBarrow added a commit to RupertBarrow/semantic-release-chrome that referenced this issue Jul 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants