File tree Expand file tree Collapse file tree 1 file changed +63
-0
lines changed Expand file tree Collapse file tree 1 file changed +63
-0
lines changed Original file line number Diff line number Diff line change
1
+ name : " Release New Version"
2
+
3
+ on :
4
+ workflow_dispatch :
5
+
6
+ permissions :
7
+ contents : write
8
+
9
+ jobs :
10
+ publish :
11
+ name : " Publish to NPM"
12
+ runs-on : ubuntu-latest
13
+
14
+ steps :
15
+ - name : " Checkout source code"
16
+ uses : actions/checkout@v2
17
+
18
+ - name : " Set up Node.js"
19
+ uses : actions/setup-node@v3
20
+ with :
21
+ node-version : 22.x
22
+ registry-url : " https://registry.npmjs.org/"
23
+
24
+ - name : " Install dependencies"
25
+ run : npm ci
26
+
27
+ - name : " Build package"
28
+ run : npm run build
29
+
30
+ - name : " Set Git user name and email"
31
+ run : |
32
+ git config --global user.name "github-actions"
33
+ git config --global user.email "[email protected] "
34
+
35
+ - name : " Bump patch version"
36
+ run : npm version patch
37
+
38
+ - name : " Get new version"
39
+ id : get_version
40
+ run : echo "version=v$(node -p "require('./package.json').version")" >> $GITHUB_OUTPUT
41
+
42
+ - name : " Push version bump commit and tag"
43
+ run : |
44
+ git push origin HEAD
45
+ git push origin --tags
46
+
47
+ - name : " Publish to NPM"
48
+ run : npm publish --access public
49
+ env :
50
+ NODE_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
51
+
52
+ - name : " Create GitHub Release"
53
+ uses : actions/create-release@v1
54
+ with :
55
+ tag_name : ${{ steps.get_version.outputs.version }}
56
+ release_name : Release ${{ steps.get_version.outputs.version }}
57
+ body : |
58
+ ```
59
+ • See CHANGELOG.md for details
60
+ • Published by ${{ github.actor }}
61
+ ```
62
+ env :
63
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
You can’t perform that action at this time.
0 commit comments