-
Notifications
You must be signed in to change notification settings - Fork 33
109 lines (95 loc) · 3.27 KB
/
Copy pathpython-wheels.yml
File metadata and controls
109 lines (95 loc) · 3.27 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
name: Build Python wheels
on:
workflow_dispatch:
inputs:
publish_to_pypi:
description: Publish the six validated wheels to the deme project on PyPI
required: true
type: boolean
default: false
pull_request:
paths:
- ".github/workflows/python-wheels.yml"
- "CMakeLists.txt"
- "cmake/**"
- "pyproject.toml"
- "VERSION"
- "src/**"
- "thirdparty/**"
push:
tags:
- "v*"
permissions:
contents: read
jobs:
build-linux-wheels:
name: ${{ matrix.python }} / CUDA 12.9 / manylinux_2_28 x86_64
runs-on: ubuntu-24.04
timeout-minutes: 120
strategy:
fail-fast: false
matrix:
python: [cp39, cp310, cp311, cp312, cp313, cp314]
steps:
- name: Check out source and bundled dependencies
uses: actions/checkout@v6
with:
persist-credentials: false
submodules: recursive
- name: Build and repair wheel
uses: pypa/cibuildwheel@v4.1.1
env:
CIBW_BUILD: ${{ matrix.python }}-manylinux_x86_64
CIBW_MANYLINUX_X86_64_IMAGE: quay.io/manylinux_cuda/manylinux_2_28_x86_64_cuda12_9:latest
- name: Validate wheel metadata and native platform tag
shell: bash
run: |
python -m pip install --disable-pip-version-check twine auditwheel
python -m twine check wheelhouse/*.whl
python -m auditwheel show wheelhouse/*.whl
python - <<'PY'
from pathlib import Path
from zipfile import ZipFile
wheels = list(Path("wheelhouse").glob("*.whl"))
if len(wheels) != 1:
raise SystemExit(f"Expected exactly one wheel, found: {wheels}")
wheel = wheels[0]
expected_python = "${{ matrix.python }}"
if expected_python not in wheel.name or "manylinux_2_28_x86_64" not in wheel.name:
raise SystemExit(f"Unexpected wheel tags: {wheel.name}")
with ZipFile(wheel) as archive:
bundled_cuda = [
member
for member in archive.namelist()
if ".libs/" in member
and any(library in member for library in ("libcuda", "libcudart", "libnvrtc"))
]
if bundled_cuda:
raise SystemExit(f"CUDA libraries must remain external: {bundled_cuda}")
print(f"Validated {wheel.name} ({wheel.stat().st_size / 1024 / 1024:.1f} MiB)")
PY
- name: Upload wheel artifact
uses: actions/upload-artifact@v4
with:
name: deme-${{ matrix.python }}-manylinux_2_28-x86_64
path: wheelhouse/*.whl
if-no-files-found: error
retention-days: 14
publish-pypi:
name: Publish deme wheels to PyPI
if: github.event_name == 'workflow_dispatch' && inputs.publish_to_pypi
needs: build-linux-wheels
runs-on: ubuntu-24.04
environment: pypi
permissions:
contents: read
id-token: write
steps:
- name: Download validated wheel artifacts
uses: actions/download-artifact@v4
with:
pattern: deme-*-manylinux_2_28-x86_64
path: dist
merge-multiple: true
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1