Skip to content

Commit e4e82c8

Browse files
committed
github action - npm publish
1 parent 4308f62 commit e4e82c8

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed

.github/publish.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Publish
2+
3+
on:
4+
release:
5+
types: [created]
6+
7+
jobs:
8+
publish-npm:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v3
12+
- uses: actions/setup-node@v3
13+
with:
14+
node-version: 16
15+
registry-url: https://registry.npmjs.org/
16+
- run: npm ci
17+
- run: npm run release
18+
- run: npm publish
19+
env:
20+
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
"types": "dist/index.d.ts",
1111
"scripts": {
1212
"build": "tsup src/index.ts --format cjs,esm --dts",
13-
"lint": "tsc"
13+
"lint": "tsc",
14+
"release": "npm run lint && npm run build"
1415
},
1516
"dependencies": {
1617
"@apollo/client": "^3.7.4",

0 commit comments

Comments
 (0)