Skip to content

Commit

Permalink
Add option to post prereleases to test-pypi
Browse files Browse the repository at this point in the history
  • Loading branch information
Baekalfen committed Oct 19, 2023
1 parent 2dcd103 commit 5a722a0
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion .github/workflows/pr-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
- master
pull_request:
release:
types: [published]
types: [published, prereleased]

jobs:
test_cython:
Expand Down Expand Up @@ -55,6 +55,15 @@ jobs:
python -m twine upload --non-interactive -u '__token__' -p ${{ secrets.PYPI_API_TOKEN }} dist/*.whl
echo "Uploading source code"
python -m twine upload --non-interactive --skip-existing -u '__token__' -p ${{ secrets.PYPI_API_TOKEN }} dist/*.tar.gz
- name: Build and upload wheel [TEST]
if: ${{ github.event_name == 'release' && github.event.action == 'prereleased' && !contains(matrix.os, 'ubuntu') }}
run: |
echo "Building wheel and uploading"
pip install wheel twine
python setup.py sdist bdist_wheel
python -m twine upload --repository testpypi --non-interactive -u '__token__' -p ${{ secrets.PYPI_TEST_API_TOKEN }} dist/*.whl
echo "Uploading source code"
python -m twine upload --repository testpypi --non-interactive --skip-existing -u '__token__' -p ${{ secrets.PYPI_TEST_API_TOKEN }} dist/*.tar.gz
test_pypy:
name: PyPy - Test
Expand Down Expand Up @@ -165,3 +174,9 @@ jobs:
echo "Uploading wheel"
pip install twine
python -m twine upload --non-interactive -u '__token__' -p ${{ secrets.PYPI_API_TOKEN }} dist/*.whl
- name: Upload wheel [TEST]
if: ${{ github.event_name == 'release' && github.event.action == 'prereleased' }}
run: |
echo "Uploading wheel"
pip install twine
python -m twine upload --repository testpypi --non-interactive -u '__token__' -p ${{ secrets.PYPI_TEST_API_TOKEN }} dist/*.whl

0 comments on commit 5a722a0

Please sign in to comment.