Skip to content

Commit bfad043

Browse files
authored
Merge pull request #349 from zopefoundation/config-with-c-code-template-2921ca42
Use separate wheel publish step
2 parents 6cd3304 + 5f134d3 commit bfad043

File tree

3 files changed

+40
-21
lines changed

3 files changed

+40
-21
lines changed

.github/workflows/tests.yml

Lines changed: 37 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -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

.meta.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# https://github.com/zopefoundation/meta/tree/master/config/c-code
33
[meta]
44
template = "c-code"
5-
commit-id = "ad3bfb10"
5+
commit-id = "2921ca42"
66

77
[python]
88
with-pypy = true

CHANGES.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
8.2 (unreleased)
66
================
77

8-
- Nothing changed yet.
8+
- Fix the GitHub workflow for publishing wheels, which failed for Linux/arm64.
9+
(`#348 <https://github.com/zopefoundation/zope.interface/issues/348>`_)
910

1011

1112
8.1 (2025-11-10)

0 commit comments

Comments
 (0)