Skip to content

Commit fddab8b

Browse files
committed
Pulling out build_wheels.yml version that was working the best.
1 parent 69c7192 commit fddab8b

File tree

1 file changed

+38
-33
lines changed

1 file changed

+38
-33
lines changed

.github/workflows/build_wheels.yml

Lines changed: 38 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
name: Build wheels
22

3-
on: [push, pull_request]
4-
5-
# Cannot use cibuildwheels because the current images used by cibuildwheels do not support C++17.
3+
on: [push, pull_request]
64

75
jobs:
86
build_wheels_windows:
@@ -11,21 +9,17 @@ jobs:
119
env:
1210
TEMP: C:\Temp
1311
TMP: C:\Temp
14-
12+
1513
strategy:
1614
matrix:
1715
os: [windows-2022]
1816
arch: [x86, x64]
19-
python-version: [3.9, "3.10", "3.11", "3.12", "3.13"]
17+
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
2018

21-
steps:
19+
steps:
2220
- name: Support longpaths
2321
run: git config --system core.longpaths true
24-
25-
- name: Check LongPathsEnabled
26-
run: |
27-
(Get-ItemProperty "HKLM:System\CurrentControlSet\Control\FileSystem").LongPathsEnabled
28-
22+
2923
- name: Checkout repository
3024
uses: actions/checkout@v4
3125

@@ -37,28 +31,24 @@ jobs:
3731

3832
- name: Install packages
3933
run: |
40-
pip install wheel
41-
pip install setuptools
42-
pip install build
34+
pip install wheel setuptools build
4335
4436
- name: build
4537
run: python -m build
4638

4739
- name: upload wheels
4840
uses: actions/upload-artifact@v4
4941
with:
42+
name: wheels-windows-${{ matrix.python-version }}-${{ matrix.arch }}-${{ github.run_id }}
5043
path: ./dist/*.whl
51-
44+
5245
build_wheels_mac:
5346
name: ${{ matrix.os }} ${{ matrix.python-version }} wheels
5447
runs-on: ${{ matrix.os }}
5548
strategy:
5649
matrix:
57-
# Trying to use cibuildwheels to build mac wheels fails because the version of XCode is not high enough.
58-
# There is documentation here https://github.com/pypa/cibuildwheel/blob/main/docs/cpp_standards.md on how to
59-
# set it but I could not get it to work while using the standard images provided by github actions does work.
6050
os: [macos-latest, macos-13]
61-
python-version: [3.9, "3.10", "3.11", "3.12", "3.13"]
51+
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
6252
env:
6353
SYSTEM_VERSION_COMPAT: 0
6454

@@ -73,25 +63,25 @@ jobs:
7363

7464
- name: Install packages
7565
run: |
76-
pip install wheel
77-
pip install setuptools
78-
pip install build
66+
pip install wheel setuptools build
7967
8068
- name: build
8169
run: python -m build
8270

8371
- name: upload wheels
8472
uses: actions/upload-artifact@v4
8573
with:
74+
name: wheels-macos-${{ matrix.os }}-${{ matrix.python-version }}-${{ github.run_id }}
8675
path: ./dist/*.whl
87-
76+
77+
8878
build_wheels_manylinux_x86_64:
89-
name: Build manylinux wheels
79+
name: Build manylinux wheels (x86_64)
9080
runs-on: ubuntu-24.04
9181
steps:
9282
- name: Checkout repository
9383
uses: actions/checkout@v4
94-
84+
9585
- name: Install cibuildwheel
9686
run: |
9787
python -m pip install --upgrade pip
@@ -102,44 +92,59 @@ jobs:
10292
CIBW_PLATFORM: "linux"
10393
CIBW_SKIP: "cp36-* cp37-* cp38-*"
10494
CIBW_ARCHS_LINUX: "x86_64"
95+
CIBW_MANYLINUX_X86_64_IMAGE: "quay.io/pypa/manylinux_2_28_x86_64"
96+
CIBW_BUILD_VERBOSITY: 3 # Enable detailed logging
10597
run: |
10698
cibuildwheel --output-dir wheelhouse
107-
99+
108100
- name: upload wheels
109101
uses: actions/upload-artifact@v4
110102
with:
103+
name: wheels-linux-x86_64-${{ github.run_id }}
111104
path: wheelhouse/*.whl
112-
105+
113106
build_wheels_manylinux_arm64:
114-
name: Build manylinux wheels ${{ matrix.python-version }} (arm64)
107+
name: Build manylinux wheels (ARM64)
115108
runs-on: ubuntu-24.04
116109
strategy:
117110
matrix:
118111
python-version: ["cp39-*", "cp310-*", "cp311-*", "cp312-*", "cp313-*"]
119112
steps:
120113
- name: Checkout repository
121114
uses: actions/checkout@v4
122-
115+
123116
# Register QEMU for cross-architecture emulation
124117
- name: Set up QEMU for cross-compilation
125118
uses: docker/setup-qemu-action@v2
126119
with:
127-
platforms: arm64
128-
120+
platforms: all # Ensures ARM64 is fully supported
121+
122+
- name: Debug - Test ManyLinux Container
123+
run: |
124+
echo "Testing uname -a inside the container..."
125+
docker run --rm --platform linux/aarch64 quay.io/pypa/manylinux_2_28_aarch64 uname -a
126+
127+
echo "Testing Python inside the container..."
128+
docker run --rm --platform linux/aarch64 quay.io/pypa/manylinux_2_28_aarch64 python3 --version
129+
129130
- name: Install cibuildwheel
130131
run: |
131132
python -m pip install --upgrade pip
132133
pip install cibuildwheel
133-
134+
134135
- name: Build wheels with cibuildwheel
135136
env:
136137
CIBW_PLATFORM: "linux"
137138
CIBW_BUILD: ${{ matrix.python-version }}
138139
CIBW_ARCHS_LINUX: "aarch64"
140+
CIBW_MANYLINUX_AARCH64_IMAGE: "quay.io/pypa/manylinux_2_28_aarch64"
141+
CIBW_ENVIRONMENT: "CXXFLAGS='-g -O2 -fno-omit-frame-pointer'"
142+
CIBW_BUILD_VERBOSITY: 3
139143
run: |
140144
cibuildwheel --output-dir wheelhouse
141-
145+
142146
- name: upload wheels
143147
uses: actions/upload-artifact@v4
144148
with:
149+
name: wheels-linux-arm64-${{ matrix.python-version }}-${{ github.run_id }}
145150
path: wheelhouse/*.whl

0 commit comments

Comments
 (0)