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 44 workflow_dispatch :
55
66permissions :
7- contents : read
7+ contents : write
88 packages : write
99
1010concurrency :
@@ -21,10 +21,23 @@ jobs:
2121 with :
2222 node-version : " 18.16.0"
2323 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
2428 - run : yarn install
2529 - run : yarn run build
2630 env :
2731 NODE_ENV : " production"
28- - run : yarn publish --access public
32+ - name : Publish package
33+ run : yarn publish --access public
2934 env :
3035 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