1
- name : Prepare release
2
- on :
3
- push :
4
- branches : ['main']
1
+ name : Release
2
+ on : workflow_dispatch
3
+
5
4
jobs :
6
- prepare_release :
5
+ release :
7
6
runs-on : ubuntu-latest
8
7
steps :
9
8
- name : Check out repository code
@@ -12,30 +11,32 @@ jobs:
12
11
fetch-depth : 0
13
12
ref : main
14
13
token : ${{ secrets.GIT_ACCESS_TOKEN }}
15
- - name : Check if we already released
16
- run : |
17
- if git log -1 --pretty=%B | grep -qE "^chore\(release\)"; then
18
- echo "ALREADY_RELEASED=true" >> "$GITHUB_ENV"
19
- echo "Already released, other steps should cancel"
20
- fi
21
14
- name : Deps
22
- if : env.ALREADY_RELEASED != 'true'
23
15
run : npm ci
24
16
- name : Tests
25
- if : env.ALREADY_RELEASED != 'true'
26
17
run : npm run test:coverage
27
18
- name : Generating coverage badges
28
- if : env.ALREADY_RELEASED != 'true'
29
19
uses : jpb06/jest-badges-action@latest
30
20
with :
31
21
branches : main
32
22
no-commit : true
33
23
- name : Bump and changelog using commitizen
34
- if : env.ALREADY_RELEASED != 'true'
35
24
run : |
36
25
git add badges
37
- git config --local user.email "github-actions@github.com "
38
- git config --local user.name " github-actions"
26
+ git config user.name "github-actions[bot] "
27
+ git config user.email "41898282+ github-actions[bot]@users.noreply.github.com "
39
28
npm run version:bump
40
29
git push -f
41
30
git push --tags
31
+ - name : Publish to NPM
32
+ run : npm publish
33
+ env :
34
+ NODE_AUTH_TOKEN : ${{secrets.npm_token}}
35
+ - name : GitHub release
36
+ uses : softprops/action-gh-release@v1
37
+ with :
38
+ draft : false
39
+ body_path : CHANGELOG.md
40
+ name : ${{ steps.version.outputs.version }}
41
+ tag_name : ${{ github.ref }}
42
+ token : ${{ github.token }}
0 commit comments