-
-
Couldn't load subscription status.
- Fork 489
Package for npm #124
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
base: master
Are you sure you want to change the base?
Package for npm #124
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| name: Node.js CI | ||
|
|
||
| on: | ||
| push: | ||
| branches: [master] | ||
| pull_request: | ||
| branches: [master] | ||
|
|
||
| jobs: | ||
| test: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v3 | ||
| - name: Use Node.js | ||
| uses: actions/setup-node@v3 | ||
| with: | ||
| node-version: 20 | ||
| - run: npm test |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| name: Publish Package to npm | ||
| on: | ||
| release: | ||
| types: | ||
| - released | ||
| jobs: | ||
| build: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v3 | ||
| - uses: actions/setup-node@v3 | ||
| with: | ||
| node-version: 20 | ||
| registry-url: https://registry.npmjs.org | ||
| - run: npm publish --access=public --provenance | ||
| env: | ||
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| .github | ||
|
|
||
| json-to-go.test.js | ||
| sample.json |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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 commentThe reason will be displayed to describe this comment to others. Learn more. or whatever you want |
||
| "description": "convert JSON to Go struct", | ||
| "homepage": "https://mholt.github.io/json-to-go/", | ||
| "author": { | ||
| "name": "Matt Holt", | ||
| "url": "https://matt.life" | ||
|
Comment on lines
+7
to
+8
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. you can also add your email address |
||
| }, | ||
| "repository": { | ||
| "type": "git", | ||
| "url": "https://github.com/mholt/json-to-go.git" | ||
| }, | ||
| "license": "MIT", | ||
| "keywords": [ | ||
| "json", | ||
| "go", | ||
| "golang" | ||
| ], | ||
| "main": "json-to-go.js", | ||
| "dependencies": {}, | ||
| "devDependencies": {}, | ||
| "scripts": { | ||
| "test": "node json-to-go.test.js" | ||
| } | ||
| } | ||
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=publicis 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.--provenanceadds a green checkmark to the release on the npm that links back to the github action that did the publishing