File tree Expand file tree Collapse file tree 1 file changed +6
-33
lines changed
Expand file tree Collapse file tree 1 file changed +6
-33
lines changed Original file line number Diff line number Diff line change 1- name : Bump Version and Publish to PyPI
1+ name : Publish to PyPI
22
33on :
4- workflow_dispatch :
5- inputs :
6- bump_type :
7- description : ' Version bump type'
8- required : true
9- default : ' patch'
10- type : choice
11- options :
12- - patch
13- - minor
14- - major
4+ push :
5+ tags :
6+ - ' v*'
157
168jobs :
17- bump-and- release :
18- name : Bump Version and Publish to PyPI
9+ release :
10+ name : Publish to PyPI
1911 runs-on : ubuntu-latest
2012 environment : pypi
2113 permissions :
2214 id-token : write
23- contents : write
2415 steps :
2516 - uses : actions/checkout@v4
26- with :
27- token : ${{ secrets.GITHUB_TOKEN }}
2817
2918 - name : Install uv and setup Python
3019 uses : astral-sh/setup-uv@v3
3120
32- - name : Bump version
33- run : |
34- uv version --bump ${{ inputs.bump_type }}
35- NEW_VERSION=$(uv version --short)
36- echo "NEW_VERSION=$NEW_VERSION" >> $GITHUB_ENV
37-
38- - name : Commit version bump
39- run : |
40- git config --local user.email "action@github.com"
41- git config --local user.name "GitHub Action"
42- git add pyproject.toml uv.lock
43- git commit -m "Bump version to ${{ env.NEW_VERSION }}"
44- git tag "v${{ env.NEW_VERSION }}"
45- git push origin master
46- git push origin "v${{ env.NEW_VERSION }}"
47-
4821 - name : Build package
4922 run : uv build
5023
You can’t perform that action at this time.
0 commit comments