Skip to content

Commit

Permalink
CI deploy: Upload all wheels from a single, final job (#596)
Browse files Browse the repository at this point in the history
  • Loading branch information
hugovk authored Jun 7, 2023
2 parents b527914 + 3e51d20 commit db1138a
Showing 1 changed file with 29 additions and 41 deletions.
70 changes: 29 additions & 41 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,25 +58,6 @@ jobs:
name: wheels
path: dist/*.whl

- name: Publish package to PyPI
if: github.event.action == 'published'
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.pypi_password }}
skip-existing: true

- name: Publish package to TestPyPI
if: |
github.repository == 'ultrajson/ultrajson' &&
github.ref == 'refs/heads/main'
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.test_pypi_password }}
repository-url: https://test.pypi.org/legacy/
skip-existing: true

build-QEMU-emulated-wheels:
runs-on: ubuntu-latest
strategy:
Expand Down Expand Up @@ -134,26 +115,7 @@ jobs:
name: wheels
path: dist/*.whl

- name: Publish package to PyPI
if: github.event.action == 'published'
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.pypi_password }}
skip-existing: true

- name: Publish package to TestPyPI
if: |
github.repository == 'ultrajson/ultrajson' &&
github.ref == 'refs/heads/main'
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.test_pypi_password }}
repository-url: https://test.pypi.org/legacy/
skip-existing: true

build-sdist:
build-sdist-and-upload:
runs-on: ubuntu-latest
needs: ['build-native-wheels', 'build-QEMU-emulated-wheels']

Expand All @@ -174,21 +136,47 @@ jobs:
python -m pip install -U pip
python -m pip install -U build twine
- name: Download wheels from build artifacts
uses: actions/download-artifact@v3
with:
name: wheels
path: dist-wheels/

- name: Build package
run: |
git tag
python setup.py --version
python -m build --sdist
twine check --strict dist/*
twine check --strict dist-wheels/*
- name: Publish wheels to PyPI
if: github.event.action == 'published'
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.pypi_password }}
packages-dir: dist-wheels/

- name: Publish package to PyPI
- name: Publish sdist to PyPI
if: github.event.action == 'published'
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.pypi_password }}

- name: Publish package to TestPyPI
- name: Publish wheels to TestPyPI
if: |
github.repository == 'ultrajson/ultrajson' &&
github.ref == 'refs/heads/main'
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.test_pypi_password }}
repository-url: https://test.pypi.org/legacy/
packages-dir: dist-wheels/

- name: Publish sdist to TestPyPI
if: |
github.repository == 'ultrajson/ultrajson' &&
github.ref == 'refs/heads/main'
Expand Down

0 comments on commit db1138a

Please sign in to comment.