Skip to content

Commit 975f83b

Browse files
committed
Package for npm
1 parent 086b5b2 commit 975f83b

File tree

3 files changed

+61
-0
lines changed

3 files changed

+61
-0
lines changed

.github/workflows/ci.yml

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: Node.js CI
2+
3+
on:
4+
push:
5+
branches: [master]
6+
pull_request:
7+
branches: [master]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v3
14+
- name: Use Node.js
15+
uses: actions/setup-node@v3
16+
with:
17+
node-version: 20
18+
- run: npm test

.github/workflows/publish.yml

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: Publish Package to npm
2+
on:
3+
release:
4+
types:
5+
- released
6+
jobs:
7+
build:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v3
11+
- uses: actions/setup-node@v3
12+
with:
13+
node-version: 20
14+
registry-url: https://registry.npmjs.org
15+
- run: npm publish --access=public --provenance
16+
env:
17+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

package.json

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"name": "json-to-go",
3+
"version": "1.0.0",
4+
"description": "convert JSON to Go struct",
5+
"homepage": "https://mholt.github.io/json-to-go/",
6+
"author": {
7+
"name": "Matt Holt",
8+
"url": "https://matt.life"
9+
},
10+
"repository": {
11+
"type": "git",
12+
"url": "https://github.com/mholt/json-to-go.git"
13+
},
14+
"license": "MIT",
15+
"keywords": [
16+
"json",
17+
"go",
18+
"golang"
19+
],
20+
"main": "json-to-go.js",
21+
"dependencies": {},
22+
"devDependencies": {},
23+
"scripts": {
24+
"test": "node json-to-go.test.js"
25+
}
26+
}

0 commit comments

Comments
 (0)