Skip to content

Commit ec3cf54

Browse files
authored
Update python-package.yml
1 parent 1f0909c commit ec3cf54

File tree

1 file changed

+20
-19
lines changed

1 file changed

+20
-19
lines changed

.github/workflows/python-package.yml

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -140,8 +140,27 @@ jobs:
140140
with:
141141
path: ./dist/*
142142

143+
upload_pypi:
144+
needs: [build_wheels, build_sdist]
145+
runs-on: ubuntu-latest
146+
if: github.event.inputs.upload_to_pypi == 'true'
147+
steps:
148+
- uses: actions/download-artifact@v3
149+
with:
150+
name: artifact
151+
path: dist
152+
153+
- name: List Build contents
154+
run: ls -l dist
155+
156+
- uses: pypa/gh-action-pypi-publish@release/v1
157+
with:
158+
user: __token__
159+
password: ${{ secrets.PYPI_TOKEN }}
160+
skip_existing: true
161+
143162
create_release:
144-
needs: [extract_version, build_wheels, build_sdist]
163+
needs: [extract_version, build_wheels, build_sdist, upload_pypi]
145164
runs-on: ubuntu-latest
146165
if: github.event.inputs.create_release == 'true'
147166
steps:
@@ -172,21 +191,3 @@ jobs:
172191
env:
173192
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
174193

175-
upload_pypi:
176-
needs: [build_wheels, build_sdist]
177-
runs-on: ubuntu-latest
178-
if: github.event.inputs.upload_to_pypi == 'true'
179-
steps:
180-
- uses: actions/download-artifact@v3
181-
with:
182-
name: artifact
183-
path: dist
184-
185-
- name: List Build contents
186-
run: ls -l dist
187-
188-
- uses: pypa/gh-action-pypi-publish@release/v1
189-
with:
190-
user: __token__
191-
password: ${{ secrets.PYPI_TOKEN }}
192-
skip_existing: true

0 commit comments

Comments
 (0)