File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11{
22 "commitizen" : {
33 "name" : " cz_nhm" ,
4- "version" : " 0.10.1" ,
54 "tag_format" : " v$version" ,
6- "update_changelog_on_bump" : true ,
75 "changelog_incremental" : true ,
86 "version_provider" : " npm" ,
9- "major_version_zero" : true
7+ "major_version_zero" : true ,
8+ "changelog_merge_prerelease" : true
109 }
1110}
Original file line number Diff line number Diff line change 11name : Build dist (dev/patch)
22
33on :
4- pull_request :
5- types :
6- - closed
4+ push :
75 branches :
86 - dev
97 - patch
1210 build-dist :
1311 name : Build dist package
1412 runs-on : ubuntu-latest
15- if : github.event.pull_request.merged == true
13+ if : " !startsWith( github.event.head_commit.message, 'chore(dist):') "
1614 steps :
1715 - name : Checkout source code
1816 uses : actions/checkout@v4
2826 uses : EndBug/add-and-commit@v9
2927 with :
3028 add : dist
31- message : ' chore: build dist package'
29+ message : ' chore(dist) : build dist package'
Original file line number Diff line number Diff line change 1+ name : Bump version (prerelease)
2+
3+ on :
4+ push :
5+ branches :
6+ - dev
7+
8+ jobs :
9+ bump-and-release :
10+ name : Create prerelease
11+ runs-on : ubuntu-latest
12+ if : " startsWith(github.event.head_commit.message, 'chore(dist):')"
13+ steps :
14+ - name : Checkout source code
15+ uses : actions/checkout@v4
16+ with :
17+ token : ${{ secrets.PERSONAL_ACCESS_TOKEN }}
18+ fetch-depth : 0
19+ - name : Create bump
20+ uses : commitizen-tools/commitizen-action@master
21+ with :
22+ github_token : ${{ secrets.PERSONAL_ACCESS_TOKEN }}
23+ changelog_increment_filename : CURRENT.md
24+ extra_requirements : ' cz-nhm'
25+ prerelease : alpha
26+ changelog : false
27+ - name : Release
28+ uses : softprops/action-gh-release@v2
29+ with :
30+ body_path : ' CURRENT.md'
31+ tag_name : v${{ env.REVISION }}
32+ prerelease : true
33+ target_commitish : dev
34+ env :
35+ GITHUB_TOKEN : ${{ secrets.PERSONAL_ACCESS_TOKEN }}
Original file line number Diff line number Diff line change 66 - main
77
88jobs :
9- build-then-bump :
10- name : Build dist package , bump version, create changelog
9+ bump-and-release :
10+ name : Build, bump, and create main release
1111 runs-on : ubuntu-latest
1212 if : " !startsWith(github.event.head_commit.message, 'bump:')"
1313 steps :
@@ -28,16 +28,17 @@ jobs:
2828 uses : EndBug/add-and-commit@v9
2929 with :
3030 add : dist
31- message : ' chore: build dist package'
31+ message : ' chore(dist) : build dist package'
3232 push : false
3333 - name : Create bump and changelog
3434 uses : commitizen-tools/commitizen-action@master
3535 with :
3636 github_token : ${{ secrets.PERSONAL_ACCESS_TOKEN }}
3737 changelog_increment_filename : CURRENT.md
3838 extra_requirements : ' cz-nhm'
39+ changelog : true
3940 - name : Release
40- uses : softprops/action-gh-release@v1
41+ uses : softprops/action-gh-release@v2
4142 with :
4243 body_path : ' CURRENT.md'
4344 tag_name : v${{ env.REVISION }}
Original file line number Diff line number Diff line change 1+ name : Upload NPM Package (dev)
2+
3+ on :
4+ release :
5+ types :
6+ - published
7+
8+ jobs :
9+ deploy :
10+ name : Publish to NPM
11+ runs-on : ubuntu-latest
12+ if : " github.event.release.prerelease"
13+ steps :
14+ - name : Checkout source code
15+ uses : actions/checkout@v4
16+ with :
17+ token : ${{ secrets.PERSONAL_ACCESS_TOKEN }}
18+ fetch-depth : 0
19+ - name : Install node
20+ uses : actions/setup-node@v4
21+ with :
22+ node-version : 20
23+ registry-url : ' https://registry.npmjs.org'
24+ - name : Publish package
25+ run : npm publish --tag dev
26+ env :
27+ NODE_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
Original file line number Diff line number Diff line change 99 deploy :
1010 name : Publish to NPM
1111 runs-on : ubuntu-latest
12+ if : " !github.event.release.prerelease"
1213 steps :
1314 - name : Checkout source code
1415 uses : actions/checkout@v4
You can’t perform that action at this time.
0 commit comments