From ff59d174898da5ab448138aed813fd169ab55e4e Mon Sep 17 00:00:00 2001 From: Lorenzo Mangani Date: Fri, 13 Mar 2026 13:59:19 +0100 Subject: [PATCH 1/2] Add GitHub Actions workflow for release binaries This workflow builds and publishes portable release binaries for multiple platforms when a GitHub Release is published or triggered manually. It includes steps for building, testing, packaging, and uploading binaries. Signed-off-by: Lorenzo Mangani --- .github/workflows/release.yml | 164 ++++++++++++++++++++++++++++++++++ 1 file changed, 164 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..a31e093 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,164 @@ +# Build and publish portable release binaries for every supported platform. +# Runs automatically when a GitHub Release is published, and can also be +# triggered manually via workflow_dispatch (provide the existing release tag). +name: Release Binaries + +on: + release: + types: [published] + workflow_dispatch: + inputs: + release_tag: + description: 'Release tag to attach binaries to (e.g. v0.1.0)' + required: true + type: string + +# Allow uploading assets to releases +permissions: + contents: write + +jobs: + build: + name: Build · ${{ matrix.name }} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + include: + # ──────────── Linux ──────────────────────────────────────────── + - name: linux-x64-cpu-blas + os: ubuntu-22.04 + cmake_flags: -DGGML_BLAS=ON + apt_extra: pkg-config libopenblas-dev + + - name: linux-x64-cuda + os: ubuntu-22.04 + cmake_flags: -DGGML_CUDA=ON + install_cuda: true + + - name: linux-x64-vulkan + os: ubuntu-22.04 + cmake_flags: -DGGML_VULKAN=ON + install_vulkan: true + + # ──────────── macOS ──────────────────────────────────────────── + # macos-latest = arm64 (M-series); Metal + Accelerate auto-enabled + - name: macos-arm64-metal + os: macos-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + submodules: recursive + + # ── Linux: base build tools & optional apt packages ─────────────── + - name: Install build tools (Linux) + if: runner.os == 'Linux' + run: | + sudo apt-get update -qq + sudo apt-get install -y -qq cmake build-essential ${{ matrix.apt_extra || '' }} + + # ── Linux: CUDA toolkit ──────────────── + - name: Install CUDA toolkit (Linux) + uses: Jimver/cuda-toolkit@v0.2.30 + if: matrix.install_cuda == true + with: + log-file-suffix: '${{matrix.os}}.txt' + + # ── Linux: Vulkan SDK ──────────────────────────── + - name: Install Vulkan SDK (Windows) + if: matrix.install_vulkan == true + uses: humbletim/install-vulkan-sdk@v1.2 + with: + version: 1.4.309.0 + cache: true + + # ── Configure & Build ───────────────────────────────────────────── + - name: Configure & Build (Linux / macOS) + if: runner.os != 'Windows' + run: | + mkdir build && cd build + cmake .. ${{ matrix.cmake_flags || '' }} + CORES=$(nproc 2>/dev/null || sysctl -n hw.ncpu 2>/dev/null || echo 4) + cmake --build . --config Release -j"$CORES" + + - name: Configure & Build (Windows) + if: runner.os == 'Windows' + shell: pwsh + run: | + New-Item -ItemType Directory -Path build | Out-Null + Set-Location build + cmake .. ${{ matrix.cmake_flags || '' }} + cmake --build . --config Release -j $env:NUMBER_OF_PROCESSORS + + # ── Smoke test: verify binaries run (no GPU / model required) ───── + - name: Smoke test + continue-on-error: true + shell: bash + run: | + if [ "$RUNNER_OS" = "Windows" ]; then + BIN="build/Release" + EXT=".exe" + else + BIN="build" + EXT="" + fi + "$BIN/ace-qwen3$EXT" --help 2>&1 | head -5 + "$BIN/dit-vae$EXT" --help 2>&1 | head -5 + "$BIN/ace-understand$EXT" --help 2>&1 | head -5 + "$BIN/neural-codec$EXT" --help 2>&1 | head -5 + # quantize and mp3-codec print usage on bad args (exit 1 swallowed by pipe) + "$BIN/quantize$EXT" --help 2>&1 | head -3 + "$BIN/mp3-codec$EXT" 2>&1 | head -3 + + # ── Determine which release tag to upload to ────────────────────── + - name: Resolve release tag + id: tag + shell: bash + run: | + if [ "${{ github.event_name }}" = "release" ]; then + echo "value=${{ github.event.release.tag_name }}" >> $GITHUB_OUTPUT + else + echo "value=${{ inputs.release_tag }}" >> $GITHUB_OUTPUT + fi + + # ── Package binaries ────────────────────────────────────────────── + - name: Package binaries (Linux / macOS) + if: runner.os != 'Windows' + run: | + mkdir -p dist + cp build/ace-qwen3 build/dit-vae build/ace-understand \ + build/quantize build/neural-codec build/mp3-codec dist/ + tar -C dist -czf "acestep-${{ matrix.name }}.tar.gz" . + + - name: Package binaries (Windows) + if: runner.os == 'Windows' + shell: pwsh + run: | + New-Item -ItemType Directory -Path dist | Out-Null + $bins = @('ace-qwen3','dit-vae','ace-understand','quantize','neural-codec','mp3-codec') + foreach ($b in $bins) { + Copy-Item "build\Release\$b.exe" dist\ + } + Compress-Archive -Path dist\* -DestinationPath "acestep-${{ matrix.name }}.zip" + + # ── Upload archive to the GitHub release ────────────────────────── + - name: Upload to release (Linux / macOS) + if: runner.os != 'Windows' + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + gh release upload "${{ steps.tag.outputs.value }}" \ + "acestep-${{ matrix.name }}.tar.gz" \ + --clobber + + - name: Upload to release (Windows) + if: runner.os == 'Windows' + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + shell: pwsh + run: | + gh release upload "${{ steps.tag.outputs.value }}" ` + "acestep-${{ matrix.name }}.zip" ` + --clobber From 2c11c3c246d2661761621445500ba286235c3f6c Mon Sep 17 00:00:00 2001 From: Lorenzo Mangani Date: Fri, 13 Mar 2026 18:26:43 +0100 Subject: [PATCH 2/2] Use All-in-one builder for Linux Use All-in-one CPU, CUDA and Vulkan buildall.sh script Signed-off-by: Lorenzo Mangani --- .github/workflows/release.yml | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a31e093..a75c579 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -30,17 +30,9 @@ jobs: os: ubuntu-22.04 cmake_flags: -DGGML_BLAS=ON apt_extra: pkg-config libopenblas-dev - - - name: linux-x64-cuda - os: ubuntu-22.04 - cmake_flags: -DGGML_CUDA=ON install_cuda: true - - - name: linux-x64-vulkan - os: ubuntu-22.04 - cmake_flags: -DGGML_VULKAN=ON install_vulkan: true - + # ──────────── macOS ──────────────────────────────────────────── # macos-latest = arm64 (M-series); Metal + Accelerate auto-enabled - name: macos-arm64-metal @@ -76,12 +68,14 @@ jobs: # ── Configure & Build ───────────────────────────────────────────── - name: Configure & Build (Linux / macOS) - if: runner.os != 'Windows' + if: runner.os == 'Linux' run: | - mkdir build && cd build - cmake .. ${{ matrix.cmake_flags || '' }} - CORES=$(nproc 2>/dev/null || sysctl -n hw.ncpu 2>/dev/null || echo 4) - cmake --build . --config Release -j"$CORES" + ./buildall.sh + + - name: Configure & Build (Linux / macOS) + if: runner.os == 'Darwin' + run: | + ./builcpu.sh - name: Configure & Build (Windows) if: runner.os == 'Windows' @@ -129,7 +123,7 @@ jobs: run: | mkdir -p dist cp build/ace-qwen3 build/dit-vae build/ace-understand \ - build/quantize build/neural-codec build/mp3-codec dist/ + build/quantize build/neural-codec build/mp3-codec build/*.so dist/ tar -C dist -czf "acestep-${{ matrix.name }}.tar.gz" . - name: Package binaries (Windows)