Skip to content

Commit e950ed4

Browse files
committed
ci(bump): auto bump version on push to main
Add a GitHub Actions workflow `version_bump.yml` that automatically runs `cz bump` whenever the main branch is pushed. This includes generating a new version number, updating the changelog, creating a commit and tag. The workflow also pushes the resulting commit and tag back to the main branch, enabling a fully automated versioning process.
1 parent 80f7ded commit e950ed4

1 file changed

Lines changed: 39 additions & 0 deletions

File tree

.github/workflows/version_bump.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Version Bump
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
bump-version:
13+
if: "!contains(github.event.head_commit.message, 'bump:')"
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- name: Checkout code
18+
uses: actions/checkout@v4
19+
20+
- name: Set up Python
21+
uses: actions/setup-python@v5
22+
with:
23+
python-version: 3.x
24+
25+
- name: Install dependencies
26+
run: |
27+
pip install uv
28+
uv tool install commitizen
29+
30+
- name: Run cz bump
31+
run: |
32+
cz bump --yes --changelog
33+
34+
- name: Push bump commit and tag
35+
run: |
36+
git config user.name "github-actions[bot]"
37+
git config user.email "github-actions[bot]@users.noreply.github.com"
38+
git push origin main
39+
git push oigin --tags

0 commit comments

Comments
 (0)