@@ -240,20 +240,6 @@ jobs:
240240 with :
241241 name : zope.interface-${{ runner.os }}-${{ matrix.python-version }}.whl
242242 path : dist/*whl
243- - name : Publish package to PyPI (Non-Linux)
244- # We cannot use pypa/gh-action-pypi-publish because that
245- # is a container action, and those don't run on macOS
246- # or Windows GHA runners.
247- if : >
248- github.event_name == 'push'
249- && startsWith(github.ref, 'refs/tags')
250- && !startsWith(runner.os, 'Linux')
251- && !startsWith(matrix.python-version, 'pypy')
252- && !startsWith(matrix.python-version, '3.15')
253- env :
254- TWINE_PASSWORD : ${{ secrets.TWINE_PASSWORD }}
255- run : |
256- twine upload --skip-existing dist/*
257243
258244 test :
259245 needs : build-package
@@ -602,13 +588,45 @@ jobs:
602588 - name : Prevent publishing wheels for unreleased Python versions
603589 run : VER=$(echo '3.15' | tr -d .) && ls -al wheelhouse && sudo rm -f wheelhouse/*-cp${VER}*.whl && ls -al wheelhouse
604590
605- - name : Publish package to PyPI
591+ publish :
592+ name : Publish to PyPI
593+ runs-on : ubuntu-latest
594+ # Only publish on tag pushes
595+ if : github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
596+ # Wait for both build jobs to complete
597+ needs : [build-package, manylinux]
598+ permissions :
599+ contents : read
600+
601+ steps :
602+ - name : Download all wheel artifacts
603+ uses : actions/download-artifact@v4
604+ with :
605+ path : dist/
606+ pattern : ' *'
607+ merge-multiple : true
608+
609+ - name : Display structure of downloaded files
610+ run : |
611+ ls -lR dist/
612+ echo "Total wheel files:"
613+ find dist/ -name "*.whl" | wc -l
614+
615+ - name : Remove PyPy wheels (if any were downloaded)
616+ run : |
617+ # PyPy wheels shouldn't be uploaded, remove them if present
618+ find dist/ -name "*pypy*" -type f -delete || true
619+
620+ - name : Remove wheels for future Python (if any were downloaded)
621+ run : |
622+ # Wheels for the no-yet-supported future Python version need to go
623+ find dist/ -name "*3.15*" -type f -delete || true
624+
625+ - name : Publish to PyPI
606626 uses : pypa/gh-action-pypi-publish@release/v1
607- if : >
608- github.event_name == 'push'
609- && startsWith(github.ref, 'refs/tags')
610627 with :
611628 user : __token__
612629 password : ${{ secrets.TWINE_PASSWORD }}
613630 skip-existing : true
614- packages-dir : wheelhouse/
631+ packages-dir : dist/
632+ verbose : true
0 commit comments