Skip to content

Commit 818b112

Browse files
committed
ci: cross-build linux wheels with uv+zig
1 parent 13de15f commit 818b112

File tree

3 files changed

+28
-93
lines changed

3 files changed

+28
-93
lines changed

.github/workflows/artifacts.yml

Lines changed: 28 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -168,56 +168,42 @@ jobs:
168168
name: pyontoenv_alias_${{ github.run_attempt }}
169169
path: pyontoenv-shim/dist/*
170170

171-
wheel_linux:
172-
runs-on: ubuntu-latest
173-
strategy:
174-
matrix:
175-
architecture: [ "x86_64", "aarch64" ]
176-
continue-on-error: true
177-
steps:
178-
- uses: actions/checkout@v3
179-
with:
180-
submodules: true
181-
- uses: docker/setup-qemu-action@v2
182-
with:
183-
platforms: linux/${{ matrix.architecture }}
184-
if: (github.event_name == 'release' || github.event_name == 'workflow_dispatch' && github.event.inputs.run_full_matrix == 'true') && matrix.architecture != 'x86_64'
185-
- uses: ./.github/actions/setup-rust
186-
with:
187-
version: stable
188-
- run: sed "s/%arch%/${{ matrix.architecture }}/g" .github/workflows/manylinux_build.sh | sed "s/%for_each_version%/${{ (github.event_name == 'release' || (github.event_name == 'workflow_dispatch' && github.event.inputs.run_full_matrix == 'true')) && 'true' || '' }}/g" > .github/workflows/manylinux_build_script.sh
189-
- run: docker run -v "$(pwd)":/workdir --platform linux/${{ matrix.architecture }} quay.io/pypa/manylinux_2_28_${{ matrix.architecture }} /bin/bash /workdir/.github/workflows/manylinux_build_script.sh
190-
if: github.event_name == 'release' || (github.event_name == 'workflow_dispatch' && github.event.inputs.run_full_matrix == 'true') || matrix.architecture == 'x86_64'
191-
- uses: actions/upload-artifact@v4
192-
with:
193-
name: pyontoenv_${{ matrix.architecture }}_linux_gnu_${{ github.run_attempt }}
194-
path: target/wheels/*.whl
195-
196-
wheel_linux_musl:
197-
runs-on: ubuntu-latest
171+
wheel_linux_cross:
172+
runs-on: macos-14
198173
strategy:
199174
matrix:
200-
architecture: [ "x86_64", "aarch64" ]
201-
continue-on-error: true
175+
arch: [ x86_64, aarch64 ]
202176
steps:
203177
- uses: actions/checkout@v4
204178
with:
205179
submodules: true
206-
- uses: docker/setup-qemu-action@v2
207-
with:
208-
platforms: linux/${{ matrix.architecture }}
209-
if: (github.event_name == 'release' || github.event_name == 'workflow_dispatch' && github.event.inputs.run_full_matrix == 'true') && matrix.architecture != 'x86_64'
210-
- uses: ./.github/actions/setup-rust
180+
- uses: dtolnay/rust-toolchain@stable
211181
with:
212-
version: stable
213-
- run: sed "s/%arch%/${{ matrix.architecture }}/g" .github/workflows/musllinux_build.sh | sed "s/%for_each_version%/${{ (github.event_name == 'release' || (github.event_name == 'workflow_dispatch' && github.event.inputs.run_full_matrix == 'true')) && 'true' || '' }}/g" > .github/workflows/musllinux_build_script.sh
214-
- run: docker run -v "$(pwd)":/workdir --platform linux/${{ matrix.architecture }} quay.io/pypa/musllinux_1_2_${{ matrix.architecture }} /bin/bash /workdir/.github/workflows/musllinux_build_script.sh
215-
if: github.event_name == 'release' || (github.event_name == 'workflow_dispatch' && github.event.inputs.run_full_matrix == 'true') || matrix.architecture == 'x86_64'
216-
- run: find .
182+
targets: x86_64-unknown-linux-gnu,aarch64-unknown-linux-gnu
183+
- name: Install zig
184+
run: brew install zig
185+
- name: Install uv
186+
uses: astral-sh/setup-uv@v5
187+
with:
188+
enable-cache: true
189+
- name: Install Python 3.12
190+
run: uv python install 3.12
191+
- name: Build Linux ${{ matrix.arch }} wheel (uv+maturin+zig)
192+
working-directory: python
193+
env:
194+
UV_PYTHON_DOWNLOAD_MISSING: 1
195+
run: |
196+
uv tool run --python 3.12 \
197+
maturin build \
198+
--release \
199+
--target ${{ matrix.arch }}-unknown-linux-gnu \
200+
--interpreter python3.12 \
201+
--compatibility manylinux2014 \
202+
--zig
217203
- uses: actions/upload-artifact@v4
218204
with:
219-
name: pyontoenv_${{ matrix.architecture }}_linux_musl_${{ github.run_attempt }}
220-
path: target/wheels/*.whl
205+
name: pyontoenv_${{ matrix.arch }}_linux_gnu_${{ github.run_attempt }}
206+
path: python/target/wheels/*.whl
221207

222208
wheel_mac:
223209
runs-on: macos-latest
@@ -299,8 +285,7 @@ jobs:
299285
- python_pyontoenv_alias
300286
- wheel_windows
301287
- wheel_mac
302-
- wheel_linux
303-
- wheel_linux_musl
288+
- wheel_linux_cross
304289
steps:
305290
- uses: actions/download-artifact@v4
306291
with:

.github/workflows/manylinux_build.sh

Lines changed: 0 additions & 32 deletions
This file was deleted.

.github/workflows/musllinux_build.sh

Lines changed: 0 additions & 18 deletions
This file was deleted.

0 commit comments

Comments
 (0)