-
Notifications
You must be signed in to change notification settings - Fork 0
696 lines (589 loc) · 25.8 KB
/
release.yml
File metadata and controls
696 lines (589 loc) · 25.8 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
name: Release
on:
push:
tags:
- 'v*'
workflow_dispatch:
inputs:
version:
description: 'Version tag (e.g., v0.8.4)'
required: true
type: string
permissions:
contents: write
pages: write
id-token: write
# Only one release workflow per tag at a time — re-pushing a tag cancels the
# previous run so stale builds don't race with the new one.
concurrency:
group: release-${{ github.ref_name }}
cancel-in-progress: true
env:
CARGO_TERM_COLOR: always
CACHE_NAME: mesh-cache
jobs:
# ===========================================================================
# Job 1: Create draft release and validate version
# ===========================================================================
create-release:
name: Create Release
runs-on: ubuntu-latest
outputs:
version: ${{ steps.version.outputs.version }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Get version
id: version
run: |
if [ -n "${{ github.event.inputs.version }}" ]; then
echo "version=${{ github.event.inputs.version }}" >> $GITHUB_OUTPUT
else
echo "version=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
fi
- name: Validate version against Cargo.toml
run: |
TAG_VERSION="${{ steps.version.outputs.version }}"
# Strip 'v' prefix for comparison (v0.8.4 -> 0.8.4)
TAG_SEMVER="${TAG_VERSION#v}"
CARGO_VERSION=$(grep -A2 '^\[workspace\.package\]' Cargo.toml | grep '^version' | sed 's/.*"\(.*\)".*/\1/')
echo "Tag version: $TAG_SEMVER"
echo "Cargo version: $CARGO_VERSION"
if [ "$TAG_SEMVER" != "$CARGO_VERSION" ]; then
echo "::error::Version mismatch! Tag '$TAG_SEMVER' does not match Cargo.toml version '$CARGO_VERSION'"
echo "Update [workspace.package] version in Cargo.toml before tagging."
exit 1
fi
echo "Version check passed."
- name: Extract changelog for this version
id: changelog
run: |
VERSION="${{ steps.version.outputs.version }}"
SEMVER="${VERSION#v}"
# Extract the section between ## [this version] and the next ## [
# Uses awk: start printing at the matching header, stop at the next ## [
NOTES=$(awk -v ver="$SEMVER" '
/^## \[/ {
if (found) exit
if (index($0, "[" ver "]")) found=1
}
found { print }
' CHANGELOG.md)
if [ -z "$NOTES" ]; then
echo "No changelog entry found for $SEMVER"
NOTES="*No changelog entry for this version.*"
fi
# Write to file (multiline strings in GITHUB_OUTPUT need delimiters)
echo "$NOTES" > /tmp/changelog-notes.md
- name: Build release body
run: |
REPO="${{ github.repository }}"
cat > /tmp/release-body.md << EOF
## Installation
### Linux (.deb)
Download the \`.deb\` package for your system:
- **mesh-player** — Performance mode (4-deck stem player)
- **mesh-cue** — Editing mode (waveform editor, analysis, stem separation)
- **mesh-cue-cuda** — Editing mode with NVIDIA GPU acceleration
\`\`\`bash
sudo dpkg -i mesh-player_*.deb mesh-cue_*.deb
# Install dependencies if needed:
sudo apt-get install -f
\`\`\`
**Requirements:** PipeWire (Ubuntu 22.04+, Fedora 34+) or JACK2, glibc 2.35+
### Windows (.zip)
Extract the zip and run the \`.exe\` directly. No installation required.
GPU acceleration via DirectML (any DirectX 12 GPU).
### NixOS / Nix
Run directly (x86_64-linux):
\`\`\`bash
nix run github:${REPO}#mesh-player
nix run github:${REPO}#mesh-cue
\`\`\`
**aarch64-linux** (Orange Pi 5 / embedded): A pre-built binary cache is published to GitHub Pages with every release. Configure the cache and update:
\`\`\`bash
# /etc/nix/nix.conf (or flake nixConfig)
extra-substituters = https://datao1.github.io/Mesh/
extra-trusted-public-keys = mesh-embedded:vLo1l3Abp0Uzcn21wR3oXvmZxZb1Z1rbk+ggTOIGmeQ=
# Update an embedded device
nixos-rebuild switch --flake github:${REPO}#mesh-embedded --no-write-lock-file
\`\`\`
ML models are downloaded automatically on first use.
---
EOF
# Append changelog notes
cat /tmp/changelog-notes.md >> /tmp/release-body.md
- name: Create Release
uses: softprops/action-gh-release@v2
with:
name: Mesh ${{ steps.version.outputs.version }}
tag_name: ${{ steps.version.outputs.version }}
draft: true
prerelease: ${{ contains(steps.version.outputs.version, '-rc') || contains(steps.version.outputs.version, '-beta') || contains(steps.version.outputs.version, '-alpha') }}
body_path: /tmp/release-body.md
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# ===========================================================================
# Job 2: Build Linux .deb packages (CPU)
# ===========================================================================
build-deb:
name: Build .deb (CPU)
needs: create-release
runs-on: ubuntu-latest
steps:
- name: Free disk space
run: |
echo "Before cleanup:"
df -h /
sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc /usr/local/share/boost
sudo rm -rf /usr/local/graalvm /usr/local/share/chromium /usr/local/.ghcup
echo "After cleanup:"
df -h /
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Nix
uses: cachix/install-nix-action@v31
with:
extra_nix_config: |
experimental-features = nix-command flakes
- name: Nix store cache
uses: DeterminateSystems/magic-nix-cache-action@v8
with:
use-flakehub: false
- name: Restore native deps cache
uses: actions/cache@v4
with:
path: |
target/deb-build/deps
target/deb-build/onnxruntime-cpu-*
key: deb-native-deps-${{ hashFiles('nix/apps/build-deb.nix') }}
- name: Restore Rust build cache
uses: actions/cache@v4
with:
path: |
target/deb-build/rustup
target/deb-build/cargo
target/deb-build/target
key: deb-rust-${{ hashFiles('Cargo.lock') }}
restore-keys: deb-rust-
- name: Build .deb packages
run: nix run .#build-deb
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: deb-cpu
path: dist/deb/*.deb
if-no-files-found: error
retention-days: 5
# ===========================================================================
# Job 3: Build Linux .deb packages (CUDA)
# ===========================================================================
build-deb-cuda:
name: Build .deb (CUDA)
needs: create-release
runs-on: ubuntu-latest
steps:
- name: Free disk space
run: |
echo "Before cleanup:"
df -h /
sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc /usr/local/share/boost
sudo rm -rf /usr/local/graalvm /usr/local/share/chromium /usr/local/.ghcup
echo "After cleanup:"
df -h /
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Nix
uses: cachix/install-nix-action@v31
with:
extra_nix_config: |
experimental-features = nix-command flakes
- name: Nix store cache
uses: DeterminateSystems/magic-nix-cache-action@v8
with:
use-flakehub: false
- name: Restore native deps cache
uses: actions/cache@v4
with:
path: |
target/deb-build/deps
target/deb-build/onnxruntime-gpu-*
key: deb-native-deps-${{ hashFiles('nix/apps/build-deb.nix') }}
- name: Restore Rust build cache
uses: actions/cache@v4
with:
path: |
target/deb-build/rustup
target/deb-build/cargo
target/deb-build/target
key: deb-cuda-rust-${{ hashFiles('Cargo.lock') }}
restore-keys: deb-cuda-rust-
- name: Build CUDA .deb packages
run: nix run .#build-deb-cuda
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: deb-cuda
path: dist/deb/*.deb
if-no-files-found: error
retention-days: 5
# ===========================================================================
# Job 4: Build Windows packages
# ===========================================================================
build-windows:
name: Build Windows
needs: create-release
runs-on: ubuntu-latest
steps:
- name: Free disk space
run: |
echo "Before cleanup:"
df -h /
sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc /usr/local/share/boost
sudo rm -rf /usr/local/graalvm /usr/local/share/chromium /usr/local/.ghcup
echo "After cleanup:"
df -h /
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Nix
uses: cachix/install-nix-action@v31
with:
extra_nix_config: |
experimental-features = nix-command flakes
- name: Nix store cache
uses: DeterminateSystems/magic-nix-cache-action@v8
with:
use-flakehub: false
- name: Restore native deps cache
uses: actions/cache@v4
with:
path: |
target/windows/essentia-win
target/windows/essentia-host
target/windows/essentia-src
target/windows/onnxruntime-directml-*
key: win-native-deps-${{ hashFiles('nix/apps/build-windows.nix') }}
- name: Restore Rust build cache
uses: actions/cache@v4
with:
path: target/windows/x86_64-pc-windows-gnu
key: win-rust-${{ hashFiles('Cargo.lock') }}
restore-keys: win-rust-
- name: Build Windows packages
run: nix run .#build-windows
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: windows
path: dist/windows/*.zip
if-no-files-found: error
retention-days: 5
# ===========================================================================
# Job 5: Build and sync ML models to permanent 'models' release
# ===========================================================================
build-models:
name: Sync Models
needs: create-release
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Nix
uses: cachix/install-nix-action@v31
with:
extra_nix_config: |
experimental-features = nix-command flakes
- name: Nix store cache
uses: DeterminateSystems/magic-nix-cache-action@v8
with:
use-flakehub: false
- name: Restore model cache
id: model-cache
uses: actions/cache@v4
with:
path: models/
key: models-${{ hashFiles('nix/apps/convert-beat-model.nix', 'nix/apps/convert-ml-model.nix', 'nix/apps/convert-model.nix') }}
- name: Convert Beat This! model
if: steps.model-cache.outputs.cache-hit != 'true'
run: |
mkdir -p models
# Remove existing to force reconversion
rm -f models/beat_this_small.onnx
nix run .#convert-beat-model
- name: Convert genre classification head
if: steps.model-cache.outputs.cache-hit != 'true'
run: |
rm -f models/genre_discogs400-discogs-effnet-1.onnx
nix run .#convert-ml-model
- name: Convert Demucs models
if: steps.model-cache.outputs.cache-hit != 'true'
run: |
rm -f models/htdemucs.onnx models/htdemucs.onnx.data
nix run .#convert-model -- htdemucs ./models
rm -f models/htdemucs_ft.onnx models/htdemucs_ft.onnx.data
nix run .#convert-model -- htdemucs_ft ./models
- name: Download pre-built Essentia models
if: steps.model-cache.outputs.cache-hit != 'true'
run: |
# EffNet embedding model (ONNX published directly by Essentia)
curl --fail --location --progress-bar \
-o models/discogs-effnet-bsdynamic-1.onnx \
"https://essentia.upf.edu/models/music-style-classification/discogs-effnet/discogs-effnet-bsdynamic-1.onnx"
# Jamendo mood/theme classification head (ONNX published directly by Essentia)
curl --fail --location --progress-bar \
-o models/mtg_jamendo_moodtheme-discogs-effnet-1.onnx \
"https://essentia.upf.edu/models/classification-heads/mtg_jamendo_moodtheme/mtg_jamendo_moodtheme-discogs-effnet-1.onnx"
- name: Upload models to permanent release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
echo "Models to upload:"
ls -lh models/*.onnx* 2>/dev/null || true
# Ensure the 'models' release exists
if ! gh release view models &>/dev/null; then
gh release create models \
--title "ML Models" \
--notes "Pre-built ONNX models for stem separation, beat detection, and audio classification. Downloaded automatically by mesh-cue on first use."
fi
# Upload all model files (--clobber overwrites existing)
gh release upload models models/*.onnx* --clobber
echo "Models synced to 'models' release."
# ===========================================================================
# Job 6: Build aarch64 mesh-player and publish Nix binary cache
# ===========================================================================
# Runs on every version tag so embedded devices can update via nixos-rebuild.
# The binary cache is served as static files from GitHub Pages at
# https://datao1.github.io/Mesh/ — the Orange Pi fetches pre-built packages
# from here instead of compiling from source.
build-aarch64:
name: Build aarch64 + Cache
needs: create-release
runs-on: ubuntu-24.04-arm # Native aarch64 runner (free for public repos)
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Nix
uses: cachix/install-nix-action@v31
with:
extra_nix_config: |
experimental-features = nix-command flakes
extra-substituters = https://datao1.github.io/Mesh/
extra-trusted-public-keys = mesh-embedded:vLo1l3Abp0Uzcn21wR3oXvmZxZb1Z1rbk+ggTOIGmeQ=
- name: Nix store cache
uses: DeterminateSystems/magic-nix-cache-action@v8
with:
use-flakehub: false
- name: Set up signing key
run: |
echo "${{ secrets.NIX_CACHE_PRIV_KEY }}" > /tmp/cache-priv-key.pem
# Validate key format: must be "name:base64key"
if ! grep -qE '^[a-zA-Z0-9_.-]+:' /tmp/cache-priv-key.pem; then
echo "::error::NIX_CACHE_PRIV_KEY must be in format 'keyname:base64key'"
exit 1
fi
echo "Signing key loaded ($(wc -c < /tmp/cache-priv-key.pem) bytes)"
- name: Build mesh-player
run: |
echo "Building mesh-player for aarch64-linux..."
nix build -L .#packages.aarch64-linux.mesh-player
- name: Create binary cache
run: |
CACHE_DIR="$(pwd)/${{ env.CACHE_NAME }}"
CACHE_STORE="file://${CACHE_DIR}"
mkdir -p "${CACHE_DIR}"
echo "Copying store paths to binary cache..."
nix copy --to "${CACHE_STORE}" ./result
echo "Signing all paths in cache..."
nix store sign \
--store "${CACHE_STORE}" \
--key-file /tmp/cache-priv-key.pem \
--all
echo ""
echo "Cache contents:"
ls -lh "${CACHE_DIR}"/
echo ""
du -sh "${CACHE_DIR}"
echo ""
echo "narinfo count: $(ls "${CACHE_DIR}"/*.narinfo 2>/dev/null | wc -l)"
- name: Verify cache signatures
run: |
CACHE_DIR="$(pwd)/${{ env.CACHE_NAME }}"
# Extract the store path hash (base32, first component after /nix/store/)
STORE_PATH=$(readlink ./result)
STORE_HASH=$(basename "$STORE_PATH" | cut -d'-' -f1)
echo "Checking narinfo for mesh-player (${STORE_HASH})..."
NARINFO="${CACHE_DIR}/${STORE_HASH}.narinfo"
if [ ! -f "$NARINFO" ]; then
echo "::error::narinfo not found: ${NARINFO}"
echo "Available narinfos:"
ls "${CACHE_DIR}"/*.narinfo 2>/dev/null | head -5
exit 1
fi
if grep -q "^Sig:" "$NARINFO"; then
echo "Signature found:"
grep "^Sig:" "$NARINFO"
else
echo "::error::mesh-player narinfo has no signature! Check NIX_CACHE_PRIV_KEY secret."
echo "narinfo contents:"
cat "$NARINFO"
exit 1
fi
- name: Generate index.html
run: |
cd ./${{ env.CACHE_NAME }}
VERSION="${{ needs.create-release.outputs.version }}"
NARINFO_COUNT=$(ls *.narinfo 2>/dev/null | wc -l)
CACHE_SIZE=$(du -sh . | cut -f1)
NAR_COUNT=$(ls nar/*.nar.xz 2>/dev/null | wc -l)
cat > index.html << 'HEADER'
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Mesh — Nix Binary Cache</title>
<style>
body { font-family: -apple-system, system-ui, sans-serif; max-width: 800px; margin: 2rem auto; padding: 0 1rem; color: #e0e0e0; background: #1a1a2e; }
h1 { color: #fff; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin: 1.5rem 0; }
.stat { background: #16213e; padding: 1rem; border-radius: 8px; text-align: center; }
.stat-value { font-size: 1.5rem; font-weight: bold; color: #0ea5e9; }
.stat-label { font-size: 0.85rem; color: #94a3b8; margin-top: 0.25rem; }
code { background: #16213e; padding: 0.2rem 0.5rem; border-radius: 4px; font-size: 0.9rem; }
pre { background: #16213e; padding: 1rem; border-radius: 8px; overflow-x: auto; }
a { color: #0ea5e9; }
table { width: 100%; border-collapse: collapse; margin-top: 1rem; }
th, td { text-align: left; padding: 0.5rem; border-bottom: 1px solid #2a2a4a; }
th { color: #94a3b8; font-weight: normal; font-size: 0.85rem; }
td a { text-decoration: none; }
.version-banner { margin: 1.5rem 0; padding: 1.25rem; background: linear-gradient(135deg, #16213e 0%, #1a1a3e 100%); border: 1px solid #0ea5e9; border-radius: 10px; display: flex; align-items: center; justify-content: space-between; }
.version-banner .ver { font-size: 2rem; font-weight: bold; color: #fff; }
.version-banner .ver a { color: #fff; text-decoration: none; }
.version-banner .ver a:hover { color: #0ea5e9; }
.version-banner .release-link { background: #0ea5e9; color: #1a1a2e; padding: 0.5rem 1.25rem; border-radius: 6px; text-decoration: none; font-weight: 600; font-size: 0.9rem; }
.version-banner .release-link:hover { background: #38bdf8; }
.footer { margin-top: 2rem; color: #64748b; font-size: 0.85rem; }
</style>
</head>
<body>
<h1>Mesh — Nix Binary Cache</h1>
<p>Pre-built aarch64-linux packages for the
<a href="https://github.com/dataO1/Mesh">Mesh DJ Player</a>
embedded deployment (Orange Pi 5).</p>
HEADER
REPO="${{ github.repository }}"
RELEASE_URL="https://github.com/${REPO}/releases/tag/${VERSION}"
cat >> index.html << EOF
<div class="version-banner">
<div class="ver"><a href="${RELEASE_URL}">${VERSION}</a></div>
<a class="release-link" href="${RELEASE_URL}">View Release →</a>
</div>
<div class="stats">
<div class="stat"><div class="stat-value">${NARINFO_COUNT}</div><div class="stat-label">packages</div></div>
<div class="stat"><div class="stat-value">${CACHE_SIZE}</div><div class="stat-label">total size</div></div>
</div>
<h2>Usage</h2>
<p>Add to <code>/etc/nix/nix.conf</code> or flake config:</p>
<pre>extra-substituters = https://datao1.github.io/Mesh/
extra-trusted-public-keys = mesh-embedded:vLo1l3Abp0Uzcn21wR3oXvmZxZb1Z1rbk+ggTOIGmeQ=</pre>
<p>Update the embedded device:</p>
<pre>nixos-rebuild switch --flake github:dataO1/Mesh/${VERSION}#mesh-embedded --no-write-lock-file</pre>
<h2>Packages</h2>
<table>
<tr><th>Package</th><th>Size</th></tr>
EOF
for f in *.narinfo; do
STORE_PATH=$(grep "^StorePath:" "$f" | sed 's/StorePath: \/nix\/store\///')
NAR_SIZE=$(grep "^NarSize:" "$f" | awk '{printf "%.1f MB", $2/1048576}')
echo " <tr><td><a href=\"$f\">$STORE_PATH</a></td><td>$NAR_SIZE</td></tr>" >> index.html
done
cat >> index.html << EOF
</table>
<p class="footer">Last updated: $(date -u '+%Y-%m-%d %H:%M UTC') · <a href="${RELEASE_URL}">${VERSION}</a></p>
</body>
</html>
EOF
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./${{ env.CACHE_NAME }}
keep_files: true
commit_message: "cache: ${{ needs.create-release.outputs.version }} aarch64-linux"
- name: Clean up signing key
if: always()
run: rm -f /tmp/cache-priv-key.pem
# ===========================================================================
# Job 7: Collect artifacts and publish release
# ===========================================================================
publish-release:
name: Publish Release
needs: [create-release, build-deb, build-deb-cuda, build-windows, build-models, build-aarch64]
runs-on: ubuntu-latest
if: always() && needs.create-release.result == 'success'
steps:
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: artifacts/
merge-multiple: true
- name: List artifacts
run: |
echo "Downloaded artifacts:"
find artifacts/ -type f 2>/dev/null | sort || echo "No artifacts found"
- name: Upload artifacts to release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
VERSION="${{ needs.create-release.outputs.version }}"
echo "Uploading to release: $VERSION"
# Upload all .deb and .zip files found
shopt -s nullglob
FILES=(artifacts/*.deb artifacts/*.zip)
if [ ${#FILES[@]} -gt 0 ]; then
gh release upload "$VERSION" "${FILES[@]}" --clobber --repo "${{ github.repository }}"
echo "Uploaded ${#FILES[@]} file(s)"
else
echo "::warning::No artifacts to upload"
fi
- name: Publish release if all builds succeeded
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
VERSION="${{ needs.create-release.outputs.version }}"
DEB_OK="${{ needs.build-deb.result }}"
CUDA_OK="${{ needs.build-deb-cuda.result }}"
WIN_OK="${{ needs.build-windows.result }}"
MODELS_OK="${{ needs.build-models.result }}"
if [ "$DEB_OK" = "success" ] && [ "$CUDA_OK" = "success" ] && [ "$WIN_OK" = "success" ]; then
echo "All app builds succeeded — publishing release"
gh release edit "$VERSION" --draft=false --repo "${{ github.repository }}"
else
echo "::warning::Some builds failed — leaving release as draft"
echo " build-deb: $DEB_OK"
echo " build-deb-cuda: $CUDA_OK"
echo " build-windows: $WIN_OK"
echo " build-models: $MODELS_OK"
fi
- name: Summary
if: always()
run: |
VERSION="${{ needs.create-release.outputs.version }}"
echo "## Release $VERSION" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "| Job | Status |" >> $GITHUB_STEP_SUMMARY
echo "|-----|--------|" >> $GITHUB_STEP_SUMMARY
echo "| Create Release | ${{ needs.create-release.result }} |" >> $GITHUB_STEP_SUMMARY
echo "| Build .deb (CPU) | ${{ needs.build-deb.result }} |" >> $GITHUB_STEP_SUMMARY
echo "| Build .deb (CUDA) | ${{ needs.build-deb-cuda.result }} |" >> $GITHUB_STEP_SUMMARY
echo "| Build Windows | ${{ needs.build-windows.result }} |" >> $GITHUB_STEP_SUMMARY
echo "| Build aarch64 + Cache | ${{ needs.build-aarch64.result }} |" >> $GITHUB_STEP_SUMMARY
echo "| Sync Models | ${{ needs.build-models.result }} |" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
DEB_OK="${{ needs.build-deb.result }}"
CUDA_OK="${{ needs.build-deb-cuda.result }}"
WIN_OK="${{ needs.build-windows.result }}"
if [ "$DEB_OK" = "success" ] && [ "$CUDA_OK" = "success" ] && [ "$WIN_OK" = "success" ]; then
echo "**Release published.**" >> $GITHUB_STEP_SUMMARY
else
echo "**Release left as draft** — some builds failed." >> $GITHUB_STEP_SUMMARY
fi