Skip to content

update versions

update versions #16

Workflow file for this run

name: Build and Publish Wheels
on:
pull_request:
push:
branches: [main]
tags: ["v*"]
release:
types: [published]
workflow_dispatch:
jobs:
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
- os: windows-latest
- os: macos-latest
- os: macos-15
steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
submodules: recursive
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.13"
- name: Build wheels
uses: pypa/cibuildwheel@v3.3.0
env:
CIBW_BUILD_VERBOSITY: "1"
CIBW_BUILD: "cp38-* cp39-* cp310-* cp311-* cp312-* cp313-* cp314-*"
CIBW_SKIP: "*-musllinux_* pp* cp38-macosx_arm64"
CIBW_ARCHS_LINUX: "x86_64"
CIBW_ARCHS_WINDOWS: "AMD64"
CIBW_ARCHS_MACOS: "auto64"
CIBW_TEST_COMMAND: "python -c \"import seal; print(seal.__version__)\""
CIBW_BEFORE_BUILD: >
python -m pip install --upgrade pip cmake &&
cmake -S SEAL -B SEAL/build -DSEAL_USE_MSGSL=OFF -DSEAL_USE_ZLIB=OFF -DSEAL_USE_ZSTD=OFF &&
cmake --build SEAL/build --config Release &&
python -c "import glob; print('SEAL libs:', glob.glob('SEAL/build/**/*.lib', recursive=True)[:50])"
- name: Upload wheel artifacts
uses: actions/upload-artifact@v7
with:
name: wheels-${{ matrix.os }}
path: wheelhouse/*.whl
build_sdist:
name: Build sdist
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
submodules: recursive
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.13"
- name: Install build tools
run: python -m pip install --upgrade pip build cmake
- name: Build SEAL static libs
run: |
cmake -S SEAL -B SEAL/build -DSEAL_USE_MSGSL=OFF -DSEAL_USE_ZLIB=OFF -DSEAL_USE_ZSTD=OFF
cmake --build SEAL/build --config Release
- name: Build source distribution
run: python -m build --sdist
- name: Upload sdist artifact
uses: actions/upload-artifact@v7
with:
name: sdist
path: dist/*.tar.gz
publish_pypi:
name: Publish to PyPI
needs: [build_wheels, build_sdist]
runs-on: ubuntu-latest
if: github.event_name == 'release' && github.event.action == 'published'
permissions:
id-token: write
steps:
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.13"
- name: Download wheel artifacts
uses: actions/download-artifact@v8
with:
path: dist
pattern: wheels-*
merge-multiple: true
- name: Download sdist artifact
uses: actions/download-artifact@v8
with:
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@v1.13.0
with:
packages-dir: dist
skip-existing: true