File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change 8
8
9
9
name : Upload Python Package to PyPI
10
10
11
- on : push
11
+ on :
12
+ workflow_dispatch :
13
+ inputs :
14
+ isTest :
15
+ description : Should the package be pushed to TestPyPI?
16
+ type : boolean
17
+ required : false
18
+ default : false
12
19
13
20
jobs :
14
21
build-and-publish :
@@ -35,12 +42,13 @@ jobs:
35
42
--outdir dist/
36
43
.
37
44
- name : Publish distribution to Test PyPI
45
+ if : ${{ github.event.inputs.isTest }}
38
46
uses : pypa/gh-action-pypi-publish@master
39
47
with :
40
48
password : ${{ secrets.TEST_PYPI_API_TOKEN }}
41
49
repository_url : https://test.pypi.org/legacy/
42
50
- name : Publish distribution to PyPI
43
- if : startsWith(github.ref, 'refs/tags')
51
+ if : ${{ !github.event.inputs.isTest }} && startsWith(github.ref, 'refs/tags')
44
52
uses : pypa/gh-action-pypi-publish@master
45
53
with :
46
54
password : ${{ secrets.PYPI_API_TOKEN }}
You can’t perform that action at this time.
0 commit comments