Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,11 @@ jobs:
permissions:
id-token: write
steps:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"

- name: Download wheel artifacts
uses: actions/download-artifact@v4
with:
Expand All @@ -107,5 +112,39 @@ jobs:
path: dist
name: sdist

- name: Validate distribution archives
run: |
python -m pip install --upgrade pip twine
python - <<'PY'
import glob
import zipfile
import sys

wheels = sorted(glob.glob("dist/**/*.whl", recursive=True))
if not wheels:
print("No wheel files found under dist/")
sys.exit(1)

bad = []
for whl in wheels:
try:
with zipfile.ZipFile(whl) as zf:
zf.testzip()
except Exception as exc:
bad.append((whl, repr(exc)))

if bad:
print("Corrupted wheel(s) detected:")
for p, e in bad:
print(f" - {p}: {e}")
sys.exit(1)

print("All wheels passed ZIP integrity check.")
PY
find dist -type f \( -name "*.whl" -o -name "*.tar.gz" \) -print
python -m twine check $(find dist -type f \( -name "*.whl" -o -name "*.tar.gz" \))

- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: dist