File tree Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Original file line number Diff line number Diff line change 4
4
workflow_dispatch :
5
5
6
6
permissions :
7
- contents : read
7
+ contents : write
8
8
packages : write
9
9
10
10
concurrency :
@@ -21,10 +21,23 @@ jobs:
21
21
with :
22
22
node-version : " 18.16.0"
23
23
registry-url : " https://registry.npmjs.org"
24
+ - name : Set version number to environment variable
25
+ run : |
26
+ node -p -e '`RELEASED_PACKAGE_VERSION=v${require("./package.json").version}`' >> $GITHUB_ENV
27
+ node -p -e '`RELEASED_MAJOR_VERSION=v${require("./package.json").version}`' | awk -F. '{print $1}' >> $GITHUB_ENV
24
28
- run : yarn install
25
29
- run : yarn run build
26
30
env :
27
31
NODE_ENV : " production"
28
- - run : yarn publish --access public
32
+ - name : Publish package
33
+ run : yarn publish --access public
29
34
env :
30
35
NODE_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
36
+ - name : Create version tag
37
+ run : |
38
+ git config --global user.name 'github-actions[bot]'
39
+ git config --global user.email '41898282+github-actions[bot]@users.noreply.github.com'
40
+ git tag -a ${{ env.RELEASED_PACKAGE_VERSION }} -m 'Release ${{ env.RELEASED_PACKAGE_VERSION }}'
41
+ git tag -f ${{ env.RELEASED_MAJOR_VERSION }} ${{ env.RELEASED_PACKAGE_VERSION }}
42
+ git push origin ${{ env.RELEASED_PACKAGE_VERSION }}
43
+ git push -f origin ${{ env.RELEASED_MAJOR_VERSION }}
You can’t perform that action at this time.
0 commit comments