-
Notifications
You must be signed in to change notification settings - Fork 0
143 lines (124 loc) · 4.4 KB
/
build-wheels.yml
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
name: build-wheels
on:
workflow_run:
workflows: ["run-tests"]
types:
- completed
branches: [main]
jobs:
build-macos-wheels:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
name: Build wheels on ${{ matrix.os }}-cp${{ matrix.python }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest]
python: ["3.9", "3.10", "3.11", "3.12", "3.13"]
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install "pybind11[global]"
pip install cibuildwheel
- name: Build wheels
run: |
PYTHON_VERSION=$(echo "${{ matrix.python }}" | tr -d '.')
export CIBW_BUILD="cp${PYTHON_VERSION}-*"
echo "CIBW_BUILD: $CIBW_BUILD"
python -m cibuildwheel
env:
CIBW_BUILD_VERBOSITY: 1
CIBW_SKIP: "*-win32 *-manylinux_i686 pp*"
- name: Store the wheels
uses: actions/upload-artifact@v4
with:
name: wheels-${{ matrix.os }}-${{ matrix.python }}
path: ./wheelhouse/*.whl
compression-level: 0
- name: List uploaded artifacts
run: |
pwd
echo "Current directory contents:"
ls -R ./wheelhouse/
build-win-wheels:
name: Build wheels on ${{ matrix.os }}-cp${{ matrix.python }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-latest]
python: ["3.9", "3.10", "3.11", "3.12", "3.13"]
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install "pybind11[global]"
pip install cibuildwheel
- name: Build wheels
shell: pwsh
run: |
# Set Python version for CIBW_BUILD
$PYTHON_VERSION = "${{ matrix.python }}" -replace '\.'
$env:CIBW_BUILD = "cp${PYTHON_VERSION}-*"
Write-Host "CIBW_BUILD: $env:CIBW_BUILD"
python -m cibuildwheel
env:
CIBW_BUILD_VERBOSITY: 1
CIBW_SKIP: "*-win32 *-manylinux* *-musllinux* pp*"
- name: Store the wheels
uses: actions/upload-artifact@v4
with:
name: wheels-${{ matrix.os }}-${{ matrix.python }}
path: .\wheelhouse\*.whl
compression-level: 0
- name: List uploaded artifacts
shell: pwsh
run: |
Write-Host "Current directory contents:"
Get-ChildItem -Recurse .\wheelhouse\
build-linux-wheels:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
name: Build wheels on manylinux_2_28_x86_64-cp${{ matrix.python }}
runs-on: ubuntu-latest
strategy:
matrix:
python: ["3.11"] # development python not supported
steps:
- uses: actions/checkout@v4
- name: Run tests in manylinux container
uses: addnab/docker-run-action@v3
with:
image: quay.io/pypa/manylinux_2_28_x86_64
options: -v ${{ github.workspace }}:/pyember
run: |
yum install -y python3-devel
yum install -y epel-release
yum install -y python3.11-devel
# Set python paths
PYTHON_VERSION=$(echo "${{ matrix.python }}" | tr -d '.')
PYSHORT="${{ matrix.python }}"
export PYROOT="/opt/python/cp${PYTHON_VERSION}-cp${PYTHON_VERSION}"
export PATH="${PYROOT}/bin:$PATH"
${PYROOT}/bin/python -m pip install --upgrade pip
export PYTHON_EXECUTABLE="${PYROOT}/bin/python"
export PYTHON_INCLUDE_DIR="${PYROOT}/include/python${PYSHORT}"
export Python_ROOT_DIR="${PYROOT}"
${PYROOT}/bin/pip install "pybind11[global]"
${PYROOT}/bin/pip install cibuildwheel
export CIBW_BUILD="cp${PYTHON_VERSION}-*"
cd /pyember
python -m cibuildwheel
- name: List uploaded artifacts
run: |
pwd
echo "Current directory contents:"
ls -R ./wheelhouse/