New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CI deploy: Upload all wheels from a single, final job #596
Conversation
Could we split the upload step to upload wheels then the sdist - again to prevent there being that (admittedly much shorter) interval where sdists are available but not the wheels so for people installing ujson during that interval, pip installs from source? |
Sure. I expect the sdist .tar.gz would normally be uploaded last because its last in the alphabetical list, but can be certain by splitting. I've pushed this but GitHub is having some problems right now - https://www.githubstatus.com/incidents/1g1gkh0qpyvs - hopefully it will show up at some point! Detailscommit 3e51d20c21a28d2fbd3b11a8bb946784b1d77b2b
Author: Hugo van Kemenade <hugovk@users.noreply.github.com>
Date: Wed Jun 7 19:58:06 2023 +0300
Upload wheels before the sdist
diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml
index d2c4221..9227ca2 100644
--- a/.github/workflows/deploy.yml
+++ b/.github/workflows/deploy.yml
@@ -140,7 +140,7 @@ jobs:
uses: actions/download-artifact@v3
with:
name: wheels
- path: dist/
+ path: dist-wheels/
- name: Build package
run: |
@@ -148,15 +148,35 @@ jobs:
python setup.py --version
python -m build --sdist
twine check --strict dist/*
+ twine check --strict dist-wheels/*
- - name: Publish package to PyPI
+ - 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 TestPyPI
+ - 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 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' |
Codecov Report
❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more. @@ Coverage Diff @@
## main #596 +/- ##
=======================================
Coverage 91.66% 91.66%
=======================================
Files 6 6
Lines 1944 1944
=======================================
Hits 1782 1782
Misses 162 162 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
Follow on from #594 (comment).
We can't use https://github.com/pypa/gh-action-pypi-publish to upload from macOS or Windows, so download all wheels in the final job and upload them all at the same time as the sdist.