Skip to content

Commit 90ebbba

Browse files
committed
added auto publish workflow
1 parent bf5b8b3 commit 90ebbba

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

.github/workflows/publish-node.js.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# This workflow will do a clean install of node dependencies, cache/restore them, build the source code and run tests across different versions of node
2+
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
3+
4+
name: Publish
5+
6+
on:
7+
release:
8+
types: [published]
9+
jobs:
10+
publish:
11+
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- uses: actions/checkout@v2
16+
with:
17+
ref: ${{ github.event.release.target_commitish }}
18+
- uses: actions/setup-node@v2
19+
with:
20+
node-version: 16
21+
cache: 'npm'
22+
- run: git config --global user.name "GitHub CD bot"
23+
- run: git config --global user.email "[email protected]"
24+
- run: npm version ${{ github.event.release.tag_name }}
25+
- uses: JS-DevTools/npm-publish@v1
26+
with:
27+
token: ${{ secrets.NPM_TOKEN }}
28+
29+
# push the version changes to GitHub
30+
- run: git push
31+
env:
32+
# The secret is passed automatically. Nothing to configure.
33+
github-token: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)