Skip to content
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

Merged
merged 2 commits into from Jun 7, 2023

Conversation

hugovk
Copy link
Member

@hugovk hugovk commented Jun 6, 2023

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.

@hugovk hugovk added the changelog: skip Exclude PR from release draft label Jun 6, 2023
@bwoodsend
Copy link
Collaborator

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?

@hugovk
Copy link
Member Author

hugovk commented Jun 7, 2023

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!

Details
commit 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-commenter
Copy link

Codecov Report

Merging #596 (843697a) into main (b527914) will not change coverage.
The diff coverage is n/a.

❗ Current head 843697a differs from pull request most recent head 3e51d20. Consider uploading reports for the commit 3e51d20 to get more accurate results

❗ 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

@hugovk hugovk merged commit db1138a into ultrajson:main Jun 7, 2023
34 checks passed
@hugovk hugovk deleted the single-pypi-upload branch June 7, 2023 20:24
@hugovk
Copy link
Member Author

hugovk commented Jun 8, 2023

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog: skip Exclude PR from release draft
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants