-
Notifications
You must be signed in to change notification settings - Fork 563
137 lines (112 loc) · 4.53 KB
/
artifacts_build.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
# Build all the artifacts for a release (i.e. the source distribution file and the various wheels)
# https://docs.github.com/en/actions/using-jobs/choosing-the-runner-for-a-job
# https://raw.githubusercontent.com/actions/python-versions/main/versions-manifest.json
# https://cibuildwheel.readthedocs.io/en/stable/options/#options-summary
name: Build the release artifacts
# include "workflow_dispatch" so this workflow can be run manually from the Actions portal
on: [workflow_dispatch]
jobs:
build_sdist:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4.1.1
- name: Install Python dependencies
run: python -m pip install --upgrade pip build
- name: Build sdist
run: python -m build --sdist --no-isolation
- name: Upload sdist
uses: actions/upload-artifact@v4.3.0
with:
name: sdist__${{ github.sha }}
path: ./dist/*.gz
build_windows_wheels:
name: Build wheels on Windows
runs-on: windows-2019
steps:
- uses: actions/checkout@v4.1.1
- name: Build wheels
uses: pypa/cibuildwheel@v2.16.5
env:
CIBW_ARCHS_WINDOWS: "AMD64 x86"
# AMD64 and Intel32 wheels, but not ARM64 (yet)
CIBW_BUILD: "cp*-win_amd64* cp*-win32*"
- name: Upload wheels
uses: actions/upload-artifact@v4.3.0
with:
name: wheels_windows__${{ github.sha }}
path: ./wheelhouse/*.whl
build_ubuntu_wheels:
name: Build wheels on Ubuntu
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4.1.1
- name: Set up QEMU
# QEMU is needed for Linux aarch64 wheels
uses: docker/setup-qemu-action@v3.0.0
- name: Build wheels
uses: pypa/cibuildwheel@v2.16.5
env:
# based on CentOS 7; glibc 64-bit builds only; no bundled libraries
# https://github.com/pypa/manylinux#docker-images
CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014
CIBW_ARCHS_LINUX: x86_64 aarch64
# this installs unixODBC 2.3.1 which is quite old but it has the latest ABI so should be fine
CIBW_BEFORE_ALL_LINUX: yum -y install unixODBC-devel
# Intel64 and aarch64 wheels, but not i686 or musllinux (yet)
CIBW_BUILD: "cp*-manylinux_x86_64* cp*-manylinux_aarch64*"
# the raw wheel filename is not PyPi compliant so the wheel must be repaired but
# suppress the addition of unixODBC libs to the wheel with --exclude's
CIBW_REPAIR_WHEEL_COMMAND_LINUX:
auditwheel repair
--exclude libodbc.so.2
--exclude libltdl.so.7
--wheel-dir {dest_dir}
{wheel}
- name: Upload wheels
uses: actions/upload-artifact@v4.3.0
with:
name: wheels_ubuntu__${{ github.sha }}
path: ./wheelhouse/*.whl
build_macos_x86_wheels:
name: Build wheels on macOS x86_64
# macos-12 is an Intel x86 runner
runs-on: macos-12
steps:
- uses: actions/checkout@v4.1.1
- name: Build wheels
uses: pypa/cibuildwheel@v2.16.5
# https://cibuildwheel.readthedocs.io/en/stable/options/#options-summary
env:
CIBW_ARCHS_MACOS: x86_64
CIBW_BUILD: "cp*macosx_x86_64*"
# suppress the inclusion of the unixODBC dynamic libraries by disabling the repair command
CIBW_REPAIR_WHEEL_COMMAND_MACOS: ""
- name: Upload wheels
uses: actions/upload-artifact@v4.3.0
with:
name: wheels_macos_x86__${{ github.sha }}
path: ./wheelhouse/*.whl
build_macos_arm64_wheels:
name: Build wheels on macOS ARM64
# macos-14 is an ARM64 (M1) runner
runs-on: macos-14
steps:
- uses: actions/checkout@v4.1.1
- name: Install unixODBC
# unixODBC is necessary for the SQL C header files, e.g. sql.h, but doesn't appear
# to be pre-installed on macos-14, hence make sure it really is installed
run: brew install unixodbc
- name: Build wheels
uses: pypa/cibuildwheel@v2.16.5
# https://cibuildwheel.readthedocs.io/en/stable/options/#options-summary
env:
CIBW_ARCHS_MACOS: arm64
CIBW_BUILD: "cp*macosx_arm64*"
# suppress the inclusion of the unixODBC dynamic libraries by disabling the repair command
CIBW_REPAIR_WHEEL_COMMAND_MACOS: ""
- name: Upload wheels
uses: actions/upload-artifact@v4.3.0
with:
name: wheels_macos_arm64__${{ github.sha }}
path: ./wheelhouse/*.whl