@@ -9,13 +9,14 @@ permissions:
99jobs :
1010 build :
1111 runs-on : ${{ matrix.os }}
12- name : ${{ matrix.name }}${{ matrix.arch && format('-{0}', matrix.arch) || '' }} build${{ matrix.arch != 'arm64-v8a' && matrix.name != 'isim' && matrix.name != 'ios' && ' + test' || ''}}
12+ container : ${{ matrix.container && matrix.container || '' }}
13+ name : ${{ matrix.name }}${{ matrix.arch && format('-{0}', matrix.arch) || '' }} build${{ matrix.arch != 'arm64-v8a' && matrix.name != 'ios-sim' && matrix.name != 'ios' && matrix.name != 'apple-xcframework' && ' + test' || ''}}
1314 timeout-minutes : 120
1415 strategy :
1516 fail-fast : false
1617 matrix :
1718 include :
18- - os : macos-latest
19+ - os : macos-15
1920 name : macos
2021 make : LLAMA="-DGGML_NATIVE=OFF -DGGML_METAL=ON -DGGML_ACCELERATE=ON -DGGML_BLAS=ON -DGGML_BLAS_VENDOR=Apple" WHISPER="-DWHISPER_COREML=ON -DWHISPER_COREML_ALLOW_FALLBACK=ON"
2122 - os : ubuntu-22.04
@@ -26,14 +27,32 @@ jobs:
2627 arch : x86_64
2728 name : linux-gpu
2829 make : LLAMA="-DGGML_NATIVE=OFF -DGGML_CPU=ON -DGGML_VULKAN=ON -DGGML_OPENCL=ON"
29- - os : LinuxARM64
30+ - os : ubuntu-22.04-arm
3031 arch : arm64
3132 name : linux-cpu
3233 make : LLAMA="-DGGML_NATIVE=OFF -DGGML_CPU=ON -DGGML_CPU_ARM_ARCH=armv8.2-a"
33- - os : LinuxARM64
34+ - os : ubuntu-22.04-arm
3435 arch : arm64
3536 name : linux-gpu
3637 make : LLAMA="-DGGML_NATIVE=OFF -DGGML_CPU=ON -DGGML_VULKAN=ON -DGGML_OPENCL=ON"
38+ - os : ubuntu-22.04
39+ arch : x86_64
40+ name : linux-musl-cpu
41+ container : alpine:latest
42+ make : LLAMA="-DGGML_NATIVE=OFF -DGGML_CPU=ON -DGGML_AVX2=ON"
43+ - os : ubuntu-22.04
44+ arch : x86_64
45+ name : linux-musl-gpu
46+ container : alpine:latest
47+ make : LLAMA="-DGGML_NATIVE=OFF -DGGML_CPU=ON -DGGML_VULKAN=ON -DGGML_OPENCL=ON"
48+ - os : ubuntu-22.04-arm
49+ arch : arm64
50+ name : linux-musl-cpu
51+ make : LLAMA="-DGGML_NATIVE=OFF -DGGML_CPU=ON -DGGML_CPU_ARM_ARCH=armv8.2-a"
52+ - os : ubuntu-22.04-arm
53+ arch : arm64
54+ name : linux-musl-gpu
55+ make : LLAMA="-DGGML_NATIVE=OFF -DGGML_CPU=ON -DGGML_VULKAN=ON -DGGML_OPENCL=ON"
3756 - os : windows-2022
3857 arch : x86_64
3958 name : windows-cpu
@@ -42,25 +61,28 @@ jobs:
4261 arch : x86_64
4362 name : windows-gpu
4463 make : LLAMA="-DGGML_NATIVE=OFF -DGGML_CPU=ON -DGGML_VULKAN=ON -DGGML_OPENCL=ON"
45- - os : ubuntu-latest
64+ - os : ubuntu-22.04
4665 arch : x86_64
4766 name : android
4867 make : PLATFORM=android ARCH=x86_64
4968 sqlite-amalgamation-zip : https://sqlite.org/2025/sqlite-amalgamation-3490100.zip
50- - os : ubuntu-latest
69+ - os : ubuntu-22.04
5170 arch : arm64-v8a
5271 name : android
5372 make : PLATFORM=android ARCH=arm64-v8a LLAMA="-DGGML_CPU_ARM_ARCH=armv8.2-a+dotprod"
54- - os : macos-latest
73+ - os : macos-15
5574 name : ios
5675 make : PLATFORM=ios LLAMA="-DGGML_NATIVE=OFF -DGGML_METAL=ON -DGGML_ACCELERATE=ON -DGGML_BLAS=ON -DGGML_BLAS_VENDOR=Apple" WHISPER="-DWHISPER_COREML=ON -DWHISPER_COREML_ALLOW_FALLBACK=ON"
57- - os : macos-latest
58- name : isim
59- make : PLATFORM=isim LLAMA="-DGGML_NATIVE=OFF -DGGML_METAL=ON -DGGML_ACCELERATE=ON -DGGML_BLAS=ON -DGGML_BLAS_VENDOR=Apple" WHISPER="-DWHISPER_COREML=ON -DWHISPER_COREML_ALLOW_FALLBACK=ON"
76+ - os : macos-15
77+ name : ios-sim
78+ make : PLATFORM=ios-sim LLAMA="-DGGML_NATIVE=OFF -DGGML_METAL=ON -DGGML_ACCELERATE=ON -DGGML_BLAS=ON -DGGML_BLAS_VENDOR=Apple" WHISPER="-DWHISPER_COREML=ON -DWHISPER_COREML_ALLOW_FALLBACK=ON"
79+ - os : macos-15
80+ name : apple-xcframework
81+ make : xcframework LLAMA="-DGGML_NATIVE=OFF -DGGML_METAL=ON -DGGML_ACCELERATE=ON -DGGML_BLAS=ON -DGGML_BLAS_VENDOR=Apple" WHISPER="-DWHISPER_COREML=ON -DWHISPER_COREML_ALLOW_FALLBACK=ON"
6082
6183 defaults :
6284 run :
63- shell : bash
85+ shell : ${{ matrix.container && 'sh' || ' bash' }}
6486
6587 steps :
6688
@@ -116,6 +138,25 @@ jobs:
116138 ${{ matrix.name == 'windows-gpu' && 'mingw-w64-x86_64-opencl-headers' || '' }}
117139 ${{ matrix.name == 'windows-gpu' && 'mingw-w64-x86_64-opencl-icd' || '' }}
118140
141+ - name : macos install dependencies
142+ if : matrix.name == 'macos'
143+ run : brew link sqlite --force
144+
145+ - name : linux-musl x86_64 install dependencies
146+ if : matrix.name == 'linux-musl' && matrix.arch == 'x86_64'
147+ run : apk update && apk add --no-cache gcc make sqlite musl-dev linux-headers
148+
149+ - name : linux-musl arm64 setup container
150+ if : matrix.name == 'linux-musl' && matrix.arch == 'arm64'
151+ run : |
152+ docker run -d --name alpine \
153+ --platform linux/arm64 \
154+ -v ${{ github.workspace }}:/workspace \
155+ -w /workspace \
156+ alpine:latest \
157+ tail -f /dev/null
158+ docker exec alpine sh -c "apk update && apk add --no-cache gcc make sqlite musl-dev linux-headers"
159+
119160 - name : linux install opencl
120161 if : matrix.name == 'linux-gpu'
121162 run : sudo apt-get install -y opencl-headers ocl-icd-opencl-dev
@@ -190,7 +231,7 @@ jobs:
190231
191232 - name : unix build llama.cpp
192233 if : matrix.os != 'windows-2022' && steps.cache-llama.outputs.cache-hit != 'true'
193- run : make build/llama.cpp.stamp ${{ matrix.make && matrix.make || ''}}
234+ run : ${{ matrix.name == 'linux-musl' && matrix.arch == 'arm64' && 'docker exec alpine' || '' }} make build/llama.cpp.stamp ${{ matrix.make && matrix.make || ''}}
194235
195236 - name : windows build whisper.cpp
196237 if : matrix.os == 'windows-2022' && steps.cache-whisper.outputs.cache-hit != 'true'
@@ -201,7 +242,7 @@ jobs:
201242
202243 - name : unix build whisper.cpp
203244 if : matrix.os != 'windows-2022' && steps.cache-whisper.outputs.cache-hit != 'true'
204- run : make build/whisper.cpp.stamp ${{ matrix.make && matrix.make || ''}}
245+ run : ${{ matrix.name == 'linux-musl' && matrix.arch == 'arm64' && 'docker exec alpine' || '' }} make build/whisper.cpp.stamp ${{ matrix.make && matrix.make || ''}}
205246
206247 - name : windows build miniaudio
207248 if : matrix.os == 'windows-2022' && steps.cache-miniaudio.outputs.cache-hit != 'true'
@@ -210,7 +251,7 @@ jobs:
210251
211252 - name : unix build miniaudio
212253 if : matrix.os != 'windows-2022' && steps.cache-miniaudio.outputs.cache-hit != 'true'
213- run : make build/miniaudio.stamp ${{ matrix.make && matrix.make || ''}}
254+ run : ${{ matrix.name == 'linux-musl' && matrix.arch == 'arm64' && 'docker exec alpine' || '' }} make build/miniaudio.stamp ${{ matrix.make && matrix.make || ''}}
214255
215256 - name : windows build sqlite-ai
216257 if : matrix.os == 'windows-2022'
@@ -221,11 +262,36 @@ jobs:
221262
222263 - name : unix build sqlite-ai
223264 if : matrix.os != 'windows-2022'
224- run : make extension ${{ matrix.make && matrix.make || ''}}
265+ run : ${{ matrix.name == 'linux-musl' && matrix.arch == 'arm64' && 'docker exec alpine' || '' }} make extension ${{ matrix.make && matrix.make || ''}}
225266
226- - name : macos install sqlite3 without SQLITE_OMIT_LOAD_EXTENSION
227- if : matrix.name == 'macos'
228- run : brew link sqlite --force
267+ - name : create keychain for codesign
268+ if : matrix.os == 'macos-15'
269+ run : |
270+ echo "${{ secrets.APPLE_CERTIFICATE }}" | base64 --decode > certificate.p12
271+ security create-keychain -p "${{ secrets.KEYCHAIN_PASSWORD }}" build.keychain
272+ security default-keychain -s build.keychain
273+ security unlock-keychain -p "${{ secrets.KEYCHAIN_PASSWORD }}" build.keychain
274+ security import certificate.p12 -k build.keychain -P "${{ secrets.CERTIFICATE_PASSWORD }}" -T /usr/bin/codesign
275+ security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k "${{ secrets.KEYCHAIN_PASSWORD }}" build.keychain
276+
277+ - name : codesign dylib
278+ if : matrix.os == 'macos-15' && matrix.name != 'apple-xcframework'
279+ run : codesign --sign "${{ secrets.APPLE_TEAM_ID }}" --timestamp --options runtime dist/ai.dylib
280+
281+ - name : codesign and notarize xcframework
282+ if : matrix.name == 'apple-xcframework'
283+ run : |
284+ find dist/ai.xcframework -name "*.framework" -exec echo "Signing: {}" \; -exec codesign --sign "${{ secrets.APPLE_TEAM_ID }}" --timestamp --options runtime {} \; # Sign each individual framework FIRST
285+ codesign --sign "${{ secrets.APPLE_TEAM_ID }}" --timestamp --options runtime dist/ai.xcframework # Then sign the xcframework wrapper
286+ ditto -c -k --keepParent dist/ai.xcframework dist/ai.xcframework.zip
287+ xcrun notarytool submit dist/ai.xcframework.zip --apple-id "${{ secrets.APPLE_ID }}" --password "${{ secrets.APPLE_PASSWORD }}" --team-id "${{ secrets.APPLE_TEAM_ID }}" --wait
288+ rm dist/ai.xcframework.zip
289+
290+ - name : cleanup keychain for codesign
291+ if : matrix.os == 'macos-15'
292+ run : |
293+ rm certificate.p12
294+ security delete-keychain build.keychain
229295
230296 - name : android setup test environment
231297 if : matrix.name == 'android' && matrix.arch != 'arm64-v8a'
@@ -280,7 +346,7 @@ jobs:
280346
281347 - name : unix test sqlite-ai
282348 if : contains(matrix.name, 'linux') || matrix.name == 'macos'
283- run : make test ${{ matrix.make && matrix.make || ''}}
349+ run : ${{ matrix.name == 'linux-musl' && matrix.arch == 'arm64' && 'docker exec alpine' || '' }} make test ${{ matrix.make && matrix.make || ''}}
284350
285351286352 if : always()
@@ -290,7 +356,7 @@ jobs:
290356 if-no-files-found : error
291357
292358 release :
293- runs-on : ubuntu-latest
359+ runs-on : ubuntu-22.04
294360 name : release
295361 needs : build
296362 if : github.ref == 'refs/heads/main'
@@ -324,9 +390,10 @@ jobs:
324390 for folder in "artifacts"/*; do
325391 if [ -d "$folder" ]; then
326392 name=$(basename "$folder")
327- zip -jq "${name}-${{ steps.tag.outputs.version }}.zip" "$folder"/*
328- tar -cJf "${name}-${{ steps.tag.outputs.version }}.tar.xz" -C "$folder" .
329- tar -czf "${name}-${{ steps.tag.outputs.version }}.tar.gz" -C "$folder" .
393+ if [[ "$name" != "ai-apple-xcframework" ]]; then
394+ tar -czf "${name}-${{ steps.tag.outputs.version }}.tar.gz" -C "$folder" .
395+ fi
396+ (cd "$folder" && zip -rq "../../${name}-${{ steps.tag.outputs.version }}.zip" .)
330397 fi
331398 done
332399
@@ -337,6 +404,5 @@ jobs:
337404 tag_name : ${{ steps.tag.outputs.version }}
338405 files : |
339406 ai-*-${{ steps.tag.outputs.version }}.zip
340- ai-*-${{ steps.tag.outputs.version }}.tar.xz
341407 ai-*-${{ steps.tag.outputs.version }}.tar.gz
342408 make_latest : true
0 commit comments