-
-
Notifications
You must be signed in to change notification settings - Fork 67
151 lines (130 loc) · 4.25 KB
/
wheels.yml
File metadata and controls
151 lines (130 loc) · 4.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
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