11# Build all the artifacts for a release (i.e. the source distribution file and the various wheels)
2+ # https://docs.github.com/en/actions/using-jobs/choosing-the-runner-for-a-job
3+ # https://raw.githubusercontent.com/actions/python-versions/main/versions-manifest.json
4+ # https://cibuildwheel.readthedocs.io/en/stable/options/#options-summary
25
36name : Build the release artifacts
47
@@ -11,81 +14,172 @@ jobs:
1114 runs-on : ubuntu-latest
1215
1316 steps :
14- - uses : actions/checkout@v4
17+ - uses : actions/checkout@v4.3.0
1518
1619 - name : Install Python dependencies
17- run : |
18- python -m pip install --upgrade pip build
20+ run : python -m pip install --upgrade pip build
1921
2022 - name : Build sdist
21- run : python -m build --sdist --no-isolation
23+ run : python -m build --sdist
2224
2325 - name : Upload sdist
24- uses : actions/upload-artifact@v4
26+ uses : actions/upload-artifact@v4.6.2
2527 with :
26- name : sdist_ ${{ github.sha }}
28+ name : sdist__ ${{ github.sha }}
2729 path : ./dist/*.gz
2830
29- build_wheels :
30- name : Build wheels on ${{ matrix.os }}
31- runs-on : ${{ matrix.os }}
32- strategy :
33- matrix :
34- # https://docs.github.com/en/actions/using-jobs/choosing-the-runner-for-a-job
35- # https://raw.githubusercontent.com/actions/python-versions/main/versions-manifest.json
36- os : [windows-2019, macos-11, ubuntu-22.04]
31+ build_windows_x86_wheels :
32+ name : Build wheels on Windows x86_64
33+ runs-on : windows-2022
3734
3835 steps :
39- - uses : actions/checkout@v4
36+ - uses : actions/checkout@v4.3.0
4037
41- - name : Set up QEMU
42- # QEMU is needed for Linux aarch64 wheels
43- if : runner.os == 'Linux'
44- uses : docker/setup-qemu-action@v3
38+ - name : Build wheels
39+ uses : pypa/cibuildwheel@v3.2.1
40+ env :
41+ CIBW_ARCHS_WINDOWS : " AMD64 x86"
42+ # AMD64 and Intel32 wheels
43+ CIBW_BUILD : " cp*-win_amd64 cp*-win32"
44+
45+ - name : Upload wheels
46+ uses : actions/upload-artifact@v4.6.2
4547 with :
46- platforms : all
48+ name : wheels_windows_x86_64__${{ github.sha }}
49+ path : ./wheelhouse/*.whl
50+
51+ build_windows_arm64_wheels :
52+ name : Build wheels on Windows ARM64
53+ runs-on : windows-11-arm
54+
55+ steps :
56+ - uses : actions/checkout@v4.3.0
4757
4858 - name : Build wheels
49- uses : pypa/cibuildwheel@v2.19.2
50- # https://cibuildwheel.readthedocs.io/en/stable/options/#options-summary
59+ uses : pypa/cibuildwheel@v3.2.1
5160 env :
52- # Windows - both 64-bit and 32-bit builds
53- CIBW_ARCHS_WINDOWS : " AMD64 x86 "
61+ CIBW_ARCHS_WINDOWS : " ARM64 "
62+ CIBW_BUILD : " cp*-win_arm64 "
5463
55- # macOS
56- #
57- # At the time of this writing, Github actions still do not support ARM macs - all
58- # runners are Intel. You can cross-compile on Intel to ARM, however, which is good
59- # enough us.
60- #
61- # https://cibuildwheel.readthedocs.io/en/stable/faq/#how-to-cross-compile
64+ - name : Upload wheels
65+ uses : actions/upload-artifact@v4.6.2
66+ with :
67+ name : wheels_windows_arm64__${{ github.sha }}
68+ path : ./wheelhouse/*.whl
6269
63- CIBW_ARCHS_MACOS : x86_64 arm64
70+ build_ubuntu_manylinux_wheels :
71+ name : Build wheels on Ubuntu manylinux
72+ runs-on : ubuntu-22.04
6473
65- CIBW_REPAIR_WHEEL_COMMAND_MACOS : " "
66- # Disable the inclusion of unixODBC dylibs because they will be *Intel* ones.
67- # Unfortunately, this means no one can use the ARM wheels right now.
74+ steps :
75+ - uses : actions/checkout@v4.3.0
6876
69- # Linux - based on CentOS 7; glibc 64-bit builds only; no bundled libraries
77+ - name : Set up QEMU
78+ # QEMU is needed for Linux aarch64 wheels
79+ uses : docker/setup-qemu-action@v3.6.0
80+
81+ - name : Build wheels
82+ uses : pypa/cibuildwheel@v3.2.1
83+ env :
7084 # https://github.com/pypa/manylinux#docker-images
71- CIBW_MANYLINUX_X86_64_IMAGE : manylinux2014
85+ CIBW_MANYLINUX_X86_64_IMAGE : manylinux_2_28
7286 CIBW_ARCHS_LINUX : x86_64 aarch64
73- # this installs unixODBC 2.3.1 which is quite old but it has the latest ABI so should be fine
7487 CIBW_BEFORE_ALL_LINUX : yum -y install unixODBC-devel
88+ # Intel64 and ARM64 wheels
89+ CIBW_BUILD : " cp*-manylinux_x86_64 cp*-manylinux_aarch64"
90+ # the raw wheel filename is not PyPi compliant so the wheel must be repaired but
91+ # suppress the addition of unixODBC libs to the wheel with --exclude's
92+ CIBW_REPAIR_WHEEL_COMMAND_LINUX :
93+ auditwheel repair
94+ --exclude "libodbc.so.*"
95+ --wheel-dir {dest_dir}
96+ {wheel}
97+
98+ - name : Upload wheels
99+ uses : actions/upload-artifact@v4.6.2
100+ with :
101+ name : wheels_ubuntu_manylinux__${{ github.sha }}
102+ path : ./wheelhouse/*.whl
103+
104+ build_ubuntu_musllinux_wheels :
105+ name : Build wheels on Ubuntu musllinux
106+ runs-on : ubuntu-22.04
107+
108+ steps :
109+ - uses : actions/checkout@v4.3.0
110+
111+ - name : Set up QEMU
112+ # QEMU is needed for Linux aarch64 wheels
113+ uses : docker/setup-qemu-action@v3.6.0
114+
115+ - name : Build wheels
116+ uses : pypa/cibuildwheel@v3.2.1
117+ env :
118+ # https://github.com/pypa/manylinux#docker-images
119+ CIBW_MUSLLINUX_X86_64_IMAGE : musllinux_1_2
120+ CIBW_ARCHS_LINUX : x86_64 aarch64
121+ CIBW_BEFORE_ALL_LINUX : apk add unixodbc-dev
122+ # Intel64 and ARM64 wheels
123+ CIBW_BUILD : " cp*-musllinux_x86_64 cp*-musllinux_aarch64"
75124 # the raw wheel filename is not PyPi compliant so the wheel must be repaired but
76125 # suppress the addition of unixODBC libs to the wheel with --exclude's
77126 CIBW_REPAIR_WHEEL_COMMAND_LINUX :
78127 auditwheel repair
79- --exclude libodbc.so.2
80- --exclude libltdl.so.7
128+ --exclude "libodbc.so.*"
81129 --wheel-dir {dest_dir}
82130 {wheel}
83131
84- # Build choices - disable musl Linux and PyPy builds
85- CIBW_SKIP : " *-musllinux_* pp*"
132+ - name : Upload wheels
133+ uses : actions/upload-artifact@v4.6.2
134+ with :
135+ name : wheels_ubuntu_musllinux__${{ github.sha }}
136+ path : ./wheelhouse/*.whl
137+
138+ build_macos_x86_wheels :
139+ name : Build wheels on macOS x86_64
140+ runs-on : macos-13
141+
142+ steps :
143+ - uses : actions/checkout@v4.3.0
144+
145+ - name : Build wheels
146+ uses : pypa/cibuildwheel@v3.2.1
147+ # https://cibuildwheel.readthedocs.io/en/stable/options/#options-summary
148+ env :
149+ CIBW_ARCHS_MACOS : x86_64
150+ CIBW_BUILD : " cp*macosx_x86_64"
151+ # suppress the inclusion of the unixODBC dynamic libraries by disabling the repair command
152+ CIBW_REPAIR_WHEEL_COMMAND_MACOS : " "
153+
154+ - name : Upload wheels
155+ uses : actions/upload-artifact@v4.6.2
156+ with :
157+ name : wheels_macos_x86__${{ github.sha }}
158+ path : ./wheelhouse/*.whl
159+
160+ build_macos_arm64_wheels :
161+ name : Build wheels on macOS ARM64
162+ runs-on : macos-14
163+
164+ steps :
165+ - uses : actions/checkout@v4.3.0
166+
167+ - name : Install unixODBC
168+ # unixODBC is necessary for the SQL C header files, e.g. sql.h, but doesn't appear
169+ # to be pre-installed on macos-14, hence make sure it really is installed
170+ run : brew install unixodbc
171+
172+ - name : Build wheels
173+ uses : pypa/cibuildwheel@v3.2.1
174+ # https://cibuildwheel.readthedocs.io/en/stable/options/#options-summary
175+ env :
176+ CIBW_ARCHS_MACOS : arm64
177+ CIBW_BUILD : " cp*macosx_arm64"
178+ # suppress the inclusion of the unixODBC dynamic libraries by disabling the repair command
179+ CIBW_REPAIR_WHEEL_COMMAND_MACOS : " "
86180
87181 - name : Upload wheels
88- uses : actions/upload-artifact@v4
182+ uses : actions/upload-artifact@v4.6.2
89183 with :
90- name : wheels_ ${{ github.sha }}
184+ name : wheels_macos_arm64__ ${{ github.sha }}
91185 path : ./wheelhouse/*.whl
0 commit comments