Skip to content

Commit 89519d7

Browse files
authored
Add GitHub Actions workflow for release binaries (#27)
* Add GitHub Actions workflow for release binaries
1 parent d36afa7 commit 89519d7

1 file changed

Lines changed: 158 additions & 0 deletions

File tree

.github/workflows/release.yml

Lines changed: 158 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,158 @@
1+
# Build and publish portable release binaries for every supported platform.
2+
# Runs automatically when a GitHub Release is published, and can also be
3+
# triggered manually via workflow_dispatch (provide the existing release tag).
4+
name: Release Binaries
5+
6+
on:
7+
release:
8+
types: [published]
9+
workflow_dispatch:
10+
inputs:
11+
release_tag:
12+
description: 'Release tag to attach binaries to (e.g. v0.1.0)'
13+
required: true
14+
type: string
15+
16+
# Allow uploading assets to releases
17+
permissions:
18+
contents: write
19+
20+
jobs:
21+
build:
22+
name: Build · ${{ matrix.name }}
23+
runs-on: ${{ matrix.os }}
24+
strategy:
25+
fail-fast: false
26+
matrix:
27+
include:
28+
# ──────────── Linux ────────────────────────────────────────────
29+
- name: linux-x64-cpu-blas
30+
os: ubuntu-22.04
31+
cmake_flags: -DGGML_BLAS=ON
32+
apt_extra: pkg-config libopenblas-dev
33+
install_cuda: true
34+
install_vulkan: true
35+
36+
# ──────────── macOS ────────────────────────────────────────────
37+
# macos-latest = arm64 (M-series); Metal + Accelerate auto-enabled
38+
- name: macos-arm64-metal
39+
os: macos-latest
40+
41+
steps:
42+
- name: Checkout
43+
uses: actions/checkout@v4
44+
with:
45+
submodules: recursive
46+
47+
# ── Linux: base build tools & optional apt packages ───────────────
48+
- name: Install build tools (Linux)
49+
if: runner.os == 'Linux'
50+
run: |
51+
sudo apt-get update -qq
52+
sudo apt-get install -y -qq cmake build-essential ${{ matrix.apt_extra || '' }}
53+
54+
# ── Linux: CUDA toolkit ────────────────
55+
- name: Install CUDA toolkit (Linux)
56+
uses: Jimver/cuda-toolkit@v0.2.30
57+
if: matrix.install_cuda == true
58+
with:
59+
log-file-suffix: '${{matrix.os}}.txt'
60+
61+
# ── Linux: Vulkan SDK ────────────────────────────
62+
- name: Install Vulkan SDK (Windows)
63+
if: matrix.install_vulkan == true
64+
uses: humbletim/install-vulkan-sdk@v1.2
65+
with:
66+
version: 1.4.309.0
67+
cache: true
68+
69+
# ── Configure & Build ─────────────────────────────────────────────
70+
- name: Configure & Build (Linux / macOS)
71+
if: runner.os == 'Linux'
72+
run: |
73+
./buildall.sh
74+
75+
- name: Configure & Build (Linux / macOS)
76+
if: runner.os == 'Darwin'
77+
run: |
78+
./builcpu.sh
79+
80+
- name: Configure & Build (Windows)
81+
if: runner.os == 'Windows'
82+
shell: pwsh
83+
run: |
84+
New-Item -ItemType Directory -Path build | Out-Null
85+
Set-Location build
86+
cmake .. ${{ matrix.cmake_flags || '' }}
87+
cmake --build . --config Release -j $env:NUMBER_OF_PROCESSORS
88+
89+
# ── Smoke test: verify binaries run (no GPU / model required) ─────
90+
- name: Smoke test
91+
continue-on-error: true
92+
shell: bash
93+
run: |
94+
if [ "$RUNNER_OS" = "Windows" ]; then
95+
BIN="build/Release"
96+
EXT=".exe"
97+
else
98+
BIN="build"
99+
EXT=""
100+
fi
101+
"$BIN/ace-qwen3$EXT" --help 2>&1 | head -5
102+
"$BIN/dit-vae$EXT" --help 2>&1 | head -5
103+
"$BIN/ace-understand$EXT" --help 2>&1 | head -5
104+
"$BIN/neural-codec$EXT" --help 2>&1 | head -5
105+
# quantize and mp3-codec print usage on bad args (exit 1 swallowed by pipe)
106+
"$BIN/quantize$EXT" --help 2>&1 | head -3
107+
"$BIN/mp3-codec$EXT" 2>&1 | head -3
108+
109+
# ── Determine which release tag to upload to ──────────────────────
110+
- name: Resolve release tag
111+
id: tag
112+
shell: bash
113+
run: |
114+
if [ "${{ github.event_name }}" = "release" ]; then
115+
echo "value=${{ github.event.release.tag_name }}" >> $GITHUB_OUTPUT
116+
else
117+
echo "value=${{ inputs.release_tag }}" >> $GITHUB_OUTPUT
118+
fi
119+
120+
# ── Package binaries ──────────────────────────────────────────────
121+
- name: Package binaries (Linux / macOS)
122+
if: runner.os != 'Windows'
123+
run: |
124+
mkdir -p dist
125+
cp build/ace-qwen3 build/dit-vae build/ace-understand \
126+
build/quantize build/neural-codec build/mp3-codec build/*.so dist/
127+
tar -C dist -czf "acestep-${{ matrix.name }}.tar.gz" .
128+
129+
- name: Package binaries (Windows)
130+
if: runner.os == 'Windows'
131+
shell: pwsh
132+
run: |
133+
New-Item -ItemType Directory -Path dist | Out-Null
134+
$bins = @('ace-qwen3','dit-vae','ace-understand','quantize','neural-codec','mp3-codec')
135+
foreach ($b in $bins) {
136+
Copy-Item "build\Release\$b.exe" dist\
137+
}
138+
Compress-Archive -Path dist\* -DestinationPath "acestep-${{ matrix.name }}.zip"
139+
140+
# ── Upload archive to the GitHub release ──────────────────────────
141+
- name: Upload to release (Linux / macOS)
142+
if: runner.os != 'Windows'
143+
env:
144+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
145+
run: |
146+
gh release upload "${{ steps.tag.outputs.value }}" \
147+
"acestep-${{ matrix.name }}.tar.gz" \
148+
--clobber
149+
150+
- name: Upload to release (Windows)
151+
if: runner.os == 'Windows'
152+
env:
153+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
154+
shell: pwsh
155+
run: |
156+
gh release upload "${{ steps.tag.outputs.value }}" `
157+
"acestep-${{ matrix.name }}.zip" `
158+
--clobber

0 commit comments

Comments
 (0)