File tree Expand file tree Collapse file tree 1 file changed +38
-0
lines changed
Expand file tree Collapse file tree 1 file changed +38
-0
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,17 @@ name: Publish on PyPI
22on :
33 release :
44 types : [published]
5+ workflow_dispatch :
6+ inputs :
7+ candidate :
8+ description : ' Release candidate.'
9+ required : true
10+ type : boolean
11+ default : true
12+ test_pypi :
13+ description : ' Test PyPi.'
14+ type : boolean
15+ default : false
516jobs :
617 pypi :
718 name : PyPI Release
4051 make package
4152 - name : Publish a Python distribution to PyPI
4253 uses : pypa/gh-action-pypi-publish@release/v1
54+ with :
55+ repository-url : ${{ inputs.test_pypi && 'https://test.pypi.org/legacy/' || 'https://upload.pypi.org/legacy/' }}
56+
57+ - name : Bump version to next candidate
58+ if : ${{ inputs.candidate && !inputs.test_pypi }}
59+ run : |
60+ git config user.name "github-actions[bot]"
61+ git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
62+ make bumpversion-candidate
63+
64+ - name : Create pull request
65+ id : cpr
66+ uses : peter-evans/create-pull-request@v4
67+ with :
68+ token : ${{ secrets.GH_ACCESS_TOKEN }}
69+ commit-message : bumpversion-candidate
70+ title : Automated Bump Version Candidate
71+ body : " This is an auto-generated PR that bumps the version to the next candidate."
72+ branch : bumpversion-candidate-update
73+ branch-suffix : short-commit-hash
74+ base : main
75+
76+ - name : Enable Pull Request Automerge
77+ if : ${{ steps.cpr.outputs.pull-request-operation == 'created' }}
78+ run : gh pr merge "${{ steps.cpr.outputs.pull-request-number }}" --squash --auto
79+ env :
80+ GH_TOKEN : ${{ secrets.GH_ACCESS_TOKEN }}
You can’t perform that action at this time.
0 commit comments