Skip to content

Commit 263ec56

Browse files
committed
prepare CI for PyPi
1 parent 917073f commit 263ec56

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

.github/workflows/python.yaml

+4-3
Original file line numberDiff line numberDiff line change
@@ -172,8 +172,6 @@ jobs:
172172
needs: [build-python-sdist, build-test-python-wheel]
173173
runs-on: ubuntu-latest
174174
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v')
175-
env:
176-
PYPI_API_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
177175
steps:
178176
- uses: actions/checkout@v2
179177
- name: Download python-dist artifact
@@ -185,9 +183,11 @@ jobs:
185183
run: ls -R
186184
working-directory: dist
187185
- name: Publish distribution to PyPI
188-
if: env.PYPI_API_TOKEN != null
186+
env:
187+
PYPI_API_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
189188
uses: pypa/gh-action-pypi-publish@release/v1
190189
with:
190+
user: __token__
191191
password: ${{ secrets.PYPI_API_TOKEN }}
192192
publish-release-artifacts:
193193
name: Publish Release Artifacts to GitHub
@@ -215,6 +215,7 @@ jobs:
215215
env:
216216
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
217217
with:
218+
prerelease: ${{ contains(github.event.ref, '-pre') || contains(github.event.ref, '-alpha') || contains(github.event.ref, '-beta') || contains(github.event.ref, '-rc') }}
218219
files: |
219220
*.tar.gz
220221

0 commit comments

Comments
 (0)