-
-
Notifications
You must be signed in to change notification settings - Fork 1
218 lines (194 loc) · 5.9 KB
/
package.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
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
216
217
218
name: Package
env:
PIP_CACHE_DIR: .pip
PYTHONPATH: src
on:
release:
types: ["published"]
workflow_dispatch: {}
jobs:
build-sdist:
runs-on: ubuntu-22.04
steps:
- name: Checkout Repo
uses: actions/checkout@v4
- name: Set Up Python 3.13
uses: actions/setup-python@v5
with:
python-version: "3.13"
- name: Upgrade Pip
run: python -m pip install --upgrade pip
- name: Upgrade Build
run: pip install --upgrade build
- name: Install Python Dependencies
run: pip install -IU -r ./.requirements/build.txt
- name: Build sdist
run: ./tools/build/build-sdist.sh
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: sdist
path: dist/*.tar.gz
# glibc 2.17, x86_64 (RHEL7)
build-manylinux_2_17-x86_64:
runs-on: ubuntu-22.04
needs: build-sdist
strategy:
fail-fast: true
matrix:
include:
- arch: x86_64
target: x86_64-unknown-linux-gnu
steps:
- name: Checkout Repo
uses: actions/checkout@v4
- name: Build wheels
run: >
docker run --rm
-e RUST_ARCH=${{ matrix.target }}
-v $PWD:/workdir
-w /workdir
--user 0
quay.io/pypa/manylinux2014_${{ matrix.arch }}:latest
./tools/build/build-many.sh 3.9 3.10 3.11 3.12 3.13
- name: Save Artefacts
uses: actions/upload-artifact@v4
with:
name: wheel_manylinux_2_17_${{ matrix.arch }}
path: wheelhouse/*.whl
# glibc 2.28, x86_64/aarch64
build-manylinux_2_28:
runs-on: ubuntu-22.04
needs: build-sdist
strategy:
fail-fast: true
matrix:
include:
- arch: x86_64
target: x86_64-unknown-linux-gnu
platform: linux/amd64
# - arch: aarch64
# target: aarch64-unknown-linux-gnu
# platform: linux/arm64
steps:
- name: Checkout Repo
uses: actions/checkout@v4
- name: Set up QEMU
if: matrix.arch != 'x86_64'
uses: docker/setup-qemu-action@v2
with:
image: tonistiigi/binfmt:qemu-v6.2.0
platforms: all
- name: Build wheels
run: >
docker run --rm
-e RUST_ARCH=${{ matrix.target }}
-v $PWD:/workdir
-w /workdir
--user 0
--platform ${{ matrix.platform }}
quay.io/pypa/manylinux_2_28_${{ matrix.arch }}:latest
./tools/build/build-many.sh 3.9 3.10 3.11 3.12 3.13
- name: Save Artefacts
uses: actions/upload-artifact@v4
with:
name: wheel_manylinux_2_24_${{ matrix.arch }}
path: wheelhouse/*.whl
# Fails with:
# Cannot repair wheel, because required library "libpthread.so.0" could not be located
# build-musllinux-1_1:
# runs-on: ubuntu-22.04
# needs: build-sdist
# strategy:
# fail-fast: true
# matrix:
# include:
# - arch: x86_64
# target: x86_64-unknown-linux-musl
# platform: linux/amd64
# # - arch: aarch64
# # target: aarch64-unknown-linux-musl
# # platform: linux/arm64
# steps:
# - name: Checkout Repo
# uses: actions/checkout@v4
# - name: Set up QEMU
# if: matrix.arch != 'x86_64'
# uses: docker/setup-qemu-action@v2
# with:
# image: tonistiigi/binfmt:qemu-v6.2.0
# platforms: all
# # auditwheel crashes on 3.11
# # ValueError: Cannot repair wheel, because required library
# # "librt.so.1" could not be located
# - name: Build wheels
# run: >
# docker run --rm
# -e RUST_ARCH=${{ matrix.target }}
# -v $PWD:/workdir
# -w /workdir
# --user 0
# --platform ${{ matrix.platform }}
# quay.io/pypa/musllinux_1_1_${{ matrix.arch }}:latest
# ./tools/build/build-many.sh 3.9 3.10
# - name: Save Artefacts
# uses: actions/upload-artifact@v4
# with:
# name: wheel_musllinux_1_1_${{ matrix.arch }}
# path: wheelhouse/*.whl
# build-wheel-macos:
# runs-on: macos-11
# needs: build-sdist
# strategy:
# fail-fast: true
# matrix:
# include:
# - arch: x86_64
# platform: macosx
# # - arch: arm64
# # platform: macosx
# steps:
# - name: Checkout Repo
# uses: actions/checkout@v4
# - name: Build Packages
# uses: pypa/cibuildwheel@v2.11.2
# env:
# SETUP_RUST_PLATFORM: ${{matrix.platform}}-${{matrix.arch}}
# CIBW_BUILD: cp{38,39,310,311}-${{matrix.platform}}_${{matrix.arch}}
# CIBW_ARCHS: ${{matrix.arch}}
# CIBW_ENVIRONMENT: >-
# PATH=$HOME/.cargo/bin:$PATH
# CARGO_HOME=$HOME/.cargo
# RUSTUP_HOME=$HOME/.rustup
# RUST_ARCH=x86_64-apple-darwin
# - name: Save Artefacts
# uses: actions/upload-artifact@v4
# with:
# name: wheel_${{ matrix.platform }}_${{ matrix.arch }}
# path: wheelhouse/*.whl
publish:
runs-on: ubuntu-24.04
needs:
- build-sdist
- build-manylinux_2_17-x86_64
- build-manylinux_2_28
# - build-musllinux-1_1
# - build-wheel-macos
steps:
- name: Download Artefacts
uses: actions/download-artifact@v4
with:
path: dist/
- name: Prepare dist/
run: |
mv dist/*/*.whl dist/
mv dist/*/*.tar.gz dist/
find dist/* -type d | xargs rm -r
- name: Show Artefacts
run: ls -lhR dist/
- name: Publish distribution 📦 to PyPI
if: startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}
print_hash: true