File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11name : Publish to PyPI
22
33on :
4- release :
5- types : [published]
6- # Optional: allow manual triggers
74 workflow_dispatch :
5+ inputs :
6+ bump_type :
7+ description : ' Version bump type'
8+ required : true
9+ type : choice
10+ options :
11+ - patch
12+ - minor
13+ - major
814
915jobs :
10- publish :
11- name : Publish to PyPI
16+ release :
1217 runs-on : ubuntu-latest
13-
18+
1419 permissions :
1520 # IMPORTANT: this permission is mandatory for trusted publishing
1621 id-token : write
17- contents : read
22+ contents : write
1823
1924 steps :
2025 - name : Checkout code
2126 uses : actions/checkout@v4
27+ with :
28+ fetch-depth : 0 # Full history for proper versioning
2229
2330 - name : Install uv
2431 uses : astral-sh/setup-uv@v6
2835 - name : Set up Python
2936 run : uv python install 3.13
3037
38+ - name : Bump version
39+ run : |
40+ uv version --bump ${{ github.event.inputs.bump_type }}
41+ NEW_VERSION=$(uv version --short)
42+ echo "NEW_VERSION=$NEW_VERSION" >> $GITHUB_ENV
43+
44+ - name : Commit version bump
45+ run : |
46+ git config user.name "github-actions[bot]"
47+ git config user.email "github-actions[bot]@users.noreply.github.com"
48+ git add pyproject.toml uv.lock
49+ git commit -m "chore: bump version to ${{ env.NEW_VERSION }}"
50+ git tag "v${{ env.NEW_VERSION }}"
51+ git push origin main
52+ git push origin "v${{ env.NEW_VERSION }}"
53+
3154 - name : Build package
3255 run : uv build
3356
You can’t perform that action at this time.
0 commit comments