Skip to content

Commit

Permalink
actions: also publish to testpypi
Browse files Browse the repository at this point in the history
As described in [1], publish every commit to testpypi and only publish
tags to main pypi.

[1]: https://packaging.python.org/en/latest/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/#publishing-the-distribution-to-pypi-and-testpypi

Signed-off-by: Rouven Czerwinski <[email protected]>
  • Loading branch information
Emantor committed Jan 25, 2023
1 parent 84a464d commit 6ee8970
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion .github/workflows/build-and-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,14 @@ jobs:
- name: Build sdist
run: |
python -m build -s
- name: Publish package
- name: Publish distribution 📦 to Test PyPI
uses: pypa/gh-action-pypi-publish@release/v1
if: startsWith(github.ref, 'refs/tags') != true
with:
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository_url: https://test.pypi.org/legacy/
- name: Publish distribution 📦 to PyPI
if: startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}

0 comments on commit 6ee8970

Please sign in to comment.