File tree Expand file tree Collapse file tree 1 file changed +26
-2
lines changed Expand file tree Collapse file tree 1 file changed +26
-2
lines changed Original file line number Diff line number Diff line change 5
5
6
6
name : Publish to PyPI
7
7
8
- on : push
9
-
8
+ on :
9
+ push :
10
+ tags :
11
+ - ' v*' # only publish on version tags (e.g. v1.0.0)
12
+ workflow_dispatch :
13
+ inputs :
14
+ pypi :
15
+ description : ' Publish to PyPi'
16
+ required : true
17
+ default : false
18
+ type : boolean
19
+ github :
20
+ description : ' Publish a GitHub Release'
21
+ required : true
22
+ default : false
23
+ type : boolean
24
+ testpypi :
25
+ description : ' Publish to TestPyPi'
26
+ required : true
27
+ default : true
28
+ type : boolean
29
+
10
30
env :
11
31
PYPI_URL : https://pypi.org/p/django-typer
12
32
PYPI_TEST_URL : https://test.pypi.org/project/django-typer
38
58
publish-to-pypi :
39
59
name : >-
40
60
Publish Python 🐍 distribution 📦 to PyPI
61
+ if : startsWith(github.ref, 'refs/tags/') # only publish on tag pushes
62
+ # if: ${{ (github.event_name == 'workflow_dispatch' && github.event.inputs.pypi == 'true') || github.event_name != 'workflow_dispatch' }}
41
63
needs :
42
64
- build
43
65
runs-on : ubuntu-latest
59
81
name : >-
60
82
Sign the Python 🐍 distribution 📦 with Sigstore
61
83
and upload them to GitHub Release
84
+ if : ${{ (github.event_name == 'workflow_dispatch' && github.event.inputs.github == 'true') || github.event_name != 'workflow_dispatch' }}
62
85
needs :
63
86
- publish-to-pypi
64
87
runs-on : ubuntu-latest
@@ -100,6 +123,7 @@ jobs:
100
123
101
124
publish-to-testpypi :
102
125
name : Publish Python 🐍 distribution 📦 to TestPyPI
126
+ if : ${{ (github.event_name == 'workflow_dispatch' && github.event.inputs.testpypi == 'true') || github.event_name != 'workflow_dispatch' }}
103
127
needs :
104
128
- build
105
129
runs-on : ubuntu-latest
You can’t perform that action at this time.
0 commit comments