Skip to content

Commit 6357bc2

Browse files
authored
ci: add riscv64 manylinux/musllinux wheels (#664)
Now that cibuildwheel and PyPI support riscv64, we can start building riscv64 wheels. Because there is no native riscv64 runner available, this PR adds a QEMU-based riscv64 job to the cibuildwheel workflow. Signed-off-by: Julien Stephan <jstephan@baylibre.com>
1 parent f980636 commit 6357bc2

File tree

1 file changed

+20
-3
lines changed

1 file changed

+20
-3
lines changed

.github/workflows/wheel.yml

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,19 @@ jobs:
1212
strategy:
1313
matrix:
1414
# macos-13 is for intel
15-
os: ["ubuntu-24.04", "ubuntu-24.04-arm", "windows-latest", "windows-11-arm", "macos-13", "macos-latest"]
15+
include:
16+
- os: ubuntu-24.04
17+
- os: ubuntu-24.04-arm
18+
- os: windows-latest
19+
- os: windows-11-arm
20+
- os: macos-13
21+
- os: macos-latest
22+
- os: ubuntu-24.04
23+
cibw_archs: riscv64
24+
name_suffix: "-riscv64"
25+
1626
runs-on: ${{ matrix.os }}
17-
name: Build wheels on ${{ matrix.os }}
27+
name: Build wheels on ${{ matrix.os }}${{ matrix.name_suffix || '' }}
1828

1929
steps:
2030
- uses: actions/checkout@v6
@@ -28,12 +38,19 @@ jobs:
2838
pip install -r requirements.txt
2939
make cython
3040
41+
- name: Set up QEMU for emulation
42+
if: matrix.cibw_archs == 'riscv64'
43+
uses: docker/setup-qemu-action@v3
44+
with:
45+
platforms: ${{ matrix.cibw_archs }}
46+
3147
- name: Build
3248
uses: pypa/cibuildwheel@v3.3.0
3349
env:
3450
CIBW_TEST_REQUIRES: "pytest"
3551
CIBW_TEST_COMMAND: "pytest {package}/test"
3652
CIBW_SKIP: "pp* cp38-* cp39-* cp310-win_arm64"
53+
CIBW_ARCHS: ${{ matrix.cibw_archs || 'auto' }}
3754

3855
- name: Build sdist
3956
if: runner.os == 'Linux' && runner.arch == 'X64'
@@ -44,7 +61,7 @@ jobs:
4461
- name: Upload Wheels to artifact
4562
uses: actions/upload-artifact@v4
4663
with:
47-
name: wheels-${{ matrix.os }}
64+
name: wheels-${{ matrix.os }}${{ matrix.name_suffix || '' }}
4865
path: wheelhouse
4966

5067
# combine all wheels into one artifact

0 commit comments

Comments
 (0)