Repository navigation
612 lines (561 loc) · 24.9 KB
/
Copy pathrelease.yml
File metadata and controls
612 lines (561 loc) · 24.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
name: release
# Pre-built parakeet-cli and parakeet-server bundles for every release (issue #21).
#
# Two self-contained binaries (parakeet-cli + parakeet-server) per (platform,
# backend) pair, packaged with the LICENSE and README. parakeet-server is the
# OpenAI-compatible HTTP server (examples/server) — the same downstream value
# llama.cpp/whisper.cpp ship as llama-server/whisper-server. It already built
# in this workflow (PARAKEET_BUILD_SERVER defaults ON); this just packages it.
# BUILD_SHARED_LIBS=OFF folds the ggml backends into the
# binary (the docker images keep them shared; a download-and-run bundle should
# not need a lib directory). GGML_NATIVE=OFF keeps the binaries portable
# across CPUs, same as the docker images and ci.yml.
#
# The linux cpu variants additionally ship as binary-only AppImages, built by
# packaging/appimage/make-appimage.sh (the same script docker/Dockerfile.static
# uses), so there is one grab-and-run file per arch alongside the tarballs.
#
# Variants:
# linux x64: cpu, vulkan, cuda arm64: cpu, vulkan
# macos arm64: metal x64: cpu (cross-compiled on the arm
# runner; GitHub is retiring Intel ones)
# windows x64: cpu, vulkan, cuda
#
# CUDA notes (same reasoning as docker.yml): GGML_CUDA_NO_VMM=ON because the
# build runners have no GPU driver to link libcuda against. Linux uses the
# CUDA 13 apt repo so Blackwell (sm_120) is covered; the cudart/cublas
# runtime libraries are bundled into the tarball next to the binary, which
# carries an $ORIGIN rpath. Windows ships them as a separate cudart zip
# (llama.cpp convention) so users who already have the toolkit skip a large
# download.
#
# Triggers: pushing a v* tag builds everything and attaches the bundles to
# the GitHub release for that tag (creating a draft release if none exists
# yet, so creating the release before or after pushing the tag both work).
# workflow_dispatch builds the same bundles and leaves them as workflow
# artifacts, useful for testing changes to this file.
on:
push:
tags: ['v*']
branches: [feat/release-binaries] # TEMP: matrix validation, remove before merge
workflow_dispatch:
defaults:
run:
shell: bash
jobs:
# ---------------------------------------------------------------------------
# linux: cpu (x64 + arm64, native runners), vulkan (x64 via the LunarG SDK,
# arm64 via Ubuntu apt), cuda (CUDA 13 apt repo). cpu and x64 vulkan build on
# ubuntu-22.04 for a wider glibc range; cuda and arm64 vulkan build on
# ubuntu-24.04 (the CUDA 13 repo and the glslc/shaderc apt package are not
# available on 22.04).
# ---------------------------------------------------------------------------
build-linux:
runs-on: ${{ matrix.runner }}
timeout-minutes: 180
strategy:
fail-fast: false
matrix:
include:
- backend: cpu
arch: x64
runner: ubuntu-22.04
cmake_args: ""
cuda_archs: ""
- backend: cpu
arch: arm64
runner: ubuntu-22.04-arm
cmake_args: ""
cuda_archs: ""
- backend: vulkan
arch: x64
runner: ubuntu-22.04
cmake_args: "-DPARAKEET_GGML_VULKAN=ON"
cuda_archs: ""
- backend: vulkan
arch: arm64
runner: ubuntu-24.04-arm
# LunarG ships no arm64 SDK repo, so the Vulkan toolchain comes from
# Ubuntu apt instead; glslc (shaderc) is packaged on 24.04, not 22.04.
cmake_args: "-DPARAKEET_GGML_VULKAN=ON"
cuda_archs: ""
- backend: cuda
arch: x64
runner: ubuntu-24.04
# No CMAKE_CUDA_ARCHITECTURES: ggml's curated default applies,
# the same list llama.cpp releases ship (PTX for the datacenter
# gens, real code for 86/89/120a, plus 121a for GB10 on CUDA 13).
cmake_args: "-DPARAKEET_GGML_CUDA=ON -DGGML_CUDA_NO_VMM=ON"
cuda_archs: ""
- backend: cuda12
arch: x64
runner: ubuntu-24.04
# cuda12.x is the last cuda that supports older GPU families, like Volta.
cmake_args: "-DPARAKEET_GGML_CUDA=ON -DGGML_CUDA_NO_VMM=ON"
cuda_archs: ""
steps:
- name: Checkout (with submodules)
uses: actions/checkout@v4
with:
submodules: recursive
- name: Determine version
id: ver
run: |
if [ "${GITHUB_REF_TYPE}" = "tag" ]; then
version="${GITHUB_REF_NAME}"
else
version="${GITHUB_SHA::7}"
fi
echo "version=${version}" >> "$GITHUB_OUTPUT"
echo "cmake_version=${version#v}" >> "$GITHUB_OUTPUT"
- name: Install Vulkan SDK (LunarG, x64)
if: matrix.backend == 'vulkan' && matrix.arch == 'x64'
run: |
wget -qO- https://packages.lunarg.com/lunarg-signing-key-pub.asc \
| sudo tee /etc/apt/trusted.gpg.d/lunarg.asc >/dev/null
sudo wget -qO /etc/apt/sources.list.d/lunarg-vulkan-jammy.list \
https://packages.lunarg.com/vulkan/lunarg-vulkan-jammy.list
sudo apt-get update
sudo apt-get install -y vulkan-sdk
- name: Install Vulkan (Ubuntu apt, arm64)
if: matrix.backend == 'vulkan' && matrix.arch == 'arm64'
# LunarG has no arm64 SDK repo. ggml's Vulkan backend needs, at build
# time, the loader/headers (libvulkan-dev), glslc from shaderc to compile
# the compute shaders, and the SPIR-V registry headers (spirv-headers) —
# all in the Ubuntu 24.04 archive. glslangValidator is not required.
run: |
sudo apt-get update
sudo apt-get install -y libvulkan-dev glslc spirv-headers
- name: Install CUDA toolkit 13
if: matrix.backend == 'cuda'
run: |
wget -q https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2404/x86_64/cuda-keyring_1.1-1_all.deb
sudo dpkg -i cuda-keyring_1.1-1_all.deb
sudo apt-get update
sudo apt-get install -y cuda-toolkit-13-0
echo "/usr/local/cuda/bin" >> "$GITHUB_PATH"
- name: Install CUDA toolkit 12
if: matrix.backend == 'cuda12'
run: |
wget -q https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2404/x86_64/cuda-keyring_1.1-1_all.deb
sudo dpkg -i cuda-keyring_1.1-1_all.deb
sudo apt-get update
sudo apt-get install -y cuda-toolkit-12-9
echo "/usr/local/cuda/bin" >> "$GITHUB_PATH"
- name: Configure
env:
CUDA_ARCHS: ${{ matrix.cuda_archs }}
run: |
EXTRA=""
if [ "${{ matrix.backend }}" = "cuda" ] || [ "${{ matrix.backend }}" = "cuda12" ]; then
# $ORIGIN rpath so the bundled cudart/cublas next to the binary
# are found without LD_LIBRARY_PATH.
EXTRA="-DCMAKE_BUILD_RPATH=\$ORIGIN"
fi
cmake -B build \
-DCMAKE_BUILD_TYPE=Release \
-DGGML_NATIVE=OFF \
-DBUILD_SHARED_LIBS=OFF \
-DPARAKEET_BUILD_CLI=ON \
-DPARAKEET_BUILD_SERVER=ON \
-DPARAKEET_BUILD_TESTS=OFF \
-DPARAKEET_VERSION="${{ steps.ver.outputs.cmake_version }}" \
${{ matrix.cmake_args }} \
${CUDA_ARCHS:+"-DCMAKE_CUDA_ARCHITECTURES=${CUDA_ARCHS}"} \
${EXTRA:+"$EXTRA"}
- name: Build
run: cmake --build build -j"$(getconf _NPROCESSORS_ONLN)"
- name: Smoke test (usage banner and version)
# The CLI exits nonzero when invoked bare; capture first so set -e
# only judges the grep.
run: |
expected="${{ steps.ver.outputs.cmake_version }}"
out=$(./build/examples/cli/parakeet-cli 2>&1 || true)
grep -qi usage <<<"$out"
out=$(./build/examples/cli/parakeet-cli --version)
grep -qx "parakeet-cli ${expected}" <<<"$out"
out=$(./build/examples/server/parakeet-server --help 2>&1 || true)
grep -qi usage <<<"$out"
out=$(./build/examples/server/parakeet-server --version)
grep -qx "parakeet-server ${expected}" <<<"$out"
- name: Package
id: pack
run: |
BUNDLE="parakeet-${{ steps.ver.outputs.version }}-bin-linux-${{ matrix.backend }}-${{ matrix.arch }}"
mkdir "$BUNDLE"
cp build/examples/cli/parakeet-cli build/examples/server/parakeet-server \
LICENSE README.md "$BUNDLE"/
if [ "${{ matrix.backend }}" = "cuda" ] || [ "${{ matrix.backend }}" = "cuda12" ]; then
cp -P /usr/local/cuda/targets/x86_64-linux/lib/libcudart.so* \
/usr/local/cuda/targets/x86_64-linux/lib/libcublas.so* \
/usr/local/cuda/targets/x86_64-linux/lib/libcublasLt.so* \
"$BUNDLE"/
fi
tar -czf "$BUNDLE.tar.gz" "$BUNDLE"
echo "bundle=$BUNDLE" >> "$GITHUB_OUTPUT"
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ${{ steps.pack.outputs.bundle }}
path: ${{ steps.pack.outputs.bundle }}.tar.gz
if-no-files-found: error
# Binary-only AppImage from the same static cpu binary, packaged by the
# same script docker/Dockerfile.static uses. cpu-only: the vulkan/cuda
# binaries need system GPU stacks an AppImage can't sensibly bundle.
- name: Package AppImage
if: matrix.backend == 'cpu'
id: appimage
run: |
case "${{ matrix.arch }}" in
x64) arch=x86_64 ;;
arm64) arch=aarch64 ;;
esac
packaging/appimage/make-appimage.sh \
build/examples/cli/parakeet-cli "$arch" "${{ steps.ver.outputs.version }}" .
echo "name=parakeet-cli-${{ steps.ver.outputs.version }}-${arch}.AppImage" >> "$GITHUB_OUTPUT"
- name: Smoke test AppImage (version)
if: matrix.backend == 'cpu'
# EXTRACT_AND_RUN so the runner does not need FUSE.
run: |
expected="${{ steps.ver.outputs.cmake_version }}"
out=$(APPIMAGE_EXTRACT_AND_RUN=1 "./${{ steps.appimage.outputs.name }}" --version)
grep -qx "parakeet-cli ${expected}" <<<"$out"
- name: Upload AppImage artifact
if: matrix.backend == 'cpu'
uses: actions/upload-artifact@v4
with:
name: ${{ steps.appimage.outputs.name }}
path: ${{ steps.appimage.outputs.name }}
if-no-files-found: error
# Shared C-API lib (issue #25): a separate build so the CLI bundle above
# stays a single self-contained binary. PARAKEET_SHARED=ON folds ggml into
# libparakeet.so the same way it is folded into the CLI.
- name: Configure (shared C-API lib)
env:
CUDA_ARCHS: ${{ matrix.cuda_archs }}
run: |
EXTRA=""
if [ "${{ matrix.backend }}" = "cuda" ] || [ "${{ matrix.backend }}" = "cuda12" ]; then
EXTRA="-DCMAKE_BUILD_RPATH=\$ORIGIN"
fi
cmake -B build-shared \
-DCMAKE_BUILD_TYPE=Release \
-DGGML_NATIVE=OFF \
-DBUILD_SHARED_LIBS=OFF \
-DCMAKE_POSITION_INDEPENDENT_CODE=ON \
-DPARAKEET_SHARED=ON \
-DPARAKEET_BUILD_CLI=OFF \
-DPARAKEET_BUILD_TESTS=OFF \
-DPARAKEET_VERSION="${{ steps.ver.outputs.cmake_version }}" \
${{ matrix.cmake_args }} \
${CUDA_ARCHS:+"-DCMAKE_CUDA_ARCHITECTURES=${CUDA_ARCHS}"} \
${EXTRA:+"$EXTRA"}
- name: Build (shared C-API lib)
run: cmake --build build-shared -j"$(getconf _NPROCESSORS_ONLN)"
- name: Package (shared C-API lib)
id: pack_lib
run: |
BUNDLE="parakeet-${{ steps.ver.outputs.version }}-lib-linux-${{ matrix.backend }}-${{ matrix.arch }}"
mkdir "$BUNDLE"
cp build-shared/libparakeet.so include/parakeet_capi.h LICENSE README.md "$BUNDLE"/
if [ "${{ matrix.backend }}" = "cuda" ] || [ "${{ matrix.backend }}" = "cuda12" ]; then
cp -P /usr/local/cuda/targets/x86_64-linux/lib/libcudart.so* \
/usr/local/cuda/targets/x86_64-linux/lib/libcublas.so* \
/usr/local/cuda/targets/x86_64-linux/lib/libcublasLt.so* \
"$BUNDLE"/
fi
tar -czf "$BUNDLE.tar.gz" "$BUNDLE"
echo "bundle=$BUNDLE" >> "$GITHUB_OUTPUT"
- name: Upload shared C-API lib artifact
uses: actions/upload-artifact@v4
with:
name: ${{ steps.pack_lib.outputs.bundle }}
path: ${{ steps.pack_lib.outputs.bundle }}.tar.gz
if-no-files-found: error
# ---------------------------------------------------------------------------
# macos: metal on arm64 (the metallib is embedded in the binary, nothing to
# ship alongside), plus a cpu-only x64 build cross-compiled on the same
# arm64 runner.
# ---------------------------------------------------------------------------
build-macos:
runs-on: macos-14
timeout-minutes: 120
strategy:
fail-fast: false
matrix:
include:
- backend: metal
arch: arm64
cmake_args: "-DPARAKEET_GGML_METAL=ON -DGGML_METAL_EMBED_LIBRARY=ON"
- backend: cpu
arch: x64
cmake_args: "-DCMAKE_OSX_ARCHITECTURES=x86_64"
steps:
- name: Checkout (with submodules)
uses: actions/checkout@v4
with:
submodules: recursive
- name: Determine version
id: ver
run: |
if [ "${GITHUB_REF_TYPE}" = "tag" ]; then
version="${GITHUB_REF_NAME}"
else
version="${GITHUB_SHA::7}"
fi
echo "version=${version}" >> "$GITHUB_OUTPUT"
echo "cmake_version=${version#v}" >> "$GITHUB_OUTPUT"
- name: Configure
run: |
cmake -B build \
-DCMAKE_BUILD_TYPE=Release \
-DGGML_NATIVE=OFF \
-DBUILD_SHARED_LIBS=OFF \
-DPARAKEET_BUILD_CLI=ON \
-DPARAKEET_BUILD_SERVER=ON \
-DPARAKEET_BUILD_TESTS=OFF \
-DPARAKEET_VERSION="${{ steps.ver.outputs.cmake_version }}" \
${{ matrix.cmake_args }}
- name: Build
run: cmake --build build -j"$(getconf _NPROCESSORS_ONLN)"
- name: Smoke test (usage banner and version)
# The x64 binary needs Rosetta; only smoke test the native build.
if: matrix.arch == 'arm64'
run: |
expected="${{ steps.ver.outputs.cmake_version }}"
out=$(./build/examples/cli/parakeet-cli 2>&1 || true)
grep -qi usage <<<"$out"
out=$(./build/examples/cli/parakeet-cli --version)
grep -qx "parakeet-cli ${expected}" <<<"$out"
out=$(./build/examples/server/parakeet-server --help 2>&1 || true)
grep -qi usage <<<"$out"
out=$(./build/examples/server/parakeet-server --version)
grep -qx "parakeet-server ${expected}" <<<"$out"
- name: Package
id: pack
run: |
BUNDLE="parakeet-${{ steps.ver.outputs.version }}-bin-macos-${{ matrix.backend }}-${{ matrix.arch }}"
mkdir "$BUNDLE"
cp build/examples/cli/parakeet-cli build/examples/server/parakeet-server \
LICENSE README.md "$BUNDLE"/
tar -czf "$BUNDLE.tar.gz" "$BUNDLE"
echo "bundle=$BUNDLE" >> "$GITHUB_OUTPUT"
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ${{ steps.pack.outputs.bundle }}
path: ${{ steps.pack.outputs.bundle }}.tar.gz
if-no-files-found: error
# Shared C-API lib (issue #25). Separate build, same reasoning as linux.
- name: Configure (shared C-API lib)
run: |
cmake -B build-shared \
-DCMAKE_BUILD_TYPE=Release \
-DGGML_NATIVE=OFF \
-DBUILD_SHARED_LIBS=OFF \
-DCMAKE_POSITION_INDEPENDENT_CODE=ON \
-DPARAKEET_SHARED=ON \
-DPARAKEET_BUILD_CLI=OFF \
-DPARAKEET_BUILD_TESTS=OFF \
-DPARAKEET_VERSION="${{ steps.ver.outputs.cmake_version }}" \
${{ matrix.cmake_args }}
- name: Build (shared C-API lib)
run: cmake --build build-shared -j"$(getconf _NPROCESSORS_ONLN)"
- name: Package (shared C-API lib)
id: pack_lib
run: |
BUNDLE="parakeet-${{ steps.ver.outputs.version }}-lib-macos-${{ matrix.backend }}-${{ matrix.arch }}"
mkdir "$BUNDLE"
cp build-shared/libparakeet.dylib include/parakeet_capi.h LICENSE README.md "$BUNDLE"/
tar -czf "$BUNDLE.tar.gz" "$BUNDLE"
echo "bundle=$BUNDLE" >> "$GITHUB_OUTPUT"
- name: Upload shared C-API lib artifact
uses: actions/upload-artifact@v4
with:
name: ${{ steps.pack_lib.outputs.bundle }}
path: ${{ steps.pack_lib.outputs.bundle }}.tar.gz
if-no-files-found: error
# ---------------------------------------------------------------------------
# windows: MSVC via Ninja (ilammy/msvc-dev-cmd provides the cl environment,
# which also lets nvcc use cl without the Visual Studio CUDA integration).
# The ggml patches are applied explicitly under Git Bash first: CMake's
# find_program(bash) can pick up the stub WSL bash.exe in System32, which
# would skip the patches with only a warning.
# ---------------------------------------------------------------------------
build-windows:
runs-on: windows-2022
timeout-minutes: 300
strategy:
fail-fast: false
matrix:
include:
- backend: cpu
cmake_args: ""
cuda_archs: ""
- backend: vulkan
cmake_args: "-DPARAKEET_GGML_VULKAN=ON"
cuda_archs: ""
- backend: cuda
# CUDA 12.8: sm_120 support starts there (CUDA 13 is not in the
# cuda-toolkit action yet). No CMAKE_CUDA_ARCHITECTURES: ggml's
# curated default applies, same as the llama.cpp releases.
cmake_args: "-DPARAKEET_GGML_CUDA=ON -DGGML_CUDA_NO_VMM=ON"
cuda_archs: ""
env:
VULKAN_VERSION: 1.4.321.1
steps:
- name: Checkout (with submodules)
uses: actions/checkout@v4
with:
submodules: recursive
- name: Determine version
id: ver
run: |
if [ "${GITHUB_REF_TYPE}" = "tag" ]; then
version="${GITHUB_REF_NAME}"
else
version="${GITHUB_SHA::7}"
fi
echo "version=${version}" >> "$GITHUB_OUTPUT"
echo "cmake_version=${version#v}" >> "$GITHUB_OUTPUT"
- name: Apply ggml patches (Git Bash)
run: bash scripts/apply_ggml_patches.sh
- name: Install Vulkan SDK
if: matrix.backend == 'vulkan'
shell: pwsh
run: |
curl.exe -L -o vulkan-sdk.exe "https://sdk.lunarg.com/sdk/download/$env:VULKAN_VERSION/windows/vulkansdk-windows-X64-$env:VULKAN_VERSION.exe"
Start-Process -Wait -FilePath .\vulkan-sdk.exe -ArgumentList '--accept-licenses','--default-answer','--confirm-command','install'
"VULKAN_SDK=C:\VulkanSDK\$env:VULKAN_VERSION" | Out-File -Append $env:GITHUB_ENV
"C:\VulkanSDK\$env:VULKAN_VERSION\Bin" | Out-File -Append $env:GITHUB_PATH
- name: Install CUDA toolkit
if: matrix.backend == 'cuda'
uses: Jimver/cuda-toolkit@v0.2.21
with:
cuda: '12.8.0'
method: network
sub-packages: '["nvcc", "cudart", "cublas", "cublas_dev", "thrust"]'
use-github-cache: true
- name: MSVC environment
uses: ilammy/msvc-dev-cmd@v1
- name: Configure
env:
CUDA_ARCHS: ${{ matrix.cuda_archs }}
run: |
cmake -B build -G Ninja \
-DCMAKE_BUILD_TYPE=Release \
-DGGML_NATIVE=OFF \
-DBUILD_SHARED_LIBS=OFF \
-DPARAKEET_BUILD_CLI=ON \
-DPARAKEET_BUILD_SERVER=ON \
-DPARAKEET_BUILD_TESTS=OFF \
-DPARAKEET_VERSION="${{ steps.ver.outputs.cmake_version }}" \
${{ matrix.cmake_args }} \
${CUDA_ARCHS:+"-DCMAKE_CUDA_ARCHITECTURES=${CUDA_ARCHS}"}
- name: Build
run: cmake --build build -j
- name: Smoke test (usage banner and version)
# The vulkan binary needs vulkan-1.dll, which the SDK install provides
# on the runner; cpu and cuda load on a bare machine.
run: |
expected="${{ steps.ver.outputs.cmake_version }}"
out=$(./build/examples/cli/parakeet-cli.exe 2>&1 || true)
grep -qi usage <<<"$out"
out=$(./build/examples/cli/parakeet-cli.exe --version)
grep -qx "parakeet-cli ${expected}" <<<"$out"
out=$(./build/examples/server/parakeet-server.exe --help 2>&1 || true)
grep -qi usage <<<"$out"
out=$(./build/examples/server/parakeet-server.exe --version)
grep -qx "parakeet-server ${expected}" <<<"$out"
- name: Package
id: pack
shell: pwsh
run: |
$bundle = "parakeet-${{ steps.ver.outputs.version }}-bin-win-${{ matrix.backend }}-x64"
New-Item -ItemType Directory -Path $bundle | Out-Null
Copy-Item build/examples/cli/parakeet-cli.exe,build/examples/server/parakeet-server.exe,LICENSE,README.md $bundle/
Compress-Archive -Path $bundle -DestinationPath "$bundle.zip"
"bundle=$bundle" | Out-File -Append $env:GITHUB_OUTPUT
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ${{ steps.pack.outputs.bundle }}
path: ${{ steps.pack.outputs.bundle }}.zip
if-no-files-found: error
# Shared C-API lib (issue #25). Separate build, same reasoning as linux.
# WINDOWS_EXPORT_ALL_SYMBOLS (set in CMakeLists) makes the DLL export its
# extern "C" entry points so ctypes/dlopen can find them.
- name: Configure (shared C-API lib)
env:
CUDA_ARCHS: ${{ matrix.cuda_archs }}
run: |
cmake -B build-shared -G Ninja \
-DCMAKE_BUILD_TYPE=Release \
-DGGML_NATIVE=OFF \
-DBUILD_SHARED_LIBS=OFF \
-DCMAKE_POSITION_INDEPENDENT_CODE=ON \
-DPARAKEET_SHARED=ON \
-DPARAKEET_BUILD_CLI=OFF \
-DPARAKEET_BUILD_TESTS=OFF \
-DPARAKEET_VERSION="${{ steps.ver.outputs.cmake_version }}" \
${{ matrix.cmake_args }} \
${CUDA_ARCHS:+"-DCMAKE_CUDA_ARCHITECTURES=${CUDA_ARCHS}"}
- name: Build (shared C-API lib)
run: cmake --build build-shared -j
- name: Package (shared C-API lib)
id: pack_lib
shell: pwsh
run: |
$bundle = "parakeet-${{ steps.ver.outputs.version }}-lib-win-${{ matrix.backend }}-x64"
New-Item -ItemType Directory -Path $bundle | Out-Null
Copy-Item build-shared/parakeet.dll,include/parakeet_capi.h,LICENSE,README.md $bundle/
Compress-Archive -Path $bundle -DestinationPath "$bundle.zip"
"bundle=$bundle" | Out-File -Append $env:GITHUB_OUTPUT
- name: Upload shared C-API lib artifact
uses: actions/upload-artifact@v4
with:
name: ${{ steps.pack_lib.outputs.bundle }}
path: ${{ steps.pack_lib.outputs.bundle }}.zip
if-no-files-found: error
- name: Package CUDA runtime DLLs
if: matrix.backend == 'cuda'
shell: pwsh
run: |
$name = "cudart-parakeet-bin-win-cuda-x64"
New-Item -ItemType Directory -Path $name | Out-Null
Copy-Item "$env:CUDA_PATH\bin\cudart64*.dll","$env:CUDA_PATH\bin\cublas64*.dll","$env:CUDA_PATH\bin\cublasLt64*.dll" $name/
Compress-Archive -Path $name -DestinationPath "$name.zip"
- name: Upload CUDA runtime artifact
if: matrix.backend == 'cuda'
uses: actions/upload-artifact@v4
with:
name: cudart-parakeet-bin-win-cuda-x64
path: cudart-parakeet-bin-win-cuda-x64.zip
if-no-files-found: error
# ---------------------------------------------------------------------------
# release: attach every bundle to the GitHub release for the tag. Creates a
# draft release if none exists yet, so the usual create-release-with-notes
# flow keeps working whether it happens before or after the tag push.
# ---------------------------------------------------------------------------
release:
if: github.ref_type == 'tag'
needs: [build-linux, build-macos, build-windows]
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: dist
merge-multiple: true
- name: Upload assets to the release
env:
GH_TOKEN: ${{ github.token }}
TAG: ${{ github.ref_name }}
run: |
if ! gh release view "$TAG" --repo "$GITHUB_REPOSITORY" >/dev/null 2>&1; then
gh release create "$TAG" --repo "$GITHUB_REPOSITORY" --draft --verify-tag \
--title "$TAG" --notes "Pre-built binaries for $TAG"
fi
gh release upload "$TAG" --repo "$GITHUB_REPOSITORY" --clobber dist/*