-
-
Notifications
You must be signed in to change notification settings - Fork 479
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
Package for npm #124
base: master
Are you sure you want to change the base?
Package for npm #124
Conversation
@@ -0,0 +1,26 @@ | |||
{ | |||
"name": "json-to-go", | |||
"version": "1.0.0", |
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.
or whatever you want
"name": "Matt Holt", | ||
"url": "https://matt.life" |
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.
you can also add your email address
with: | ||
node-version: 20 | ||
registry-url: https://registry.npmjs.org | ||
- run: npm publish --access=public --provenance |
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.
--access=public
is required for the very first time you publish a package, so people wouldn't constantly accidentally publish their packages publicly instead of using their job's own internal package repository or whatever.
--provenance
adds a green checkmark to the release on the npm that links back to the github action that did the publishing
Thanks for this, but... unfortunately I'm not really interested in releasing this on npm (for various reasons). I'll leave this open though in case I change my mind. :) |
I want to use json-to-go in my project and releasing it on npm would make it easy for me to do that.
In order to make this work you have to make an account on npm https://www.npmjs.com/signup generate an Access Token (click on profile picture in the top right) and then add that key as a Secret in the GitHub repo as
NPM_TOKEN
https://github.com/mholt/json-to-go/settings/secrets/actions . After that, when you create a new Release on GitHub https://github.com/mholt/json-to-go/releases/new it should automatically publish to npm.