@@ -2,10 +2,11 @@ name: Release Version
2
2
3
3
on :
4
4
pull_request :
5
- types : [opened, synchronize ]
5
+ types : [closed ]
6
6
7
7
jobs :
8
- request-version :
8
+ check-merge :
9
+ if : github.event.pull_request.merged == true
9
10
runs-on : ubuntu-latest
10
11
11
12
steps :
28
29
})
29
30
30
31
check-version :
32
+ if : github.event.pull_request.merged == true
31
33
runs-on : ubuntu-latest
32
- needs : request-version
34
+ needs : check-merge
33
35
steps :
34
36
- name : Check version bump reaction
35
37
uses : actions/github-script@v6
@@ -53,34 +55,35 @@ jobs:
53
55
console.log(`Version to bump: ${versionType}`);
54
56
core.setOutput('version_type', versionType);
55
57
56
- # release:
57
- # runs-on: ubuntu-latest
58
- # needs: check-version
59
- # steps:
60
- # - name: Checkout code
61
- # uses: actions/checkout@v3
58
+ release :
59
+ if : github.event.pull_request.merged == true
60
+ runs-on : ubuntu-latest
61
+ needs : check-version
62
+ steps :
63
+ - name : Checkout code
64
+ uses : actions/checkout@v3
62
65
63
- # - name: Setup Node.js
64
- # uses: actions/setup-node@v3
65
- # with:
66
- # node-version: '16'
67
- # registry-url: 'https://registry.npmjs.org/'
66
+ - name : Setup Node.js
67
+ uses : actions/setup-node@v3
68
+ with :
69
+ node-version : ' 16'
70
+ registry-url : ' https://registry.npmjs.org/'
68
71
69
- # - name: Install dependencies
70
- # run: yarn install
72
+ - name : Install dependencies
73
+ run : yarn install
71
74
72
- # - name: Bump version
73
- # run: |
74
- # yarn version --${{ needs.check-version.outputs.version_type }}
75
+ - name : Bump version
76
+ run : |
77
+ yarn version --${{ needs.check-version.outputs.version_type }}
75
78
76
- # - name: Build project
77
- # run: yarn build
79
+ - name : Build project
80
+ run : yarn build
78
81
79
- # - name: Publish to NPM
80
- # run: |
81
- # echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc
82
- # yarn publish --non-interactive
82
+ - name : Publish to NPM
83
+ run : |
84
+ echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc
85
+ yarn publish --non-interactive
83
86
84
- # - name: Push changes and tags
85
- # run: |
86
- # git push --follow-tags
87
+ - name : Push changes and tags
88
+ run : |
89
+ git push --follow-tags
0 commit comments