Skip to content

Commit 035c88f

Browse files
authored
Fix pypi-release workflow, allow for manual run (#2771)
1 parent 467e026 commit 035c88f

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

.github/workflows/pypi-release.yml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ name: Publish to PyPI
22
on:
33
push:
44
tags: ["*"] # this will run full workflow including publish to PyPI
5+
workflow_dispatch:
56

67
jobs:
78
build:
@@ -10,19 +11,19 @@ jobs:
1011
artifact-name: package
1112

1213
publish:
13-
# only run this for tags
14-
if: startsWith(github.event.ref, 'refs/tags/')
1514
needs: [build]
1615
runs-on: ubuntu-latest
1716
steps:
1817
- uses: actions/download-artifact@v3
1918
with:
2019
name: package
2120
path: dist
21+
- name: Install twine
22+
run: pip install -q twine
2223
- name: Publish 📦 to PyPI
23-
run: |
24-
pip install -q twine
25-
twine upload dist/*
26-
with:
27-
user: __token__
28-
password: ${{ secrets.pypi_password }}
24+
# only run this for tags
25+
if: startsWith(github.event.ref, 'refs/tags/')
26+
env:
27+
TWINE_USERNAME: __token__
28+
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
29+
run: twine upload dist/*

0 commit comments

Comments
 (0)