Repository navigation
1089 lines (1056 loc) · 51.9 KB
/
Copy pathrelease.yml
File metadata and controls
1089 lines (1056 loc) · 51.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# audio.cpp - release.yml
#
# Ported from llama.cpp's release workflow and stripped to the backends
# audio.cpp ships: CPU, CUDA, Vulkan, Metal and best-effort HIP test builds.
# Windows CUDA uses the GGML_BACKEND_DL model so the
# CUDA backend is shipped once as ggml-cuda.dll (thin cli/server/gguf shells)
# with the heavy CUDA runtime DLLs in a separate cudart...zip, and the release
# job publishes.
#
# Semantic-version, tag-driven releases. The workflow runs when a `v*` (semver)
# tag is pushed (drafting a Release and Publishing it) or when run manually
# from the Actions UI with an explicit version. Publishing attaches the built
# binaries to that version's GitHub Release. There is NO auto-release on every
# push to `main`.
name: Release
on:
workflow_dispatch:
inputs:
version:
description: 'Semantic version to release, e.g. 1.2.0 or v1.2.0 (used for manual runs; tag-triggered runs use the pushed tag).'
required: true
default: ''
type: string
publish:
description: 'Publish a GitHub Release after the build. Leave unchecked for a build-only dry run.'
required: false
default: false
type: boolean
source_repository:
description: 'Optional source repository; defaults to this repository.'
required: false
default: ''
type: string
source_ref:
description: 'Optional source revision; defaults to the workflow revision.'
required: false
default: ''
type: string
push:
tags:
- 'v*'
env:
GH_TOKEN: ${{ github.token }}
BUILD_TARGETS: audiocpp_cli audiocpp_server audiocpp_gguf
VULKAN_VERSION: '1.4.357.0'
CMAKE_ARGS: "-DAUDIOCPP_DEPLOYMENT_BUILD=ON -DAUDIOCPP_BUILD_NATIVE_MODEL_MANAGER=ON -DENGINE_ENABLE_LLAMAFILE=ON -DENGINE_ENABLE_CUDA_GRAPHS=ON"
# note: run this workflow one at a time for better cache reuse
concurrency:
group: release
queue: max
jobs:
check-release:
runs-on: ubuntu-latest
outputs:
should_release: ${{ steps.check.outputs.should_release }}
steps:
# The only triggers are a manually-run workflow or a pushed `v*` tag -
# both are intentional, so always proceed.
- id: check
run: echo "should_release=true" >> "$GITHUB_OUTPUT"
get-version:
runs-on: ubuntu-latest
outputs:
tag: ${{ steps.version.outputs.tag }}
version: ${{ steps.version.outputs.version }}
source_sha: ${{ steps.source.outputs.sha }}
needs: check-release
if: ${{ needs.check-release.outputs.should_release == 'true' }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
repository: ${{ inputs.source_repository || github.repository }}
ref: ${{ inputs.source_ref || github.sha }}
- name: Resolve source revision
id: source
shell: bash
env:
SOURCE_REPOSITORY: ${{ inputs.source_repository || github.repository }}
PUBLISH: ${{ github.ref_type == 'tag' || inputs.publish }}
run: |
if [[ "$PUBLISH" == true && "$SOURCE_REPOSITORY" != "$GITHUB_REPOSITORY" ]]; then
echo "::error::Publish from the source repository, not a separate workflow repository."
exit 1
fi
echo "sha=$(git rev-parse HEAD)" >> "$GITHUB_OUTPUT"
- name: Resolve release tag
id: version
run: |
if [[ "${{ github.ref_type }}" == "tag" ]]; then
TAG="${{ github.ref_name }}"
elif [[ -n "${{ inputs.version }}" ]]; then
TAG="${{ inputs.version }}"
else
echo "::error::No semver tag or version provided (push a v* tag, or run manually with a version)."
exit 1
fi
[[ "$TAG" == v* ]] || TAG="v${TAG}"
VERSION="${TAG#v}"
echo "tag=${TAG}" >> "$GITHUB_OUTPUT"
echo "version=${VERSION}" >> "$GITHUB_OUTPUT"
server-config-examples:
name: Server config examples
needs: get-version
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
repository: ${{ inputs.source_repository || github.repository }}
ref: ${{ needs.get-version.outputs.source_sha }}
- name: Package server config examples
env:
TAG: ${{ needs.get-version.outputs.tag }}
run: zip -qr "audio-${TAG}-server-config-examples.zip" LICENSE examples/server
- uses: actions/upload-artifact@v4
with:
name: audio-${{ needs.get-version.outputs.tag }}-server-config-examples
path: audio-${{ needs.get-version.outputs.tag }}-server-config-examples.zip
if-no-files-found: error
macos-metal:
name: macOS (${{ matrix.build }})
needs: [check-release, get-version]
if: ${{ needs.check-release.outputs.should_release == 'true' }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- build: 'arm64'
arch: 'arm64'
os: macos-26
defines: '-DGGML_METAL=ON -DCMAKE_OSX_DEPLOYMENT_TARGET=13.3 -DENGINE_ENABLE_OPENMP=OFF -DGGML_OPENMP=OFF'
- build: 'x64'
arch: 'x64'
os: macos-26-intel
# Metal disabled on x64 (GitHub Intel runners have no usable GPU)
defines: '-DGGML_METAL=OFF -DCMAKE_OSX_DEPLOYMENT_TARGET=13.3 -DENGINE_ENABLE_OPENMP=OFF -DGGML_OPENMP=OFF'
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
repository: ${{ inputs.source_repository || github.repository }}
ref: ${{ needs.get-version.outputs.source_sha }}
- name: Configure
run: |
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_RPATH='@loader_path' -DCMAKE_BUILD_WITH_INSTALL_RPATH=ON \
-DENGINE_ENABLE_CUDA=OFF -DENGINE_ENABLE_VULKAN=OFF \
-DAUDIOCPP_VERSION=${{ needs.get-version.outputs.version }} \
${{ matrix.defines }} ${{ env.CMAKE_ARGS }}
- name: Build
run: cmake --build build --config Release --parallel "$(sysctl -n hw.logicalcpu)" --target ${{ env.BUILD_TARGETS }}
- name: Stage bundle
run: |
cp LICENSE build/bin/ 2>/dev/null || true
cp -r tools build/bin/tools 2>/dev/null || true
cp -r model_specs build/bin/model_specs 2>/dev/null || true
- uses: actions/upload-artifact@v4
with:
name: audio-${{ needs.get-version.outputs.tag }}-bin-macos-${{ matrix.arch }}-metal
path: build/bin/*
- name: Build and stage C API library
run: |
cmake -S . -B build -DAUDIOCPP_BUILD_C_API=ON
cmake --build build --parallel "$(sysctl -n hw.logicalcpu)" --target audiocpp
mkdir -p dist-lib/libs dist-lib/include
cp include/audiocpp.h dist-lib/include/
cp LICENSE dist-lib/
find build/bin -maxdepth 1 \( -name '*.so*' -o -name '*.dylib' \) -exec cp -P {} dist-lib/libs/ \;
mv build/bin/libaudiocpp* dist-lib/libs/
tar -czf audio-${{ needs.get-version.outputs.tag }}-lib-macos-${{ matrix.arch }}-metal.tar.gz -C dist-lib .
- uses: actions/upload-artifact@v4
with:
name: audio-${{ needs.get-version.outputs.tag }}-lib-macos-${{ matrix.arch }}-metal
path: audio-${{ needs.get-version.outputs.tag }}-lib-macos-${{ matrix.arch }}-metal.tar.gz
linux-cpu:
name: Ubuntu x64 (CPU)
needs: [check-release, get-version]
if: ${{ needs.check-release.outputs.should_release == 'true' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
repository: ${{ inputs.source_repository || github.repository }}
ref: ${{ needs.get-version.outputs.source_sha }}
- name: Install deps
run: sudo apt-get update && sudo apt-get install -y build-essential cmake make glslc libvulkan-dev spirv-headers
- name: Configure
run: |
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release \
-DENGINE_ENABLE_CUDA=OFF -DENGINE_ENABLE_VULKAN=OFF \
-DAUDIOCPP_VERSION=${{ needs.get-version.outputs.version }} \
${{ env.CMAKE_ARGS }}
- name: Build
run: cmake --build build --config Release --parallel "$(nproc)" --target ${{ env.BUILD_TARGETS }}
- name: Stage bundle
run: |
cp LICENSE build/bin/ 2>/dev/null || true
cp -r tools build/bin/tools 2>/dev/null || true
cp -r model_specs build/bin/model_specs 2>/dev/null || true
- uses: actions/upload-artifact@v4
with:
name: audio-${{ needs.get-version.outputs.tag }}-bin-ubuntu-x64-cpu
path: build/bin/*
- name: Build and stage C API library
run: |
cmake -S . -B build -DAUDIOCPP_BUILD_C_API=ON
cmake --build build --parallel "$(nproc)" --target audiocpp
mkdir -p dist-lib/libs dist-lib/include
cp include/audiocpp.h dist-lib/include/
cp LICENSE dist-lib/
find build/bin -maxdepth 1 \( -name '*.so*' -o -name '*.dylib' \) -exec cp -P {} dist-lib/libs/ \;
mv build/bin/libaudiocpp* dist-lib/libs/
tar -czf audio-${{ needs.get-version.outputs.tag }}-lib-ubuntu-x64-cpu.tar.gz -C dist-lib .
- uses: actions/upload-artifact@v4
with:
name: audio-${{ needs.get-version.outputs.tag }}-lib-ubuntu-x64-cpu
path: audio-${{ needs.get-version.outputs.tag }}-lib-ubuntu-x64-cpu.tar.gz
linux-cpu-portable:
name: Ubuntu x64 (CPU portable)
needs: [check-release, get-version]
if: ${{ needs.check-release.outputs.should_release == 'true' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
repository: ${{ inputs.source_repository || github.repository }}
ref: ${{ needs.get-version.outputs.source_sha }}
- name: Install deps
run: sudo apt-get update && sudo apt-get install -y build-essential cmake make glslc libvulkan-dev spirv-headers
- name: Configure
run: |
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release \
-DENGINE_ENABLE_CUDA=OFF -DENGINE_ENABLE_VULKAN=OFF \
-DENGINE_ENABLE_NATIVE_CPU=OFF \
-DENGINE_ENABLE_CPU_ALL_VARIANTS=ON \
-DAUDIOCPP_VERSION=${{ needs.get-version.outputs.version }} \
${{ env.CMAKE_ARGS }}
- name: Build
run: cmake --build build --config Release --parallel "$(nproc)" --target ${{ env.BUILD_TARGETS }}
- name: Stage bundle
run: |
cp LICENSE build/bin/ 2>/dev/null || true
cp -r tools build/bin/tools 2>/dev/null || true
cp -r model_specs build/bin/model_specs 2>/dev/null || true
- uses: actions/upload-artifact@v4
with:
name: audio-${{ needs.get-version.outputs.tag }}-bin-ubuntu-x64-cpu-portable
path: build/bin/*
- name: Build and stage C API library
run: |
cmake -S . -B build -DAUDIOCPP_BUILD_C_API=ON
cmake --build build --parallel "$(nproc)" --target audiocpp
mkdir -p dist-lib/libs dist-lib/include
cp include/audiocpp.h dist-lib/include/
cp LICENSE dist-lib/
find build/bin -maxdepth 1 \( -name '*.so*' -o -name '*.dylib' \) -exec cp -P {} dist-lib/libs/ \;
mv build/bin/libaudiocpp* dist-lib/libs/
tar -czf audio-${{ needs.get-version.outputs.tag }}-lib-ubuntu-x64-cpu-portable.tar.gz -C dist-lib .
- uses: actions/upload-artifact@v4
with:
name: audio-${{ needs.get-version.outputs.tag }}-lib-ubuntu-x64-cpu-portable
path: audio-${{ needs.get-version.outputs.tag }}-lib-ubuntu-x64-cpu-portable.tar.gz
linux-vulkan:
name: Ubuntu x64 (Vulkan)
needs: [check-release, get-version]
if: ${{ needs.check-release.outputs.should_release == 'true' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
repository: ${{ inputs.source_repository || github.repository }}
ref: ${{ needs.get-version.outputs.source_sha }}
- name: Install deps
run: sudo apt-get update && sudo apt-get install -y build-essential cmake make glslc libvulkan-dev spirv-headers
- name: Configure
run: |
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release \
-DENGINE_ENABLE_CUDA=OFF -DENGINE_ENABLE_VULKAN=ON \
-DAUDIOCPP_VERSION=${{ needs.get-version.outputs.version }} \
${{ env.CMAKE_ARGS }}
- name: Build
run: cmake --build build --config Release --parallel "$(nproc)" --target ${{ env.BUILD_TARGETS }}
- name: Stage bundle
run: |
cp LICENSE build/bin/ 2>/dev/null || true
cp -r tools build/bin/tools 2>/dev/null || true
cp -r model_specs build/bin/model_specs 2>/dev/null || true
- uses: actions/upload-artifact@v4
with:
name: audio-${{ needs.get-version.outputs.tag }}-bin-ubuntu-x64-vulkan
path: build/bin/*
- name: Build and stage C API library
run: |
cmake -S . -B build -DAUDIOCPP_BUILD_C_API=ON
cmake --build build --parallel "$(nproc)" --target audiocpp
mkdir -p dist-lib/libs dist-lib/include
cp include/audiocpp.h dist-lib/include/
cp LICENSE dist-lib/
find build/bin -maxdepth 1 \( -name '*.so*' -o -name '*.dylib' \) -exec cp -P {} dist-lib/libs/ \;
mv build/bin/libaudiocpp* dist-lib/libs/
tar -czf audio-${{ needs.get-version.outputs.tag }}-lib-ubuntu-x64-vulkan.tar.gz -C dist-lib .
- uses: actions/upload-artifact@v4
with:
name: audio-${{ needs.get-version.outputs.tag }}-lib-ubuntu-x64-vulkan
path: audio-${{ needs.get-version.outputs.tag }}-lib-ubuntu-x64-vulkan.tar.gz
linux-vulkan-portable:
name: Ubuntu x64 (Vulkan portable)
needs: [check-release, get-version]
if: ${{ needs.check-release.outputs.should_release == 'true' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
repository: ${{ inputs.source_repository || github.repository }}
ref: ${{ needs.get-version.outputs.source_sha }}
- name: Install deps
run: sudo apt-get update && sudo apt-get install -y build-essential cmake make glslc libvulkan-dev spirv-headers
- name: Configure
run: |
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release \
-DENGINE_ENABLE_CUDA=OFF -DENGINE_ENABLE_VULKAN=ON \
-DENGINE_ENABLE_NATIVE_CPU=OFF \
-DENGINE_ENABLE_CPU_ALL_VARIANTS=ON \
-DAUDIOCPP_VERSION=${{ needs.get-version.outputs.version }} \
${{ env.CMAKE_ARGS }}
- name: Build
run: cmake --build build --config Release --parallel "$(nproc)" --target ${{ env.BUILD_TARGETS }}
- name: Stage bundle
run: |
cp LICENSE build/bin/ 2>/dev/null || true
cp -r tools build/bin/tools 2>/dev/null || true
cp -r model_specs build/bin/model_specs 2>/dev/null || true
- uses: actions/upload-artifact@v4
with:
name: audio-${{ needs.get-version.outputs.tag }}-bin-ubuntu-x64-vulkan-portable
path: build/bin/*
- name: Build and stage C API library
run: |
cmake -S . -B build -DAUDIOCPP_BUILD_C_API=ON
cmake --build build --parallel "$(nproc)" --target audiocpp
mkdir -p dist-lib/libs dist-lib/include
cp include/audiocpp.h dist-lib/include/
cp LICENSE dist-lib/
find build/bin -maxdepth 1 \( -name '*.so*' -o -name '*.dylib' \) -exec cp -P {} dist-lib/libs/ \;
mv build/bin/libaudiocpp* dist-lib/libs/
tar -czf audio-${{ needs.get-version.outputs.tag }}-lib-ubuntu-x64-vulkan-portable.tar.gz -C dist-lib .
- uses: actions/upload-artifact@v4
with:
name: audio-${{ needs.get-version.outputs.tag }}-lib-ubuntu-x64-vulkan-portable
path: audio-${{ needs.get-version.outputs.tag }}-lib-ubuntu-x64-vulkan-portable.tar.gz
linux-cuda-library:
name: 'Ubuntu x64 library (CUDA ${{ matrix.label }})'
needs: [check-release, get-version]
if: ${{ needs.check-release.outputs.should_release == 'true' }}
runs-on: ubuntu-latest
container: nvidia/cuda:${{ matrix.cuda }}-devel-ubuntu22.04
defaults:
run:
shell: bash
strategy:
fail-fast: false
matrix:
include:
- cuda: '12.8.1'
label: '12.8'
archs: '75;80;86;89;90'
- cuda: '13.3.0'
label: '13.3'
archs: '75;80;86;89;90;120'
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
repository: ${{ inputs.source_repository || github.repository }}
ref: ${{ needs.get-version.outputs.source_sha }}
- name: Install dependencies
run: |
apt-get update
DEBIAN_FRONTEND=noninteractive apt-get install -y software-properties-common
add-apt-repository -y ppa:ubuntu-toolchain-r/test
apt-get update
DEBIAN_FRONTEND=noninteractive apt-get install -y gcc-13 g++-13 cmake ninja-build python3 python-is-python3
- name: Build library
env:
CC: gcc-13
CXX: g++-13
CUDAHOSTCXX: g++-13
run: |
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release \
"-DCMAKE_CUDA_ARCHITECTURES=${{ matrix.archs }}" \
${{ matrix.label == '12.8' && '-DGGML_CUDA_NCCL=OFF' || '' }} \
-DENGINE_ENABLE_CUDA=ON -DENGINE_ENABLE_VULKAN=OFF \
-DENGINE_ENABLE_NATIVE_CPU=OFF -DENGINE_BUILD_TESTS=OFF \
-DCMAKE_SHARED_LINKER_FLAGS='-static-libstdc++ -static-libgcc' \
-DCMAKE_INSTALL_RPATH='$ORIGIN' -DCMAKE_BUILD_WITH_INSTALL_RPATH=ON \
-DAUDIOCPP_BUILD_C_API=ON -DAUDIOCPP_DEPLOYMENT_BUILD=ON \
-DENGINE_ENABLE_LLAMAFILE=ON -DENGINE_ENABLE_CUDA_GRAPHS=ON \
-DAUDIOCPP_VERSION=${{ needs.get-version.outputs.version }}
cmake --build build --parallel "$(nproc)" --target audiocpp
- name: Stage library
run: |
mkdir -p dist-lib/libs dist-lib/include dist-cudart
cp include/audiocpp.h dist-lib/include/
cp LICENSE dist-lib/
cp -P build/bin/libaudiocpp.so* dist-lib/libs/
ldd build/bin/libaudiocpp.so > build/library-dependencies.txt
awk '$3 ~ /^\/usr\/local\/cuda/ {print $1, $3}' build/library-dependencies.txt |
sort -u | while read -r name path; do cp -L "$path" "dist-cudart/$name"; done
cp /usr/share/doc/gcc-13-base/copyright dist-lib/GCC-RUNTIME-LICENSE
tar -czf audio-${{ needs.get-version.outputs.tag }}-cudart-ubuntu-x64-cuda${{ matrix.label }}.tar.gz -C dist-cudart .
tar -czf audio-${{ needs.get-version.outputs.tag }}-lib-ubuntu-x64-cuda${{ matrix.label }}.tar.gz -C dist-lib .
- uses: actions/upload-artifact@v4
with:
name: audio-${{ needs.get-version.outputs.tag }}-lib-ubuntu-x64-cuda${{ matrix.label }}
path: audio-${{ needs.get-version.outputs.tag }}-lib-ubuntu-x64-cuda${{ matrix.label }}.tar.gz
- uses: actions/upload-artifact@v4
with:
name: audio-${{ needs.get-version.outputs.tag }}-cudart-ubuntu-x64-cuda${{ matrix.label }}
path: audio-${{ needs.get-version.outputs.tag }}-cudart-ubuntu-x64-cuda${{ matrix.label }}.tar.gz
linux-cuda-colab:
name: Ubuntu x64 (CUDA 12.8, Colab T4)
needs: [check-release, get-version]
if: ${{ needs.check-release.outputs.should_release == 'true' }}
runs-on: ubuntu-latest
continue-on-error: true
container: nvidia/cuda:12.8.1-devel-ubuntu22.04
env:
CC: gcc-13
CXX: g++-13
CUDAHOSTCXX: g++-13
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
repository: ${{ inputs.source_repository || github.repository }}
ref: ${{ needs.get-version.outputs.source_sha }}
- name: Install dependencies
run: |
apt-get update -qq
DEBIAN_FRONTEND=noninteractive apt-get install -y -qq software-properties-common
add-apt-repository -y ppa:ubuntu-toolchain-r/test
apt-get update -qq
DEBIAN_FRONTEND=noninteractive apt-get install -y -qq gcc-13 g++-13 cmake ninja-build libssl-dev
- name: Configure
run: |
cmake -S . -B build/colab-cuda -G Ninja \
-DCMAKE_BUILD_TYPE=Release \
"-DCMAKE_CUDA_ARCHITECTURES=75;80;86;89;90" \
-DCMAKE_EXE_LINKER_FLAGS='-static-libstdc++ -static-libgcc' \
-DENGINE_ENABLE_CUDA=ON \
-DENGINE_ENABLE_VULKAN=OFF \
-DENGINE_ENABLE_NATIVE_CPU=OFF \
-DENGINE_BUILD_TESTS=OFF \
-DAUDIOCPP_VERSION=${{ needs.get-version.outputs.version }} \
-DAUDIOCPP_DEPLOYMENT_BUILD=ON \
-DAUDIOCPP_BUILD_NATIVE_MODEL_MANAGER=ON \
-DAUDIOCPP_USE_SYSTEM_OPENSSL=ON \
-DENGINE_ENABLE_LLAMAFILE=ON \
-DENGINE_ENABLE_CUDA_GRAPHS=ON
- name: Build server
run: cmake --build build/colab-cuda --parallel "$(nproc)" --target audiocpp_server
- name: Verify portable executable
run: |
ldd build/colab-cuda/bin/audiocpp_server | tee /tmp/audiocpp_server.ldd
if awk '/libcuda\.so\.1/ && /not found/ { next } /not found/ { print; bad=1 } END { exit bad ? 1 : 0 }' /tmp/audiocpp_server.ldd > /tmp/audiocpp_server.bad; then
true
else
echo "::error::The Colab executable has missing runtime dependencies."
cat /tmp/audiocpp_server.bad
exit 1
fi
readelf -d build/colab-cuda/bin/audiocpp_server | tee /tmp/audiocpp_server.needed
if grep -E 'Shared library: \[(libstdc\+\+|libgcc_s)\.so' /tmp/audiocpp_server.needed > /tmp/audiocpp_server.direct_bad; then
echo "::error::The Colab executable directly depends on non-portable C++ runtime libraries."
cat /tmp/audiocpp_server.direct_bad
exit 1
fi
- name: Stage bundle
run: |
mkdir -p dist/models
install -m 0755 build/colab-cuda/bin/audiocpp_server dist/audiocpp_server
install -m 0644 LICENSE dist/LICENSE
cp -r tools dist/tools
cp -r model_specs dist/model_specs
sha256sum dist/audiocpp_server > dist/SHA256SUMS
- uses: actions/upload-artifact@v4
with:
name: audio-${{ needs.get-version.outputs.tag }}-bin-ubuntu-x64-cuda12.8-colab
path: dist/*
windows-cpu:
name: Windows x64 (CPU)
needs: [check-release, get-version]
if: ${{ needs.check-release.outputs.should_release == 'true' }}
runs-on: windows-2022
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
repository: ${{ inputs.source_repository || github.repository }}
ref: ${{ needs.get-version.outputs.source_sha }}
- name: Build
shell: pwsh
run: |
.\scripts\build_windows.ps1 -Preset windows-cpu-release -Target audiocpp_cli -DeploymentBuild -NativeModelManager -Version ${{ needs.get-version.outputs.version }}
.\scripts\build_windows.ps1 -Preset windows-cpu-release -Target audiocpp_server -DeploymentBuild -NativeModelManager -Version ${{ needs.get-version.outputs.version }}
.\scripts\build_windows.ps1 -Preset windows-cpu-release -Target audiocpp_gguf -DeploymentBuild -NativeModelManager -Version ${{ needs.get-version.outputs.version }}
- name: Bundle VC runtime
shell: pwsh
working-directory: build/windows-cpu-release/bin
# App-local deployment of the MSVC runtime so the prebuilt binaries run
# on clean Windows without a separately installed VC++ Redistributable.
# Sizes: vcruntime140* + msvcp140* + vcomp140 ~2 MB (well under 1 MB
# compressed), negligible against the CPU/Vulkan/CUDA zip sizes.
run: |
$vswhere = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe"
$vs = & $vswhere -latest -property installationPath
$redist = Get-ChildItem "$vs\VC\Redist\MSVC" -Directory |
Sort-Object { try { [version]$_.Name } catch { [version]'0.0' } } -Descending |
Select-Object -First 1
foreach ($sub in 'x64\Microsoft.VC143.CRT', 'x64\Microsoft.VC143.OPENMP') {
$dir = Join-Path $redist.FullName $sub
if (Test-Path $dir) {
Get-ChildItem "$dir\*.dll" | Where-Object {
$_.Name -match '^(vcruntime140|msvcp140|vcomp140)'
} | Copy-Item -Destination . -ErrorAction SilentlyContinue
}
}
Get-ChildItem *.dll | Select-Object Name | Out-String | Write-Host
- name: Stage bundle
shell: pwsh
working-directory: build/windows-cpu-release/bin
run: |
cp ..\..\..\LICENSE . 2>$null
Copy-Item -Recurse ..\..\..\tools .\tools -ErrorAction SilentlyContinue
Copy-Item -Recurse ..\..\..\model_specs .\model_specs -ErrorAction SilentlyContinue
- uses: actions/upload-artifact@v4
with:
name: audio-${{ needs.get-version.outputs.tag }}-bin-windows-x64-cpu
path: build/windows-cpu-release/bin/*
- name: Build and stage C API library
shell: pwsh
run: |
$ErrorActionPreference = 'Stop'
$vswhere = "${env:ProgramFiles(x86)}/Microsoft Visual Studio/Installer/vswhere.exe"
$vs = & $vswhere -latest -property installationPath
& "$vs/Common7/Tools/Launch-VsDevShell.ps1" -Arch amd64 -HostArch amd64 -SkipAutomaticLocation
cmake -S . -B build/windows-cpu-release -DAUDIOCPP_BUILD_C_API=ON
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
cmake --build build/windows-cpu-release --config Release --parallel $env:NUMBER_OF_PROCESSORS --target audiocpp
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
New-Item -ItemType Directory -Force -Path dist-lib/libs, dist-lib/include | Out-Null
Copy-Item include/audiocpp.h dist-lib/include/
Copy-Item LICENSE dist-lib/
Copy-Item build/windows-cpu-release/bin/*.dll dist-lib/libs/
Move-Item build/windows-cpu-release/bin/audiocpp.* dist-lib/libs/ -Force
Compress-Archive -Path dist-lib/* -DestinationPath audio-${{ needs.get-version.outputs.tag }}-lib-windows-x64-cpu.zip
- uses: actions/upload-artifact@v4
with:
name: audio-${{ needs.get-version.outputs.tag }}-lib-windows-x64-cpu
path: audio-${{ needs.get-version.outputs.tag }}-lib-windows-x64-cpu.zip
windows-cpu-portable:
name: Windows x64 (CPU portable)
needs: [check-release, get-version]
if: ${{ needs.check-release.outputs.should_release == 'true' }}
runs-on: windows-2022
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
repository: ${{ inputs.source_repository || github.repository }}
ref: ${{ needs.get-version.outputs.source_sha }}
- name: Build
shell: pwsh
run: |
.\scripts\build_windows.ps1 -Preset windows-cpu-release -Target audiocpp_cli -DeploymentBuild -NativeModelManager -CpuArch baseline -Llamafile OFF -Version ${{ needs.get-version.outputs.version }}
.\scripts\build_windows.ps1 -Preset windows-cpu-release -Target audiocpp_server -DeploymentBuild -NativeModelManager -CpuArch baseline -Llamafile OFF -Version ${{ needs.get-version.outputs.version }}
.\scripts\build_windows.ps1 -Preset windows-cpu-release -Target audiocpp_gguf -DeploymentBuild -NativeModelManager -CpuArch baseline -Llamafile OFF -Version ${{ needs.get-version.outputs.version }}
- name: Bundle VC runtime
shell: pwsh
working-directory: build/windows-cpu-release/bin
# App-local deployment of the MSVC runtime so the prebuilt binaries run
# on clean Windows without a separately installed VC++ Redistributable.
# Sizes: vcruntime140* + msvcp140* + vcomp140 ~2 MB (well under 1 MB
# compressed), negligible against the CPU/Vulkan/CUDA zip sizes.
run: |
$vswhere = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe"
$vs = & $vswhere -latest -property installationPath
$redist = Get-ChildItem "$vs\VC\Redist\MSVC" -Directory |
Sort-Object { try { [version]$_.Name } catch { [version]'0.0' } } -Descending |
Select-Object -First 1
foreach ($sub in 'x64\Microsoft.VC143.CRT', 'x64\Microsoft.VC143.OPENMP') {
$dir = Join-Path $redist.FullName $sub
if (Test-Path $dir) {
Get-ChildItem "$dir\*.dll" | Where-Object {
$_.Name -match '^(vcruntime140|msvcp140|vcomp140)'
} | Copy-Item -Destination . -ErrorAction SilentlyContinue
}
}
Get-ChildItem *.dll | Select-Object Name | Out-String | Write-Host
- name: Stage bundle
shell: pwsh
working-directory: build/windows-cpu-release/bin
run: |
cp ..\..\..\LICENSE . 2>$null
Copy-Item -Recurse ..\..\..\tools .\tools -ErrorAction SilentlyContinue
Copy-Item -Recurse ..\..\..\model_specs .\model_specs -ErrorAction SilentlyContinue
- uses: actions/upload-artifact@v4
with:
name: audio-${{ needs.get-version.outputs.tag }}-bin-windows-x64-cpu-portable
path: build/windows-cpu-release/bin/*
- name: Build and stage C API library
shell: pwsh
run: |
$ErrorActionPreference = 'Stop'
$vswhere = "${env:ProgramFiles(x86)}/Microsoft Visual Studio/Installer/vswhere.exe"
$vs = & $vswhere -latest -property installationPath
& "$vs/Common7/Tools/Launch-VsDevShell.ps1" -Arch amd64 -HostArch amd64 -SkipAutomaticLocation
cmake -S . -B build/windows-cpu-release -DAUDIOCPP_BUILD_C_API=ON
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
cmake --build build/windows-cpu-release --config Release --parallel $env:NUMBER_OF_PROCESSORS --target audiocpp
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
New-Item -ItemType Directory -Force -Path dist-lib/libs, dist-lib/include | Out-Null
Copy-Item include/audiocpp.h dist-lib/include/
Copy-Item LICENSE dist-lib/
Copy-Item build/windows-cpu-release/bin/*.dll dist-lib/libs/
Move-Item build/windows-cpu-release/bin/audiocpp.* dist-lib/libs/ -Force
Compress-Archive -Path dist-lib/* -DestinationPath audio-${{ needs.get-version.outputs.tag }}-lib-windows-x64-cpu-portable.zip
- uses: actions/upload-artifact@v4
with:
name: audio-${{ needs.get-version.outputs.tag }}-lib-windows-x64-cpu-portable
path: audio-${{ needs.get-version.outputs.tag }}-lib-windows-x64-cpu-portable.zip
windows-vulkan:
name: Windows x64 (Vulkan)
needs: [check-release, get-version]
if: ${{ needs.check-release.outputs.should_release == 'true' }}
runs-on: windows-2022
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
repository: ${{ inputs.source_repository || github.repository }}
ref: ${{ needs.get-version.outputs.source_sha }}
- name: Install Vulkan SDK
shell: pwsh
run: |
curl.exe -o "$env:RUNNER_TEMP\VulkanSDK-Installer.exe" -L "https://sdk.lunarg.com/sdk/download/${env:VULKAN_VERSION}/windows/vulkansdk-windows-X64-${env:VULKAN_VERSION}.exe"
& "$env:RUNNER_TEMP\VulkanSDK-Installer.exe" --accept-licenses --default-answer --confirm-command install
Add-Content $env:GITHUB_ENV "VULKAN_SDK=C:\\VulkanSDK\\${env:VULKAN_VERSION}"
Add-Content $env:GITHUB_PATH "C:\\VulkanSDK\\${env:VULKAN_VERSION}\\bin"
- name: Build
shell: pwsh
run: |
.\scripts\build_windows.ps1 -Preset windows-vulkan-release -Target audiocpp_cli -DeploymentBuild -NativeModelManager -Version ${{ needs.get-version.outputs.version }}
.\scripts\build_windows.ps1 -Preset windows-vulkan-release -Target audiocpp_server -DeploymentBuild -NativeModelManager -Version ${{ needs.get-version.outputs.version }}
.\scripts\build_windows.ps1 -Preset windows-vulkan-release -Target audiocpp_gguf -DeploymentBuild -NativeModelManager -Version ${{ needs.get-version.outputs.version }}
- name: Bundle VC runtime
shell: pwsh
working-directory: build/windows-vulkan-release/bin
# App-local deployment of the MSVC runtime (see windows-cpu comments).
run: |
$vswhere = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe"
$vs = & $vswhere -latest -property installationPath
$redist = Get-ChildItem "$vs\VC\Redist\MSVC" -Directory |
Sort-Object { try { [version]$_.Name } catch { [version]'0.0' } } -Descending |
Select-Object -First 1
foreach ($sub in 'x64\Microsoft.VC143.CRT', 'x64\Microsoft.VC143.OPENMP') {
$dir = Join-Path $redist.FullName $sub
if (Test-Path $dir) {
Get-ChildItem "$dir\*.dll" | Where-Object {
$_.Name -match '^(vcruntime140|msvcp140|vcomp140)'
} | Copy-Item -Destination . -ErrorAction SilentlyContinue
}
}
Get-ChildItem *.dll | Select-Object Name | Out-String | Write-Host
- name: Stage bundle
shell: pwsh
working-directory: build/windows-vulkan-release/bin
run: |
cp ..\..\..\LICENSE . 2>$null
Copy-Item -Recurse ..\..\..\tools .\tools -ErrorAction SilentlyContinue
Copy-Item -Recurse ..\..\..\model_specs .\model_specs -ErrorAction SilentlyContinue
- uses: actions/upload-artifact@v4
with:
name: audio-${{ needs.get-version.outputs.tag }}-bin-windows-x64-vulkan
path: build/windows-vulkan-release/bin/*
- name: Build and stage C API library
shell: pwsh
run: |
$ErrorActionPreference = 'Stop'
$vswhere = "${env:ProgramFiles(x86)}/Microsoft Visual Studio/Installer/vswhere.exe"
$vs = & $vswhere -latest -property installationPath
& "$vs/Common7/Tools/Launch-VsDevShell.ps1" -Arch amd64 -HostArch amd64 -SkipAutomaticLocation
cmake -S . -B build/windows-vulkan-release -DAUDIOCPP_BUILD_C_API=ON
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
cmake --build build/windows-vulkan-release --config Release --parallel $env:NUMBER_OF_PROCESSORS --target audiocpp
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
New-Item -ItemType Directory -Force -Path dist-lib/libs, dist-lib/include | Out-Null
Copy-Item include/audiocpp.h dist-lib/include/
Copy-Item LICENSE dist-lib/
Copy-Item build/windows-vulkan-release/bin/*.dll dist-lib/libs/
Move-Item build/windows-vulkan-release/bin/audiocpp.* dist-lib/libs/ -Force
Compress-Archive -Path dist-lib/* -DestinationPath audio-${{ needs.get-version.outputs.tag }}-lib-windows-x64-vulkan.zip
- uses: actions/upload-artifact@v4
with:
name: audio-${{ needs.get-version.outputs.tag }}-lib-windows-x64-vulkan
path: audio-${{ needs.get-version.outputs.tag }}-lib-windows-x64-vulkan.zip
windows-vulkan-portable:
name: Windows x64 (Vulkan portable)
needs: [check-release, get-version]
if: ${{ needs.check-release.outputs.should_release == 'true' }}
runs-on: windows-2022
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
repository: ${{ inputs.source_repository || github.repository }}
ref: ${{ needs.get-version.outputs.source_sha }}
- name: Install Vulkan SDK
shell: pwsh
run: |
curl.exe -o "$env:RUNNER_TEMP\VulkanSDK-Installer.exe" -L "https://sdk.lunarg.com/sdk/download/${env:VULKAN_VERSION}/windows/vulkansdk-windows-X64-${env:VULKAN_VERSION}.exe"
& "$env:RUNNER_TEMP\VulkanSDK-Installer.exe" --accept-licenses --default-answer --confirm-command install
Add-Content $env:GITHUB_ENV "VULKAN_SDK=C:\\VulkanSDK\\${env:VULKAN_VERSION}"
Add-Content $env:GITHUB_PATH "C:\\VulkanSDK\\${env:VULKAN_VERSION}\\bin"
- name: Build
shell: pwsh
run: |
.\scripts\build_windows.ps1 -Preset windows-vulkan-release -ConfigureOnly -DeploymentBuild -NativeModelManager -CpuArch baseline -Llamafile OFF -Version ${{ needs.get-version.outputs.version }}
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
# The existing baseline preset disables AVX; also remove the remaining
# optional x86 extensions for this new portable target only.
cmake -S . -B build/windows-vulkan-release -DGGML_SSE42=OFF -DGGML_BMI2=OFF
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
cmake --build build/windows-vulkan-release --config Release --parallel $env:NUMBER_OF_PROCESSORS --target ($env:BUILD_TARGETS -split ' ')
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
- name: Bundle VC runtime
shell: pwsh
working-directory: build/windows-vulkan-release/bin
# App-local deployment of the MSVC runtime (see windows-cpu comments).
run: |
$vswhere = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe"
$vs = & $vswhere -latest -property installationPath
$redist = Get-ChildItem "$vs\VC\Redist\MSVC" -Directory |
Sort-Object { try { [version]$_.Name } catch { [version]'0.0' } } -Descending |
Select-Object -First 1
foreach ($sub in 'x64\Microsoft.VC143.CRT', 'x64\Microsoft.VC143.OPENMP') {
$dir = Join-Path $redist.FullName $sub
if (Test-Path $dir) {
Get-ChildItem "$dir\*.dll" | Where-Object {
$_.Name -match '^(vcruntime140|msvcp140|vcomp140)'
} | Copy-Item -Destination . -ErrorAction SilentlyContinue
}
}
Get-ChildItem *.dll | Select-Object Name | Out-String | Write-Host
- name: Stage bundle
shell: pwsh
working-directory: build/windows-vulkan-release/bin
run: |
cp ..\..\..\LICENSE . 2>$null
Copy-Item -Recurse ..\..\..\tools .\tools -ErrorAction SilentlyContinue
Copy-Item -Recurse ..\..\..\model_specs .\model_specs -ErrorAction SilentlyContinue
- uses: actions/upload-artifact@v4
with:
name: audio-${{ needs.get-version.outputs.tag }}-bin-windows-x64-vulkan-portable
path: build/windows-vulkan-release/bin/*
- name: Build and stage C API library
shell: pwsh
run: |
$ErrorActionPreference = 'Stop'
$vswhere = "${env:ProgramFiles(x86)}/Microsoft Visual Studio/Installer/vswhere.exe"
$vs = & $vswhere -latest -property installationPath
& "$vs/Common7/Tools/Launch-VsDevShell.ps1" -Arch amd64 -HostArch amd64 -SkipAutomaticLocation
cmake -S . -B build/windows-vulkan-release -DAUDIOCPP_BUILD_C_API=ON
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
cmake --build build/windows-vulkan-release --config Release --parallel $env:NUMBER_OF_PROCESSORS --target audiocpp
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
New-Item -ItemType Directory -Force -Path dist-lib/libs, dist-lib/include | Out-Null
Copy-Item include/audiocpp.h dist-lib/include/
Copy-Item LICENSE dist-lib/
Copy-Item build/windows-vulkan-release/bin/*.dll dist-lib/libs/
Move-Item build/windows-vulkan-release/bin/audiocpp.* dist-lib/libs/ -Force
Compress-Archive -Path dist-lib/* -DestinationPath audio-${{ needs.get-version.outputs.tag }}-lib-windows-x64-vulkan-portable.zip
- uses: actions/upload-artifact@v4
with:
name: audio-${{ needs.get-version.outputs.tag }}-lib-windows-x64-vulkan-portable
path: audio-${{ needs.get-version.outputs.tag }}-lib-windows-x64-vulkan-portable.zip
windows-cuda:
name: 'Windows x64 (CUDA ${{ matrix.label }})'
needs: [check-release, get-version]
if: ${{ needs.check-release.outputs.should_release == 'true' }}
runs-on: windows-2022
strategy:
fail-fast: false
matrix:
include:
- cuda: '12.4.1'
label: '12.4'
cuda_archs: '61-virtual;70;75;80;86;89;90'
- cuda: '13.3.0'
label: '13.3'
cuda_archs: '75;80;86;89;90;120'
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
repository: ${{ inputs.source_repository || github.repository }}
ref: ${{ needs.get-version.outputs.source_sha }}
- name: Install CUDA build tools
uses: Jimver/cuda-toolkit@v0.2.36
with:
cuda: ${{ matrix.cuda }}
method: 'local'
- name: Configure + Build (OpenMP off)
shell: cmd
# Direct CMake (bypasses build_windows.ps1, which hard-requires OpenMP and
# asserts under the CUDA toolchain). OpenMP off matches llama.cpp's CUDA
# path. vcvarsall.bat puts cl.exe on PATH for nvcc.
#
# ENGINE_ENABLE_CPU_ALL_VARIANTS flips BUILD_SHARED_LIBS=ON +
# GGML_BACKEND_DL=ON (audio.cpp/CMakeLists.txt), building the CUDA backend
# once as ggml-cuda.dll and keeping cli/server/gguf as thin shells that
# load backends at runtime -- the same distribution model llama.cpp uses.
# CUDA kernels are no longer duplicated into 3 executables.
#
# CMAKE_CUDA_ARCHITECTURES must be pinned: audio.cpp defaults to
# "native" (the build host GPU), which is meaningless on GPU-less CI
# runners and yields an unreliable CUDA fatbin. Use fixed arch lists per
# toolkit so the released binaries carry correct kernels for the
# supported GPUs (RTX 20/30/40/50-series and datacenter-class). The
# value is quoted so the ';' separators survive cmd's tokenizer.
run: |
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64 >nul
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release ^
-DENGINE_ENABLE_CUDA=ON -DENGINE_ENABLE_OPENMP=OFF -DGGML_OPENMP=OFF ^
-DENGINE_ENABLE_CUDA_GRAPHS=ON -DENGINE_ENABLE_VULKAN=OFF -DENGINE_ENABLE_METAL=OFF ^
-DENGINE_ENABLE_LLAMAFILE=ON -DENGINE_ENABLE_NATIVE_CPU=ON -DENGINE_BUILD_TESTS=OFF ^
-DENGINE_ENABLE_CPU_ALL_VARIANTS=ON ^
"-DCMAKE_CUDA_ARCHITECTURES=${{ matrix.cuda_archs }}" ^
-DAUDIOCPP_VERSION=${{ needs.get-version.outputs.version }} ^
-DAUDIOCPP_DEPLOYMENT_BUILD=ON -DAUDIOCPP_BUILD_NATIVE_MODEL_MANAGER=ON -DCUDAToolkit_ROOT="%CUDA_PATH%"
cmake --build build --config Release -j %NUMBER_OF_PROCESSORS% --target ${{ env.BUILD_TARGETS }}
- name: Bundle CUDA runtime
shell: pwsh
# llama.cpp copies the runtime DLLs from every candidate dir without
# looking at robocopy's exit code: bin\x64 is a CUDA 13 layout, so on
# CUDA 12.x robocopy returns 16 for that missing dir, which is benign
# (llama's step ends on the successful 7z). Mirror that here -- copy
# from whichever dir exists and terminate on exit 0. The trailing guard
# only trips if NO cudart was copied at all (a broken/empty toolkit).
# cufft64_*.dll is included because engine_runtime links CUDA::cufft
# for its CUDA inverse-STFT kernel (CMakeLists.txt).
#
# Staged outside build/bin so the bin artifact stays free of the heavy
# runtime DLLs; the cudart artifact is uploaded separately below.
run: |
$dst = "build\cudart"
New-Item -ItemType Directory -Force -Path $dst | Out-Null
$dlls = "cudart64_*.dll", "cublas64_*.dll", "cublasLt64_*.dll", "cufft64_*.dll"
robocopy "$env:CUDA_PATH\bin" $dst $dlls
robocopy "$env:CUDA_PATH\lib" $dst $dlls
robocopy "$env:CUDA_PATH\bin\x64" $dst $dlls
if (-not (Get-ChildItem -Path $dst -Filter 'cudart64_*.dll' -ErrorAction SilentlyContinue)) {
Write-Error "CUDA runtime DLLs were not found under $env:CUDA_PATH"
exit 1
}
exit 0
- name: Bundle VC runtime
shell: pwsh
working-directory: build/bin
# App-local deployment of the MSVC runtime (see windows-cpu comments).
# The CUDA build disables OpenMP, so vcomp140 is not needed - only the
# CRT DLLs for the host-side /MD runtime.
run: |
$vswhere = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe"
$vs = & $vswhere -latest -property installationPath
$redist = Get-ChildItem "$vs\VC\Redist\MSVC" -Directory |
Sort-Object { try { [version]$_.Name } catch { [version]'0.0' } } -Descending |
Select-Object -First 1
$dir = Join-Path $redist.FullName 'x64\Microsoft.VC143.CRT'
if (Test-Path $dir) {
Get-ChildItem "$dir\*.dll" | Where-Object {
$_.Name -match '^(vcruntime140|msvcp140)'
} | Copy-Item -Destination . -ErrorAction SilentlyContinue
}
Get-ChildItem *.dll | Select-Object Name | Out-String | Write-Host
- name: Stage bundle
shell: pwsh
working-directory: build/bin
run: |
cp ..\..\LICENSE . 2>$null
Copy-Item -Recurse ..\..\tools .\tools -ErrorAction SilentlyContinue
Copy-Item -Recurse ..\..\model_specs .\model_specs -ErrorAction SilentlyContinue
- uses: actions/upload-artifact@v4
with:
name: audio-${{ needs.get-version.outputs.tag }}-bin-windows-x64-cuda${{ matrix.label }}
path: build/bin/*
- uses: actions/upload-artifact@v4
with:
name: audio-${{ needs.get-version.outputs.tag }}-cudart-windows-x64-cuda${{ matrix.label }}
path: build/cudart/*
- name: Build and stage C API library
shell: pwsh
run: |
$ErrorActionPreference = 'Stop'
$vswhere = "${env:ProgramFiles(x86)}/Microsoft Visual Studio/Installer/vswhere.exe"
$vs = & $vswhere -latest -property installationPath
& "$vs/Common7/Tools/Launch-VsDevShell.ps1" -Arch amd64 -HostArch amd64 -SkipAutomaticLocation
cmake -S . -B build -DAUDIOCPP_BUILD_C_API=ON
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
cmake --build build --config Release --parallel $env:NUMBER_OF_PROCESSORS --target audiocpp
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
New-Item -ItemType Directory -Force -Path dist-lib/libs, dist-lib/include | Out-Null
Copy-Item include/audiocpp.h dist-lib/include/
Copy-Item LICENSE dist-lib/
Copy-Item build/bin/*.dll dist-lib/libs/
Move-Item build/bin/audiocpp.* dist-lib/libs/ -Force
Compress-Archive -Path dist-lib/* -DestinationPath audio-${{ needs.get-version.outputs.tag }}-lib-windows-x64-cuda${{ matrix.label }}.zip
- uses: actions/upload-artifact@v4
with:
name: audio-${{ needs.get-version.outputs.tag }}-lib-windows-x64-cuda${{ matrix.label }}
path: audio-${{ needs.get-version.outputs.tag }}-lib-windows-x64-cuda${{ matrix.label }}.zip
hip:
name: HIP test binaries (best-effort)
needs: [check-release, get-version]
if: ${{ needs.check-release.outputs.should_release == 'true' }}
permissions:
contents: read
actions: read
uses: ./.github/workflows/release-hip.yml
with:
source_repository: ${{ inputs.source_repository || github.repository }}
source_sha: ${{ needs.get-version.outputs.source_sha }}
version: ${{ needs.get-version.outputs.tag }}
release:
name: Create release
needs:
- check-release
- get-version
- server-config-examples
- macos-metal
- linux-cpu
- linux-cpu-portable
- linux-vulkan
- linux-vulkan-portable
- windows-cpu
- windows-cpu-portable
- windows-vulkan
- windows-cuda
- linux-cuda-colab
- linux-cuda-library
- windows-vulkan-portable
# Wait for any HIP artifacts, but do not require success, like Colab.
- hip
if: >-
${{
always() &&
needs.check-release.outputs.should_release == 'true' &&
(github.ref_type == 'tag' || inputs.publish) &&
needs.get-version.result == 'success' &&
needs.server-config-examples.result == 'success' &&
needs.macos-metal.result == 'success' &&
needs.linux-cpu.result == 'success' &&