Skip to content

Commit

Permalink
Separate pypi and test-pypi upload
Browse files Browse the repository at this point in the history
  • Loading branch information
ifduyue committed Jul 6, 2024
1 parent ecd2c7c commit 30a9841
Showing 1 changed file with 23 additions and 3 deletions.
26 changes: 23 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,16 @@ jobs:
path: dist/*.tar.gz


upload_pypi:
name: Upload to (Test) PyPI
upload_test_pypi:
name: Upload to Test PyPI
needs: [build_wheels, build_sdist]
runs-on: ubuntu-20.04
if: github.event_name == 'push' && github.repository == 'ifduyue/python-xxhash'
if: github.event_name == 'push' && github.repository == 'ifduyue/python-xxhash' && !startsWith(github.ref, 'refs/tags/v')
permissions:
id-token: write
environment:
name: test-pypi
url: https://test.pypi.org/project/xxhash/
steps:
- uses: actions/download-artifact@v4
with:
Expand All @@ -100,6 +103,23 @@ jobs:
skip_existing: true
repository_url: https://test.pypi.org/legacy/

upload_pypi:
name: Upload to PyPI
needs: [build_wheels, build_sdist]
runs-on: ubuntu-20.04
if: github.event_name == 'push' && github.repository == 'ifduyue/python-xxhash' && startsWith(github.ref, 'refs/tags/v')
environment:
name: pypi
url: https://pypi.org/project/xxhash/
permissions:
id-token: write
steps:
- uses: actions/download-artifact@v4
with:
pattern: wheels-*
path: dist
merge-multiple: true

- name: Upload to PyPI
if: startsWith(github.ref, 'refs/tags/v')
uses: pypa/[email protected]
Expand Down

0 comments on commit 30a9841

Please sign in to comment.