-
Notifications
You must be signed in to change notification settings - Fork 193
On tag publish with GitHub Actions (GitHub Release + NPM) #334
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for contributing this @dennisameling!
There's at least one blocker on merging and using this, which is why I've had to Request changes
to ensure we don't land this before it'll properly work.
- name: Upload to NPM | ||
run: npm publish --access public | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't currently have access to add additional settings for this repository, so I can't merge this as-is
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Who can set it or grant you access?
4711f9f
to
6ec579d
Compare
@shiftkey I just updated the PR so that it only needs Release: https://github.com/dennisameling/node-keytar/releases As soon as you have enough permissions to add the NPM secret to the repo, this PR should be good to go 👍🏼 have a great weekend! |
Need to rebase, as .travis.yml has been changed. |
4f3073b
to
ceb5059
Compare
Rebased 👍🏼 |
Thanks for the contribution @dennisameling! I plan to do a test release tomorrow to confirm this is all working as expected, before I look at landing some of the newer PRs here... |
Closes #320
✔️ on tag, upload all prebuilds to GitHub
✔️ on tag, and after successful build + prebuild upload, publish version on NPM
The only thing you have to do is to go to the repo settings > Secrets > create a secret called "NPM_AUTH_TOKEN" with a token that you got from https://www.npmjs.com/. The GITHUB_TOKEN is created automatically by GitHub Actions.
You can see it in action at https://github.com/dennisameling/node-keytar/actions/runs/373034035.
GH Release example: https://github.com/dennisameling/node-keytar/releases/tag/v7.2.5-beta
NPM example: https://www.npmjs.com/package/@dennisameling/keytar-temp
When this PR is merged, all you have to do is update the version in
package.json
, thengit tag v7.x.x && git push v7.x.x
, then the pipeline will trigger.I added
npm-publish
as a separate step that depends on thebuild
job, to be sure that all prebuilds have been built and uploaded successfully on all OSes prior to publishing to NPM. This only adds a small overhead which I think is reasonable.