File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ on :
2+ push :
3+ branches :
4+ - main
5+
6+ jobs :
7+ bump :
8+ runs-on : ubuntu-latest
9+ permissions :
10+ contents : write
11+ actions : write
12+ steps :
13+ - uses : actions/checkout@v5
14+ with :
15+ fetch-depth : 0
16+ fetch-tags : true
17+ - name : Set up git config
18+ run : |
19+ git config --global user.name "github-actions[bot]"
20+ git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
21+ - uses : actions/setup-cz@main
22+ - id : bump-version
23+ run : |
24+ cz bump --yes
25+ current_version="v$(cz version -p --current)"
26+ major_version="v$(cz version -p --major)"
27+ echo "current_version=$current_version" >> $GITHUB_OUTPUT
28+ echo "major_version=$major_version" >> $GITHUB_OUTPUT
29+ - name : Update major tag
30+ env :
31+ CURRENT_VERSION : ${{ steps.bump-version.outputs.current_version }}
32+ MAJOR_VERSION : ${{ steps.bump-version.outputs.major_version }}
33+ run : |
34+ # Push new commit + new tag
35+ git push --follow-tags
36+
37+ # Move major tag to the latest commit
38+ git tag -fa "${MAJOR_VERSION}" -m "release ${CURRENT_VERSION}"
39+
40+ # Force push new major tag
41+ git push origin "${MAJOR_VERSION}" -f
42+ - name : Build changelog
43+ env :
44+ CURRENT_VERSION : ${{ steps.bump-version.outputs.current_version }}
45+ run : |
46+ cz changelog --dry-run "${CURRENT_VERSION}" > .changelog.md
47+ - name : Release
48+ uses : softprops/action-gh-release@v2
49+ with :
50+ body_path : " .changelog.md"
51+ tag_name : ${{ steps.bump-version.outputs.current_version }}
52+ env :
53+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
You can’t perform that action at this time.
0 commit comments