Skip to content

Commit eba72d6

Browse files
authored
fix: auto publish
1 parent 4659fb8 commit eba72d6

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

.github/workflows/npm-publish.yml

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# This workflow will do a clean installation 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+
name: Publish npm Package
4+
5+
on:
6+
push:
7+
branches:
8+
- master
9+
10+
jobs:
11+
publish-npm:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v3
15+
- uses: actions/setup-node@v3
16+
with:
17+
node-version: 20
18+
registry-url: https://registry.npmjs.org/
19+
- run: git config --global user.name "GitHub CD bot"
20+
- run: git config --global user.email "[email protected]"
21+
- run: npx semantic-release
22+
env:
23+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
24+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
25+
# push the version changes to GitHub
26+
- run: git add package.json && git commit -m'update version' && git push
27+
env:
28+
# The secret is passed automatically. Nothing to configure.
29+
github-token: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)