Skip to content

Commit b902479

Browse files
authored
ci: cross-platform prebuilt binary release for llama.cpp runtime (#3001)
1 parent 4a93f29 commit b902479

1 file changed

Lines changed: 73 additions & 0 deletions

File tree

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
name: Build llama.cpp runtime binaries
2+
3+
# Cross-platform prebuilt binaries for the FunASR llama.cpp / GGUF runtime,
4+
# like whisper.cpp's whisper-bin-*. Push a `runtime-llamacpp-v*` tag to publish
5+
# a GitHub Release with the binaries; or run manually (workflow_dispatch) to test
6+
# the build without creating a release.
7+
on:
8+
workflow_dispatch:
9+
push:
10+
tags:
11+
- 'runtime-llamacpp-v*'
12+
13+
permissions:
14+
contents: write
15+
16+
jobs:
17+
build:
18+
name: build-${{ matrix.name }}
19+
strategy:
20+
fail-fast: false
21+
matrix:
22+
include:
23+
- { os: ubuntu-latest, name: linux-x64 }
24+
- { os: ubuntu-24.04-arm, name: linux-arm64 }
25+
- { os: macos-13, name: macos-x64 }
26+
- { os: macos-latest, name: macos-arm64 }
27+
- { os: windows-latest, name: windows-x64 }
28+
runs-on: ${{ matrix.os }}
29+
defaults:
30+
run:
31+
shell: bash
32+
working-directory: runtime/llama.cpp
33+
steps:
34+
- uses: actions/checkout@v4
35+
- name: Configure and build
36+
run: |
37+
cmake -B build -DCMAKE_BUILD_TYPE=Release
38+
cmake --build build --config Release -j
39+
- name: Package
40+
run: |
41+
mkdir -p pkg
42+
cp build/bin/llama-funasr-* pkg/ 2>/dev/null || true
43+
cp build/bin/Release/llama-funasr-* pkg/ 2>/dev/null || true
44+
cp README.md download-funasr-model.sh pkg/ 2>/dev/null || true
45+
echo "--- packaged binaries ---"; ls -la pkg
46+
if [ "${{ runner.os }}" = "Windows" ]; then
47+
7z a "funasr-llamacpp-${{ matrix.name }}.zip" ./pkg/*
48+
else
49+
tar czf "funasr-llamacpp-${{ matrix.name }}.tar.gz" -C pkg .
50+
fi
51+
- uses: actions/upload-artifact@v4
52+
with:
53+
name: funasr-llamacpp-${{ matrix.name }}
54+
path: runtime/llama.cpp/funasr-llamacpp-${{ matrix.name }}.*
55+
if-no-files-found: error
56+
57+
release:
58+
needs: build
59+
if: startsWith(github.ref, 'refs/tags/')
60+
runs-on: ubuntu-latest
61+
steps:
62+
- uses: actions/download-artifact@v4
63+
with:
64+
path: dist
65+
merge-multiple: true
66+
- name: Create GitHub Release
67+
env:
68+
GH_TOKEN: ${{ github.token }}
69+
run: |
70+
gh release create "${{ github.ref_name }}" dist/* \
71+
--repo "${{ github.repository }}" \
72+
--title "FunASR llama.cpp runtime ${{ github.ref_name }}" \
73+
--notes "Prebuilt self-contained binaries for the FunASR llama.cpp / GGUF runtime — SenseVoice, Paraformer and Fun-ASR-Nano with built-in FSMN-VAD (a whisper.cpp-style on-device ASR, strong on Chinese). Get a model with \`bash download-funasr-model.sh <sensevoice|paraformer|nano>\`, then run \`llama-funasr-cli\` / \`llama-funasr-sensevoice\` / \`llama-funasr-paraformer\`. No Python, no build. Docs: runtime/llama.cpp/README.md"

0 commit comments

Comments
 (0)