Skip to content

Commit 59eaa40

Browse files
committed
release: Build an arm64 wheel alongside the x86_64 one
The wheel carries a native kerf-init, so an arm64 host could only install from the sdist, which needs musl-gcc. Build the wheel on native x86_64 and arm64 runners and retag each for its own architecture. The sdist is built once, on x86_64, and publishing collects every job's distributions. Signed-off-by: Cong Wang <cwang@multikernel.io>
1 parent 3890616 commit 59eaa40

1 file changed

Lines changed: 22 additions & 9 deletions

File tree

‎.github/workflows/release.yml‎

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,14 @@ on:
77

88
jobs:
99
build:
10-
runs-on: ubuntu-latest
10+
strategy:
11+
matrix:
12+
include:
13+
- runner: ubuntu-latest
14+
arch: x86_64
15+
- runner: ubuntu-24.04-arm
16+
arch: aarch64
17+
runs-on: ${{ matrix.runner }}
1118
steps:
1219
- uses: actions/checkout@v4
1320

@@ -35,30 +42,34 @@ jobs:
3542
sudo apt-get update
3643
sudo apt-get install -y musl-tools
3744
38-
- name: Build sdist and wheel
45+
- name: Build wheel
3946
run: |
40-
poetry build
47+
poetry build --format wheel
4148
4249
# The build script makes the wheel interpreter and platform specific
43-
# (cp311-cp311-linux_x86_64), which PyPI rejects. The only native code
50+
# (cp311-cp311-linux_<arch>), which PyPI rejects. The only native code
4451
# is the static kerf-init, so the wheel runs on any Python 3 and libc.
4552
- name: Retag wheel for PyPI
53+
env:
54+
ARCH: ${{ matrix.arch }}
4655
run: |
4756
file src/kerf/data/kerf-init | grep -q "statically linked"
4857
pip install wheel auditwheel
4958
python -m wheel tags --remove --python-tag py3 --abi-tag none \
50-
--platform-tag manylinux_2_17_x86_64.manylinux2014_x86_64.musllinux_1_1_x86_64 \
59+
--platform-tag "manylinux_2_17_$ARCH.manylinux2014_$ARCH.musllinux_1_1_$ARCH" \
5160
dist/*.whl
5261
auditwheel show dist/*.whl
5362
54-
- name: Check the sdist builds a wheel
63+
- name: Build sdist
64+
if: matrix.arch == 'x86_64'
5565
run: |
66+
poetry build --format sdist
5667
pip wheel --no-deps -w /tmp/sdist-wheel dist/*.tar.gz
5768
5869
- name: Upload distributions
5970
uses: actions/upload-artifact@v4
6071
with:
61-
name: dist
72+
name: dist-${{ matrix.arch }}
6273
path: dist/
6374

6475
publish:
@@ -73,7 +84,8 @@ jobs:
7384
- name: Download distributions
7485
uses: actions/download-artifact@v4
7586
with:
76-
name: dist
87+
pattern: dist-*
88+
merge-multiple: true
7789
path: dist/
7890

7991
- name: Publish to PyPI
@@ -88,7 +100,8 @@ jobs:
88100
- name: Download distributions
89101
uses: actions/download-artifact@v4
90102
with:
91-
name: dist
103+
pattern: dist-*
104+
merge-multiple: true
92105
path: dist/
93106

94107
- name: Create GitHub release

0 commit comments

Comments
 (0)