-
Notifications
You must be signed in to change notification settings - Fork 6
453 lines (384 loc) · 19.5 KB
/
release.yml
File metadata and controls
453 lines (384 loc) · 19.5 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
name: Release
on:
workflow_dispatch:
inputs:
tag:
description: "Release tag (e.g. v1.0.0)"
required: true
default: "v0.0.0-dev"
concurrency:
group: release-${{ github.ref }}
cancel-in-progress: true
env:
ACESTEP_CPP_REPO: https://github.com/audiohacking/acestep.cpp.git
NODE_VERSION: "20"
jobs:
# ────────────────────────────────────────────────────────────────────────────
# 1. Build the React frontend (platform-independent)
# ────────────────────────────────────────────────────────────────────────────
build-frontend:
name: Build frontend
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: "npm"
- name: Install & build
run: npm ci && npm run build
- uses: actions/upload-artifact@v4
with:
name: frontend-dist
path: dist/
retention-days: 1
# ────────────────────────────────────────────────────────────────────────────
# 2. Compile the Node.js server (platform-independent JS)
# ────────────────────────────────────────────────────────────────────────────
build-server:
name: Build Node.js server
runs-on: ubuntu-latest
defaults:
run:
working-directory: server
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: "npm"
cache-dependency-path: server/package-lock.json
- name: Install, compile & prune to production deps
run: |
npm ci
npm run build
npm prune --production
- uses: actions/upload-artifact@v4
with:
name: server-bundle
path: |
server/dist/
server/node_modules/
server/package.json
retention-days: 1
# ────────────────────────────────────────────────────────────────────────────
# 3. Per-platform: assemble the bundle with build + model scripts
# acestep.cpp is NOT compiled here — it is compiled on the user's machine
# by build.sh / build.bat on first launch, which detects the actual GPU.
# ────────────────────────────────────────────────────────────────────────────
build-platform:
name: Bundle ${{ matrix.label }}
needs: [build-frontend, build-server]
runs-on: ubuntu-latest
permissions:
contents: read
strategy:
fail-fast: false
matrix:
include:
- label: linux-x64
os: linux
- label: linux-arm64
os: linux
- label: macos-arm64
os: macos
- label: windows-x64
os: windows
steps:
- uses: actions/checkout@v4
# ── Download pre-built UI artifacts ─────────────────────────────────
- uses: actions/download-artifact@v4
with:
name: frontend-dist
path: _release/dist
- uses: actions/download-artifact@v4
with:
name: server-bundle
path: _release/server-bundle
# ── Assemble the release bundle ──────────────────────────────────────
- name: Assemble bundle
shell: bash
run: |
set -e
APP=acestep-cpp-ui
mkdir -p "$APP/bin" "$APP/dist" "$APP/server/dist" "$APP/server/node_modules" \
"$APP/data" "$APP/public/audio" "$APP/logs" "$APP/models"
# Node.js server (compiled JS + production node_modules)
cp -r _release/server-bundle/dist/. "$APP/server/dist/"
cp -r _release/server-bundle/node_modules/. "$APP/server/node_modules/"
cp _release/server-bundle/package.json "$APP/server/"
# React frontend (served by the API server)
cp -r _release/dist/. "$APP/dist/"
# .env template
cp .env.example "$APP/.env.example"
# Build scripts — compile acestep.cpp with GPU detection on first run
cp build.sh "$APP/build.sh"
chmod +x "$APP/build.sh"
cp build.bat "$APP/build.bat"
# Model download scripts
cp models.sh "$APP/models.sh"
chmod +x "$APP/models.sh"
cp models.bat "$APP/models.bat"
# ── start.sh (Linux / macOS) ──────────────────────────────────────
cat > "$APP/start.sh" << 'SH'
#!/bin/bash
# ACE-Step UI — start
# On first launch: compiles acestep.cpp for your GPU and downloads base models.
set -e
DIR="$(cd "$(dirname "$0")" && pwd)"
cd "$DIR"
# Load .env if present
[ -f .env ] && export $(grep -v '^#' .env | grep -v '^\s*$' | xargs)
# ── First-run: compile acestep.cpp ───────────────────────────────────────────
if [ ! -x "$DIR/bin/ace-lm" ] || [ ! -x "$DIR/bin/ace-synth" ]; then
echo "═══════════════════════════════════════════════════════"
echo " First run: building acestep.cpp for your hardware"
echo " GPU support (CUDA / ROCm / Vulkan / Metal) is"
echo " detected automatically from your system."
echo " This takes a few minutes and only happens once."
echo "═══════════════════════════════════════════════════════"
echo ""
bash "$DIR/build.sh"
echo ""
fi
# ── First-run: download models ───────────────────────────────────────────────
: "${MODELS_DIR:=$DIR/models}"
if ! ls "$MODELS_DIR"/*.gguf &>/dev/null 2>&1; then
echo "═══════════════════════════════════════════════════════"
echo " First run: downloading base GGUF models (~8 GB)"
echo " VAE + Text Encoder + LM-4B + DiT-Turbo (Q8_0)"
echo " Requires: curl or wget"
echo "═══════════════════════════════════════════════════════"
echo ""
bash "$DIR/models.sh" --dir "$MODELS_DIR"
echo ""
fi
# ── Start the server ─────────────────────────────────────────────────────────
: "${ACE_LM_BIN:=$DIR/bin/ace-lm}"
: "${ACE_SYNTH_BIN:=$DIR/bin/ace-synth}"
: "${PORT:=3001}"
mkdir -p logs data public/audio
echo "Starting ACE-Step UI on port $PORT ..."
ACE_LM_BIN="$ACE_LM_BIN" \
ACE_SYNTH_BIN="$ACE_SYNTH_BIN" \
MODELS_DIR="$MODELS_DIR" \
PORT="$PORT" \
DATABASE_PATH="$DIR/data/acestep.db" \
AUDIO_DIR="$DIR/public/audio" \
FRONTEND_URL="http://localhost:$PORT" \
node "$DIR/server/dist/index.js" &
NODE_PID=$!
sleep 2
echo ""
echo "ACE-Step UI → http://localhost:$PORT"
echo ""
trap 'kill $NODE_PID 2>/dev/null; exit 0' INT TERM
wait $NODE_PID
SH
chmod +x "$APP/start.sh"
# ── start.bat (Windows) ───────────────────────────────────────────
cat > "$APP/start.bat" << 'BAT'
@echo off
:: ACE-Step UI — start
:: On first launch: compiles acestep.cpp for your GPU and downloads base models.
setlocal EnableDelayedExpansion
set DIR=%~dp0
cd /d "%DIR%"
:: Load .env if present
if exist ".env" (
for /f "usebackq tokens=* delims=" %%l in (".env") do (
set line=%%l
if not "!line:~0,1!"=="#" if not "!line!"=="" set %%l
)
)
:: First-run: compile acestep.cpp
if not exist "%DIR%bin\ace-lm.exe" (
echo ═══════════════════════════════════════════════════════
echo First run: building acestep.cpp for your hardware
echo GPU support ^(CUDA / Vulkan^) is detected automatically.
echo This takes a few minutes and only happens once.
echo ═══════════════════════════════════════════════════════
echo.
call "%DIR%build.bat"
if %ERRORLEVEL% NEQ 0 ( echo Build failed. See output above. & pause & exit /b 1 )
echo.
)
:: First-run: download models
if "%MODELS_DIR%"=="" set MODELS_DIR=%DIR%models
dir /b "%MODELS_DIR%\*.gguf" >nul 2>&1
if %ERRORLEVEL% NEQ 0 (
echo ═══════════════════════════════════════════════════════
echo First run: downloading base GGUF models ~8 GB
echo VAE + Text Encoder + LM-4B + DiT-Turbo ^(Q8_0^)
echo ═══════════════════════════════════════════════════════
echo.
call "%DIR%models.bat" --dir "%MODELS_DIR%"
echo.
)
:: Start the server
if "%ACE_LM_BIN%"=="" set ACE_LM_BIN=%DIR%bin\ace-lm.exe
if "%ACE_SYNTH_BIN%"=="" set ACE_SYNTH_BIN=%DIR%bin\ace-synth.exe
if "%PORT%"=="" set PORT=3001
mkdir logs 2>nul & mkdir data 2>nul & mkdir public\audio 2>nul
echo Starting ACE-Step UI on port %PORT% ...
set DATABASE_PATH=%DIR%data\acestep.db
set AUDIO_DIR=%DIR%public\audio
set FRONTEND_URL=http://localhost:%PORT%
node "%DIR%server\dist\index.js"
BAT
# ── Release README ────────────────────────────────────────────────
cat > "$APP/README.md" << 'MD'
# ACE-Step UI
Self-contained release bundle — no Python required.
Music generation is powered by [acestep.cpp](https://github.com/audiohacking/acestep.cpp).
## Requirements
- **Node.js ≥ 20** — runtime for the API server ([nodejs.org](https://nodejs.org))
- **cmake + git** — required by `build.sh` / `build.bat` to compile `acestep.cpp`
- **curl or wget** — required by `models.sh` to download model files
- **~8 GB free disk space** — for the default `Q8_0` model set
## Quick Start
```bash
# Just run start.sh — it handles everything on first launch:
# 1. Detects your GPU (CUDA / ROCm / Vulkan / Metal) and compiles acestep.cpp
# 2. Downloads the base GGUF models (~8 GB)
# 3. Starts the UI on http://localhost:3001
./start.sh
```
On Windows:
```bat
start.bat
```
## GPU Acceleration
`build.sh` / `build.bat` automatically detect your GPU on first launch:
| GPU | Flag used |
|-----|-----------|
| NVIDIA (CUDA) | `-DGGML_CUDA=ON` |
| AMD (ROCm/HIP) | `-DGGML_HIP=ON` |
| Any (Vulkan) | `-DGGML_VULKAN=ON` |
| macOS (Metal) | auto-detected by cmake |
| CPU only | no flags |
To force a specific backend, run the build script manually:
```bash
./build.sh --cuda # Force CUDA
./build.sh --rocm # Force ROCm/HIP
./build.sh --vulkan # Force Vulkan
./build.sh --cpu # CPU-only
```
## Environment Variables
| Variable | Default | Description |
|----------|---------|-------------|
| `ACE_LM_BIN` | `./bin/ace-lm` | Path to the ace-lm LLM binary |
| `ACE_SYNTH_BIN` | `./bin/ace-synth` | Path to the ace-synth binary |
| `MODELS_DIR` | `./models` | Directory containing GGUF model files |
| `PORT` | `3001` | API + UI server port |
| `AUDIO_DIR` | `./public/audio` | Where generated audio is stored |
| `JWT_SECRET` | built-in | Change for multi-user deployments |
Copy `.env.example` → `.env` to customise these.
## Model Management
Download models manually (useful for selecting a different quantisation):
```bash
./models.sh # Default: Q8_0 essentials (~8 GB)
./models.sh --quant Q5_K_M # Smaller, slightly lower quality
./models.sh --all # Every model and quantisation
```
MD
echo "Bundle assembled for ${{ matrix.label }}:"
ls -lh "$APP/"
# ── Package ──────────────────────────────────────────────────────────
- name: Create archive (tar.gz)
if: matrix.os != 'windows'
shell: bash
run: |
TAG="${GITHUB_REF_NAME:-${{ github.event.inputs.tag }}}"
[[ "$TAG" != v* ]] && TAG="${{ github.event.inputs.tag || 'v0.0.0-dev' }}"
ARCHIVE="acestep-cpp-ui-${TAG}-${{ matrix.label }}.tar.gz"
tar -czf "$ARCHIVE" acestep-cpp-ui/
echo "ARCHIVE=$ARCHIVE" >> "$GITHUB_ENV"
ls -lh "$ARCHIVE"
- name: Create archive (zip — Windows)
if: matrix.os == 'windows'
shell: bash
run: |
TAG="${GITHUB_REF_NAME:-${{ github.event.inputs.tag }}}"
[[ "$TAG" != v* ]] && TAG="${{ github.event.inputs.tag || 'v0.0.0-dev' }}"
ARCHIVE="acestep-cpp-ui-${TAG}-${{ matrix.label }}.zip"
zip -qr "$ARCHIVE" acestep-cpp-ui/
echo "ARCHIVE=$ARCHIVE" >> "$GITHUB_ENV"
ls -lh "$ARCHIVE"
- uses: actions/upload-artifact@v4
with:
name: release-${{ matrix.label }}
path: ${{ env.ARCHIVE }}
retention-days: 7
# ────────────────────────────────────────────────────────────────────────────
# 4. Publish GitHub Release
# ────────────────────────────────────────────────────────────────────────────
publish-release:
name: Publish GitHub Release
needs: build-platform
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/download-artifact@v4
with:
pattern: release-*
path: release-artifacts
merge-multiple: true
- name: List artifacts
run: ls -lh release-artifacts/
- name: Resolve tag
id: tag
run: |
TAG="${GITHUB_REF_NAME:-}"
[[ "$TAG" == v* ]] || TAG="${{ github.event.inputs.tag || 'v0.0.0-dev' }}"
echo "tag=$TAG" >> "$GITHUB_OUTPUT"
- name: Generate changelog
id: changelog
run: |
PREV=$(git describe --tags --abbrev=0 HEAD^ 2>/dev/null || echo "")
if [ -n "$PREV" ]; then
LOG=$(git log "${PREV}..HEAD" --oneline --no-decorate 2>/dev/null | head -50)
else
LOG=$(git log --oneline --no-decorate | head -30)
fi
{ echo "log<<EOF"; echo "$LOG"; echo "EOF"; } >> "$GITHUB_OUTPUT"
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ steps.tag.outputs.tag }}
name: "ACE-Step UI ${{ steps.tag.outputs.tag }}"
draft: false
prerelease: ${{ contains(steps.tag.outputs.tag, '-') }}
body: |
## ACE-Step UI ${{ steps.tag.outputs.tag }}
Self-contained bundle — **no Python required**.
Music generation is powered by [acestep.cpp](https://github.com/audiohacking/acestep.cpp).
> **GPU acceleration is built on your machine** — `start.sh` / `start.bat` automatically
> detects your GPU (CUDA / ROCm / Vulkan / Metal) and compiles `acestep.cpp` on first launch.
> Models are also downloaded automatically on first run.
### Platforms
| File | OS | Arch |
|------|----|------|
| `*-linux-x64.tar.gz` | Linux | x86\_64 |
| `*-linux-arm64.tar.gz` | Linux | ARM64 |
| `*-macos-arm64.tar.gz` | macOS | Apple Silicon |
| `*-windows-x64.zip` | Windows | x86\_64 |
### Requirements
- **Node.js ≥ 20** — [nodejs.org](https://nodejs.org)
- **cmake + git** — to compile `acestep.cpp` on first launch
- **curl or wget** — to download GGUF model files on first launch
### Quick Start
```bash
tar xzf acestep-cpp-ui-*-linux-x64.tar.gz
cd acestep-cpp-ui
./start.sh # builds acestep.cpp, downloads models, starts UI → http://localhost:3001
```
On Windows: extract the `.zip` and run `start.bat`.
### What's Changed
${{ steps.changelog.outputs.log }}
files: release-artifacts/*
fail_on_unmatched_files: false