File tree Expand file tree Collapse file tree 1 file changed +17
-4
lines changed Expand file tree Collapse file tree 1 file changed +17
-4
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
- - run : yarn install
25
- - run : yarn run build
24
+ - name : Set version number to environment variable
25
+ run : node -p -e '`RELEASED_PACKAGE_VERSION=${require("./package.json").version}`' >> $GITHUB_ENV
26
+ - name : Install node_modules
27
+ run : yarn install
28
+ - name : Create package
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 v${{ env.RELEASED_PACKAGE_VERSION }} -m 'Version ${{ env.RELEASED_PACKAGE_VERSION }}'
41
+ git tag v0 v${{ env.RELEASED_PACKAGE_VERSION }}
42
+ git push origin v${{ env.RELEASED_PACKAGE_VERSION }}
43
+ git push origin v0 --force
You can’t perform that action at this time.
0 commit comments