Skip to content

Commit fcdc2e3

Browse files
authored
kaldialign: add build-kaldialign.yml for riscv64 wheels (#1179)
* **Package**: `kaldialign` * **Version**: `0.12.0` * **Source**: https://github.com/pzelasko/kaldialign * **Docs**: https://github.com/pzelasko/kaldialign Builds the pybind11/CMake `_kaldialign` extension (edit-distance and alignment methods extracted from Kaldi). Upstream publishes no riscv64 wheel. Mirrors [upstream's `build-wheels.yaml`](https://github.com/pzelasko/kaldialign/blob/v0.12.0/.github/workflows/build-wheels.yaml). **Differs from upstream** - Builds musllinux too - no native deps, unlike upstream's `CIBW_SKIP: *-musllinux*`. **Testing** - same as upstream **License**: OK Built on cp312; 23 passed.
1 parent 09b7925 commit fcdc2e3

1 file changed

Lines changed: 79 additions & 0 deletions

File tree

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
# SPDX-FileCopyrightText: 2026 The RISE Project
2+
# SPDX-License-Identifier: MIT
3+
---
4+
# Based on the `build_wheels` job of
5+
# https://github.com/pzelasko/kaldialign/blob/v0.12.0/.github/workflows/build-wheels.yaml
6+
name: Build kaldialign wheels (riscv64)
7+
8+
on:
9+
workflow_dispatch:
10+
inputs:
11+
version:
12+
description: 'kaldialign version/tag to build (git tag without leading v, e.g. 0.12.0)'
13+
required: true
14+
default: '0.12.0'
15+
pull_request:
16+
paths:
17+
- '.github/workflows/build-kaldialign.yml'
18+
19+
concurrency:
20+
group: ${{ github.workflow }}-${{ inputs.version || '0.12.0' }}-${{ github.head_ref || github.run_id }}
21+
cancel-in-progress: true
22+
23+
permissions:
24+
contents: read # to fetch code (actions/checkout)
25+
26+
env:
27+
KALDIALIGN_VERSION: ${{ inputs.version || '0.12.0' }}
28+
MANYLINUX_RISCV64_IMAGE: quay.io/pypa/manylinux_2_39_riscv64
29+
MUSLLINUX_RISCV64_IMAGE: quay.io/pypa/musllinux_1_2_riscv64
30+
31+
jobs:
32+
setup:
33+
uses: $/.github/workflows/_setup.yml
34+
35+
build_wheels:
36+
needs: [setup]
37+
name: Build kaldialign ${{ inputs.version || '0.12.0' }} ${{ matrix.python }}-${{ matrix.libc }}_riscv64
38+
runs-on: ubuntu-24.04-riscv
39+
timeout-minutes: 60
40+
strategy:
41+
fail-fast: false
42+
matrix:
43+
python: ["cp312", "cp313", "cp314", "cp314t"]
44+
libc: [manylinux, musllinux]
45+
46+
steps:
47+
- name: Checkout kaldialign v${{ env.KALDIALIGN_VERSION }}
48+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
49+
with:
50+
repository: pzelasko/kaldialign
51+
ref: v${{ env.KALDIALIGN_VERSION }}
52+
persist-credentials: false
53+
54+
- uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0
55+
env:
56+
CIBW_ARCHS: riscv64
57+
CIBW_BUILD: ${{ matrix.python }}-${{ matrix.libc }}_riscv64
58+
CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }}
59+
CIBW_MUSLLINUX_RISCV64_IMAGE: ${{ env.MUSLLINUX_RISCV64_IMAGE }}
60+
CIBW_TEST_REQUIRES: pytest
61+
CIBW_TEST_COMMAND: >-
62+
python -c "import _kaldialign as m; assert m.__file__.endswith('.so'), m.__file__" &&
63+
python -m pytest -vv {project}/tests/test_align.py
64+
65+
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
66+
with:
67+
name: kaldialign-${{ env.KALDIALIGN_VERSION }}-${{ matrix.python }}-${{ matrix.libc }}_riscv64
68+
path: ./wheelhouse/*.whl
69+
if-no-files-found: error
70+
71+
publish:
72+
name: Publish kaldialign ${{ inputs.version || '0.12.0' }}
73+
needs: [setup, build_wheels]
74+
permissions:
75+
contents: write
76+
pull-requests: write
77+
uses: $/.github/workflows/_publish-wheel.yml
78+
with:
79+
artifact-pattern: kaldialign-${{ inputs.version || '0.12.0' }}-*riscv64

0 commit comments

Comments
 (0)