-
Notifications
You must be signed in to change notification settings - Fork 66
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
Publish to GitHub Package Registry #11
Comments
Sounds like this actions/setup-node#52 |
It's failing when I added the setup-node with URL and scope:
I'm going to experiment a little bit using the GH Token in the .npmrc file. |
Quick update, the |
@geoperez have you got any luck with this issue? |
My latest issue is the argument
If I change the |
I also want to publish my packages to GPR, so first off, thanks for making this useful action @mikeal! I'm looking at the code to try to figure out how to set it up, and I think there may be a bug hard coding the registry to npm for when it checks the current version: merge-release/merge-release-run.js Line 11 in 03ebdb0
Should it be changed like this?
|
ah, yes! that does need to get changed :) PR’s welcome :) |
Looks like #17 added the NPM_REGISTRY_URL env var. Here's my set up: - name: Get the publish registry
# Remove this whenandif merge-release can read direcly from the package.json
run: |
echo "::set-env name=NPM_REGISTRY_URL::$(node -p "require('./package.json').publishConfig.registry")"
- name: Publish
uses: mikeal/merge-release@14c90d7780f48402b0797da25ee5644f85f50302 # Change to v4 or newer once he gets the build fixed.
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} However it is behaving rather strangely and dropping the following error when the action runs:
After doing some digging it looks like EDIT:
vs
|
I got this error:
And traced it down to: Line 24 in 8bb6da4
Removing the redundant NPM_REGISTRY_SCHEME from that line fixed my workflow when publishing to GitHub Package registry. Here is my fork: https://github.com/frankdilo/merge-release And my configuration for the workflow:
|
@frankdilo i had exactly same issue as yours. using your fork, it seem to have fixed it, but now i am getting the following: using src directory (package.json) : /github/workspace/ my config:
thoughts? does it work for you? |
@norbinsh consider adding an
|
that did the trick, thank you. |
Seems to be easily achieved using the following configuration (based on above answers).
//npm.pkg.github.com/:_authToken=YOUR_PERSONAL_ACCESS_TOKEN
@YOUR_ORG:registry=https://npm.pkg.github.com
- name: Deploy to GPR 🚀
uses: mikeal/merge-release@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_REGISTRY_URL: https://npm.pkg.github.com/ Also, you need to publish the package manually first, using This issue can probably be closed, seems to work as intended. |
@benwinding Yeah that's not working for me. |
For me neither.
|
Hi,
I've been using this Action for Npm, and it works really great. But I'm having issues trying to publish to GPR. I'm getting the following error:
According to GH Documentation (https://help.github.com/en/github/managing-packages-with-github-packages/configuring-npm-for-use-with-github-packages#authenticating-with-the-github_token), the same
GITHUB_TOKEN
is valid to publish.So, I'm using the following env variables:
I'm using the
.npmrc
file to set the registry URL:Thanks!
The text was updated successfully, but these errors were encountered: