Skip to content

Commit 145971b

Browse files
committed
build: add publish workflow
1 parent 27ada69 commit 145971b

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

.github/workflows/ci.yml

+26
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,29 @@ jobs:
2323
- run: npm ci
2424
- run: npm run build --if-present
2525
- run: npm test
26+
27+
publish:
28+
name: npm-publish
29+
runs-on: ubuntu-latest
30+
needs: ['test']
31+
steps:
32+
- uses: actions/checkout@v3
33+
- uses: actions/setup-node@v3
34+
with:
35+
node-version: 18
36+
- run: npm install
37+
- id: publish
38+
uses: JS-DevTools/npm-publish@v1
39+
with:
40+
token: ${{ secrets.NPM_TOKEN }}
41+
- name: Create Release
42+
if: steps.publish.outputs.type != 'none'
43+
uses: actions/create-release@v1
44+
env:
45+
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
46+
with:
47+
tag_name: v${{ steps.publish.outputs.version }}
48+
release_name: v${{ steps.publish.outputs.version }}
49+
body: v${{ steps.publish.outputs.version }}
50+
draft: false
51+
prerelease: false

0 commit comments

Comments
 (0)