-
Notifications
You must be signed in to change notification settings - Fork 2
216 lines (189 loc) · 7.18 KB
/
Copy pathwheels.yaml
File metadata and controls
216 lines (189 loc) · 7.18 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
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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
name: Build
on: [push, pull_request]
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
build_wheels:
name: Fast build on ${{ matrix.config.os }} for ${{ matrix.config.cibw }} and ${{ matrix.config.cibw_skip }}
runs-on: ${{ matrix.config.os }}
strategy:
fail-fast: false
matrix:
config:
- os: ubuntu-latest
cibw: "cp310*"
cibw_skip: "*musllinux*"
- os: windows-2022
cibw: "cp310*"
cibw_skip: "*-win32"
- os: macos-15-intel
cibw: "cp310*"
cibw_skip: ""
- os: macos-latest
cibw: "cp310*"
cibw_skip: ""
steps:
- name: Checkout sources
uses: actions/checkout@v4
with:
submodules: "recursive"
# libmdbx derives its version from `git describe`, and a shallow
# submodule clone carries no tags.
fetch-depth: 0
- name: '🛠️ Win MSVC 64 setup'
if: contains(matrix.config.os, 'windows')
uses: microsoft/setup-msbuild@v2
- name: '🛠️ Win MSVC 64 dev cmd setup'
if: contains(matrix.config.os, 'windows')
uses: ilammy/msvc-dev-cmd@v1
with:
arch: x64
# Used to host cibuildwheel
- name: Setup python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install cibuildwheel
run: python -m pip install cibuildwheel==2.22.0
- name: Build wheels
run: python -m cibuildwheel --output-dir wheelhouse
env:
CIBW_BUILD_FRONTEND: build # pip backend doesn't seem including our dynamic libraries
CIBW_BUILD: ${{ matrix.config.cibw }}
CIBW_ENVIRONMENT: MACOSX_DEPLOYMENT_TARGET=13.0 SYSTEM_VERSION_COMPAT=0 # Shitty arm macOS
CIBW_BEFORE_BUILD_LINUX: pip install ninja
CIBW_BEFORE_BUILD_WINDOWS: choco install ninja git
CIBW_BEFORE_BUILD_MACOS: brew install ninja git
CIBW_TEST_REQUIRES: pytest
CIBW_TEST_COMMAND: pytest {package}/tests
CIBW_SKIP: ${{ matrix.config.cibw_skip }}
# to supply options, put them in 'env', like:
# env:
# CIBW_SOME_OPTION: value
- uses: actions/upload-artifact@v4
with:
name: cibw-wheels-${{ matrix.config.os }}-${{ strategy.job-index }}
path: ./wheelhouse/*.whl
build_wheels_all:
name: Build wheels on ${{ matrix.config.os }} for ${{ matrix.config.cibw }} and ${{ matrix.config.cibw_skip }}
runs-on: ${{ matrix.config.os }}
strategy:
fail-fast: false
matrix:
config:
- os: ubuntu-latest
cibw: "cp311*"
cibw_skip: "*musllinux*"
- os: ubuntu-latest
cibw: "{cp312*,cp313*}"
cibw_skip: "*musllinux*"
- os: windows-2022
cibw: "cp311*"
cibw_skip: "*-win32"
- os: windows-2022
cibw: "{cp312*,cp313*}"
cibw_skip: "*-win32"
- os: macos-15-intel
cibw: "{cp311*,cp312*,cp313*}"
cibw_skip: ""
- os: macos-latest
cibw: "{cp311*,cp312*,cp313*}"
cibw_skip: ""
if: ${{ startsWith(github.ref, 'refs/tags') || contains(github.event.head_commit.message, 'CI(full)') }}
steps:
- name: Checkout sources
uses: actions/checkout@v4
with:
submodules: "recursive"
# libmdbx derives its version from `git describe`, and a shallow
# submodule clone carries no tags.
fetch-depth: 0
- name: '🛠️ Setup Dependency'
if: contains(matrix.config.os, 'ubuntu')
run: sudo apt update && sudo apt install ninja-build -y
- name: '🛠️ Win MSVC 64 setup'
if: contains(matrix.config.os, 'windows')
uses: microsoft/setup-msbuild@v2
- name: '🛠️ Win MSVC 64 dev cmd setup'
if: contains(matrix.config.os, 'windows')
uses: ilammy/msvc-dev-cmd@v1
with:
arch: x64
# Used to host cibuildwheel
- name: Setup python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install cibuildwheel
run: python -m pip install cibuildwheel==2.22.0
- name: Build wheels
run: python -m cibuildwheel --output-dir wheelhouse
env:
CIBW_BUILD_FRONTEND: build # pip backend doesn't seem including our dynamic libraries
CIBW_BUILD: ${{ matrix.config.cibw }}
CIBW_ENVIRONMENT: MACOSX_DEPLOYMENT_TARGET=13.0 SYSTEM_VERSION_COMPAT=0 # Shitty arm macOS
CIBW_BEFORE_BUILD_LINUX: pip install ninja
CIBW_BEFORE_BUILD_WINDOWS: choco install ninja cmake git
CIBW_BEFORE_BUILD_MACOS: brew install ninja git
CIBW_TEST_REQUIRES: pytest
CIBW_TEST_COMMAND: pytest {package}/tests
CIBW_SKIP: ${{ matrix.config.cibw_skip }}
# to supply options, put them in 'env', like:
# env:
# CIBW_SOME_OPTION: value
- uses: actions/upload-artifact@v4
with:
name: cibw-wheels-${{ matrix.config.os }}-${{ strategy.job-index }}-all
path: ./wheelhouse/*.whl
make_sdist:
name: Make SDist
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: "recursive"
# libmdbx derives its version from `git describe`, and a shallow
# submodule clone carries no tags.
fetch-depth: 0
- name: Build SDist
run: |
sudo apt update && sudo apt install ninja-build git build-essential -y
cd libmdbx && make V=1 dist && cd ..
python3 -m pip install -U pip build
python3 -m build --sdist
# Building the tarball says nothing about whether it installs: the wheel
# jobs all build from the git checkout, so anything the sdist fails to
# ship goes unnoticed until someone pip installs it.
- name: Check SDist installs
run: |
python3 -m venv /tmp/sdist-venv
/tmp/sdist-venv/bin/python -m pip install -U pip pytest
/tmp/sdist-venv/bin/python -m pip install dist/*.tar.gz
# Run outside the source tree, otherwise ./mdbx shadows the installed
# package and we would just be testing the checkout again.
mkdir -p /tmp/sdist-check && cp -r tests /tmp/sdist-check/
cd /tmp/sdist-check && /tmp/sdist-venv/bin/python -m pytest tests -q
- uses: actions/upload-artifact@v4
with:
name: sdist-archive
path: dist/*.tar.gz
publish:
needs: [ build_wheels, make_sdist, build_wheels_all ]
environment: pypi
permissions:
id-token: write
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags')
steps:
- uses: actions/download-artifact@v4
with:
merge-multiple: true
path: dist
- name: Show downloaded artifacts
run: ls -laR dist
- name: 'Publish distribution to PyPI'
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}