Skip to content

Commit e0a638c

Browse files
Added Manual Publishing with test option
1 parent 633aff1 commit e0a638c

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

.github/workflows/python-publish.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,14 @@
88

99
name: Upload Python Package to PyPI
1010

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
1219

1320
jobs:
1421
build-and-publish:
@@ -35,12 +42,13 @@ jobs:
3542
--outdir dist/
3643
.
3744
- name: Publish distribution to Test PyPI
45+
if: ${{ github.event.inputs.isTest }}
3846
uses: pypa/gh-action-pypi-publish@master
3947
with:
4048
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
4149
repository_url: https://test.pypi.org/legacy/
4250
- name: Publish distribution to PyPI
43-
if: startsWith(github.ref, 'refs/tags')
51+
if: ${{ !github.event.inputs.isTest }} && startsWith(github.ref, 'refs/tags')
4452
uses: pypa/gh-action-pypi-publish@master
4553
with:
4654
password: ${{ secrets.PYPI_API_TOKEN }}

0 commit comments

Comments
 (0)