File tree Expand file tree Collapse file tree 1 file changed +29
-7
lines changed
Expand file tree Collapse file tree 1 file changed +29
-7
lines changed Original file line number Diff line number Diff line change 1- name : Upload Python Package
1+ name : Python Package Release
2+
23on :
34 push :
45 branches :
56 - main
7+ workflow_dispatch :
8+
69permissions :
710 contents : write
811 id-token : write
912 actions : write
1013 packages : write
14+
1115jobs :
1216 release :
1317 runs-on : ubuntu-latest
18+
1419 steps :
15- - name : Checkout main branch
20+ - name : Checkout code
1621 uses : actions/checkout@v4
1722 with :
1823 fetch-depth : 0
24+
1925 - name : Set up Python
2026 uses : actions/setup-python@v3
2127 with :
2228 python-version : " 3.x"
29+
2330 - name : Install dependencies
2431 run : |
2532 python -m pip install --upgrade pip
2633 pip install build twine python-semantic-release setuptools-scm
27- - name : Run semantic-release
34+
35+ - name : Configure Git for semantic-release
36+ run : |
37+ git config --local user.name "github-actions"
38+ git config --local user.email "github-actions@github.com"
39+
40+ - name : Run semantic-release (version & changelog)
2841 env :
2942 GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
3043 run : |
31- git config user.name github-actions
32- git config user.email github-actions@github.com
3344 semantic-release version
3445 semantic-release publish
35- - name : Build package
46+
47+ - name : Build the package
3648 run : python -m build
37- - name : Publish package to PyPI
49+
50+ - name : Publish to PyPI
3851 env :
3952 TWINE_USERNAME : __token__
4053 TWINE_PASSWORD : ${{ secrets.PYPI_API_TOKEN }}
4154 run : twine upload dist/*
55+
56+ - name : Raise PR from main to master
57+ uses : peter-evans/create-pull-request@v5
58+ with :
59+ base : master
60+ head : main
61+ title : " Release PR: main → master"
62+ body : " Merges release changes from main into master"
63+ branch : pr-main-to-master
You can’t perform that action at this time.
0 commit comments