From 0d3e3043377db18032c734bf0aa3b61a2ea4d5a2 Mon Sep 17 00:00:00 2001 From: William Barnhart Date: Fri, 17 Jul 2026 03:46:51 +0000 Subject: [PATCH] Fix release artifact upload/download for upload-artifact@v4 #649 bumped upload/download-artifact from v3 to v4 but kept the v3 pattern where every build_wheels matrix leg (and the sdist) uploaded under a shared artifact name and the publish job downloaded a single name. v3 merged same-named uploads; v4 does not -- each upload is its own immutable artifact and uploading the same name again fails. So the three matrix legs collide on 'wheel-artifacts', and the wheel download used pattern '*artifact*' with no path (landing outside dist/, which is what gh-action-pypi-publish publishes from). The last release (v0.11.3) predates #649 and used v3, so this is latent -- the next release would fail to publish or ship incomplete artifacts. Give each uploader a unique name (cibw-wheels-, cibw-sdist), collect them all in the publish job with pattern: cibw-* + merge-multiple into dist/, add skip-existing so re-runs can backfill, and if-no-files-found: error so an empty build fails loudly instead of silently publishing nothing. --- .github/workflows/python-package.yml | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index c196b1fb6..bd3e85eca 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -123,8 +123,9 @@ jobs: uses: pypa/cibuildwheel@v2.10.1 - uses: actions/upload-artifact@v4 with: - name: wheel-artifacts + name: cibw-wheels-${{ matrix.os }} path: ./wheelhouse/*.whl + if-no-files-found: error build_sdist: name: 📦 Build the source distribution runs-on: ubuntu-latest @@ -143,8 +144,9 @@ jobs: - uses: actions/upload-artifact@v4 name: Upload build artifacts with: - name: sdist-artifact + name: cibw-sdist path: dist/*.tar.gz + if-no-files-found: error publish: name: 📦 Publish to PyPI runs-on: ubuntu-latest @@ -154,17 +156,14 @@ jobs: environment: pypi if: github.event_name == 'release' && github.event.action == 'created' steps: - - name: Download the sdist artifact - uses: actions/download-artifact@v4.1.7 + - name: Download all build artifacts (sdist + every wheel) + uses: actions/download-artifact@v4 with: - name: sdist-artifact - path: dist - - name: Download the wheel artifact - uses: actions/download-artifact@v4.1.7 - with: - pattern: "*artifact*" + pattern: cibw-* merge-multiple: true + path: dist - name: Publish package to PyPI uses: pypa/gh-action-pypi-publish@release/v1 with: password: ${{ secrets.PYPI_API_TOKEN }} + skip-existing: true