File tree Expand file tree Collapse file tree 1 file changed +6
-9
lines changed
Expand file tree Collapse file tree 1 file changed +6
-9
lines changed Original file line number Diff line number Diff line change 11name : release
22
33on :
4- workflow_call :
5- # https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions#onworkflow_callinputs
6- inputs :
7- pypi :
8- description : Publish to PyPI registry
9- default : false
10- type : boolean
4+ release :
5+ types : [published]
116
127jobs :
138 pypi :
149 name : Publish to PyPI registry
15- if : " ${{ inputs.pypi }}"
1610 environment : release
1711 runs-on : ubuntu-20.04
1812
2317 TOX_PARALLEL_NO_SPINNER : 1
2418
2519 steps :
26-
2720 - name : Switch to using Python 3.8 by default
2821 uses : actions/setup-python@v2
2922 with :
@@ -44,12 +37,16 @@ jobs:
4437 run : python -m tox
4538
4639 - name : Publish to test.pypi.org
40+ if : >- # "create" workflows run separately from "push" & "pull_request"
41+ github.event_name == 'release'
4742 uses : pypa/gh-action-pypi-publish@master
4843 with :
4944 password : ${{ secrets.testpypi_password }}
5045 repository_url : https://test.pypi.org/legacy/
5146
5247 - name : Publish to pypi.org
48+ if : >- # "create" workflows run separately from "push" & "pull_request"
49+ github.event_name == 'release'
5350 uses : pypa/gh-action-pypi-publish@master
5451 with :
5552 password : ${{ secrets.pypi_password }}
You can’t perform that action at this time.
0 commit comments