Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
126 changes: 126 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -513,6 +513,12 @@ jobs:
mkdir -p "$STAGE"
cp -r build/bin/* "$STAGE/" 2>/dev/null || true
find build -name "*.so*" -exec cp {} "$STAGE/" \; 2>/dev/null || true
# Rewrite the absolute build-tree rpath to $ORIGIN so the relocated musl
# binaries find their sibling .so files (musl doesn't search the exe dir).
if ! command -v patchelf >/dev/null; then sudo apt-get update -qq && sudo apt-get install -y -qq patchelf; fi
for f in "$STAGE"/*; do
[ -f "$f" ] && [ ! -L "$f" ] && file "$f" | grep -q ELF && patchelf --set-rpath '$ORIGIN' "$f" 2>/dev/null || true
done
tar -czf "$ARCHIVE" "$STAGE"
echo "ARCHIVE=$ARCHIVE" >> $GITHUB_ENV

Expand Down Expand Up @@ -873,6 +879,124 @@ jobs:
name: ${{ env.ARCHIVE }}
path: ${{ env.ARCHIVE }}

# ════════════════════════════════════════════════════════════════════════════════
# 8b. CPU / Vulkan — Linux musl (Alpine)
# Compiled inside an Alpine container so it links musl; libstdc++/libgcc are
# static so the archive is self-contained. arm64 drops the x86-only march/AVX
# flags. Runs on native ARM runners for arm64 (no QEMU).
# ════════════════════════════════════════════════════════════════════════════════
linux-musl-cpu:
runs-on: ${{ matrix.runner }}
needs: determine-tag
strategy:
fail-fast: false
matrix:
include:
- runner: ubuntu-latest
arch: x86_64
cpu_flags: "-DGGML_AVX=ON -DGGML_AVX2=ON -DGGML_FMA=ON -DGGML_AVX512=OFF -DCMAKE_C_FLAGS=-march=x86-64-v3 -DCMAKE_CXX_FLAGS=-march=x86-64-v3"
- runner: ubuntu-24.04-arm
arch: aarch64
cpu_flags: ""
steps:
- uses: actions/checkout@v4

- name: Build (Alpine / musl)
run: |
docker run --rm -v "$PWD:/src" -w /src alpine:latest sh -euxc '
apk add --no-cache build-base cmake git sdl2-dev
cmake -B build \
-DCMAKE_BUILD_TYPE=Release \
-DGGML_NATIVE=OFF \
${{ matrix.cpu_flags }} \
-DWHISPER_BUILD_EXAMPLES=ON \
-DWHISPER_BUILD_TESTS=OFF \
-DWHISPER_BUILD_SERVER=ON \
-DCMAKE_EXE_LINKER_FLAGS="-static-libgcc -static-libstdc++" \
-DCMAKE_SHARED_LINKER_FLAGS="-static-libgcc -static-libstdc++"
cmake --build build --config Release -j"$(nproc)"
chmod -R a+rwX build
'

- name: Package
run: |
VER="${{ needs.determine-tag.outputs.version }}"
ARCHIVE="whisper-${VER}-linux-musl-cpu-${{ matrix.arch }}.tar.gz"
STAGE="whisper-${VER}-linux-musl-cpu-${{ matrix.arch }}"
mkdir -p "$STAGE"
cp -r build/bin/* "$STAGE/" 2>/dev/null || true
find build -name "*.so*" -exec cp {} "$STAGE/" \; 2>/dev/null || true
# Rewrite the absolute build-tree rpath to $ORIGIN so the relocated musl
# binaries find their sibling .so files (musl doesn't search the exe dir).
if ! command -v patchelf >/dev/null; then sudo apt-get update -qq && sudo apt-get install -y -qq patchelf; fi
for f in "$STAGE"/*; do
[ -f "$f" ] && [ ! -L "$f" ] && file "$f" | grep -q ELF && patchelf --set-rpath '$ORIGIN' "$f" 2>/dev/null || true
done
tar -czf "$ARCHIVE" "$STAGE"
echo "ARCHIVE=$ARCHIVE" >> $GITHUB_ENV

- uses: actions/upload-artifact@v4
with:
name: ${{ env.ARCHIVE }}
path: ${{ env.ARCHIVE }}

linux-musl-vulkan:
runs-on: ${{ matrix.runner }}
needs: determine-tag
strategy:
fail-fast: false
matrix:
include:
- runner: ubuntu-latest
arch: x86_64
cpu_flags: "-DGGML_AVX=ON -DGGML_AVX2=ON -DGGML_FMA=ON -DGGML_AVX512=OFF -DCMAKE_C_FLAGS=-march=x86-64-v3 -DCMAKE_CXX_FLAGS=-march=x86-64-v3"
- runner: ubuntu-24.04-arm
arch: aarch64
cpu_flags: ""
steps:
- uses: actions/checkout@v4

- name: Build (Alpine / musl)
run: |
docker run --rm -v "$PWD:/src" -w /src alpine:latest sh -euxc '
apk add --no-cache build-base cmake git sdl2-dev \
vulkan-loader-dev vulkan-headers glslang shaderc spirv-tools spirv-headers
cmake -B build \
-DCMAKE_BUILD_TYPE=Release \
-DGGML_NATIVE=OFF \
${{ matrix.cpu_flags }} \
-DGGML_VULKAN=ON \
-DWHISPER_BUILD_EXAMPLES=ON \
-DWHISPER_BUILD_TESTS=OFF \
-DWHISPER_BUILD_SERVER=ON \
-DCMAKE_EXE_LINKER_FLAGS="-static-libgcc -static-libstdc++" \
-DCMAKE_SHARED_LINKER_FLAGS="-static-libgcc -static-libstdc++"
cmake --build build --config Release -j"$(nproc)"
chmod -R a+rwX build
'

- name: Package
run: |
VER="${{ needs.determine-tag.outputs.version }}"
ARCHIVE="whisper-${VER}-linux-musl-vulkan-${{ matrix.arch }}.tar.gz"
STAGE="whisper-${VER}-linux-musl-vulkan-${{ matrix.arch }}"
mkdir -p "$STAGE"
cp -r build/bin/* "$STAGE/" 2>/dev/null || true
find build -name "*.so*" -exec cp {} "$STAGE/" \; 2>/dev/null || true
# Rewrite the absolute build-tree rpath to $ORIGIN so the relocated musl
# binaries find their sibling .so files (musl doesn't search the exe dir).
if ! command -v patchelf >/dev/null; then sudo apt-get update -qq && sudo apt-get install -y -qq patchelf; fi
for f in "$STAGE"/*; do
[ -f "$f" ] && [ ! -L "$f" ] && file "$f" | grep -q ELF && patchelf --set-rpath '$ORIGIN' "$f" 2>/dev/null || true
done
tar -czf "$ARCHIVE" "$STAGE"
echo "ARCHIVE=$ARCHIVE" >> $GITHUB_ENV

- uses: actions/upload-artifact@v4
with:
name: ${{ env.ARCHIVE }}
path: ${{ env.ARCHIVE }}

# ════════════════════════════════════════════════════════════════════════════════
# 8. CPU — Windows
# ════════════════════════════════════════════════════════════════════════════════
Expand Down Expand Up @@ -1242,6 +1366,8 @@ jobs:
- macos-metal
- linux-cpu
- windows-cpu
- linux-musl-cpu
- linux-musl-vulkan
- test-cpu-windows
- test-cpu-linux
- test-vulkan-windows
Expand Down
Loading