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

Unable To Publish To Github Package Registry !! #14

Closed
varunsridharan opened this issue Sep 28, 2020 · 9 comments
Closed

Unable To Publish To Github Package Registry !! #14

varunsridharan opened this issue Sep 28, 2020 · 9 comments
Labels
more info needed More information is needed to resolve the issue

Comments

@varunsridharan
Copy link

I have tried to use this action to publish in Github Package Registry .

but it keeps failing

here is the action log
https://github.com/varunsridharan/npm-proxy/runs/1177247171?check_suite_focus=true

Note i did merge #12 in my fork and did a small change but still can't get it to work.

Changes I did : g-actions@5a1378e

@JamesMessinger
Copy link
Member

@varunsridharan - I can't access the GitHub repo that you linked to, so I can't view the log. Can you post it here instead? Also, can you be sure to enable debug logging in GitHub Actions so it includes more details, please?

@JamesMessinger JamesMessinger added the more info needed More information is needed to resolve the issue label Oct 1, 2020
@varunsridharan
Copy link
Author

varunsridharan commented Oct 1, 2020

@JamesMessinger sorry about that. well i was working on trying to things working. so deleted the repo and keep working
And finally got it work just making a small change even after merging #12

please check this commit : g-actions/npm-publish@5a1378e

https://s2.do-spaces.com/2020/Oct/01/1601549707-126.jpg

@varunsridharan
Copy link
Author

@JamesMessinger and also i found that we can't publish scoped npm packages using this action for that i changed

and i was able to get things working with scoped package by making below changes

- let command = options.dryRun ? [ "publish","--dry-run" ] : ["publish" ];
+ let command = options.dryRun ? [ "publish","--dry-run","--access","public" ] : ["publish","--access","public" ];

@JamesMessinger
Copy link
Member

@varunsridharan - The bug with it not publishing a new package should be fixed now. I've merged PR #12 which effectively does the same thing as your workaround.

The action does work with scoped NPM packages, but NPM defaults to making scoped packages private, which requires a paid account. A workaround would be to add an access option to the GitHub Action, which would allow overriding the default package access (using the --access argument).

@varunsridharan
Copy link
Author

well even after merging #12 pull request it did not work when new package is published so i had to make a small change
please check this commit : g-actions/npm-publish@5a1378e

@JamesMessinger
Copy link
Member

It looks like you modified the dist folder directly, rather than re-building from src.

@varunsridharan
Copy link
Author

yes i did !!

@JamesMessinger
Copy link
Member

@varunsridharan - I just published version 1.4.0, which adds an access input parameter (which gets passed to NPM's --access argument). This should satisfy your needs and resolve all the issues you mentioned above.

@nikitaeverywhere
Copy link
Contributor

nikitaeverywhere commented Oct 29, 2020

@JamesMessinger @varunsridharan

Hello! The author of #12 here. Turns out, not only you can make a wrong PR but also a wrong test for a wrong PR that all seem valid :D But the issue is quite strange itself: I spend around an hour of debugging in a dance to figure out what's wrong.

Let's start with #12 - this was incorrect, because NPM returns the exit status code 1, and turns out ezSpawn.async throws in this case.

When I understood it, I fixed it to return the exit code 1 in a test and moved this to a catch clause. However, perhaps of the way how npm.mock works, ezSpawn didn't throw the error but exited with stderr property just normally... (which is different from what happens if I run it by node v14) And otherwise this didn't pass other tests (f.e. "throw when NPM throws an error")!

So I found the only working magic combination of the code to satisfy both the test and a real state of things which I am contributing now by #19.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
more info needed More information is needed to resolve the issue
Projects
None yet
Development

No branches or pull requests

3 participants