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

Package for npm #124

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Package for npm #124

wants to merge 1 commit into from

Conversation

verhovsky
Copy link
Contributor

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.

@@ -0,0 +1,26 @@
{
"name": "json-to-go",
"version": "1.0.0",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

or whatever you want

Comment on lines +7 to +8
"name": "Matt Holt",
"url": "https://matt.life"
Copy link
Contributor Author

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
Copy link
Contributor Author

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

@mholt
Copy link
Owner

mholt commented Mar 6, 2024

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. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants