|
| 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 | + |
| 34 | + - name: linux-x64-cuda |
| 35 | + os: ubuntu-22.04 |
| 36 | + cmake_flags: -DGGML_CUDA=ON |
| 37 | + install_cuda: true |
| 38 | + |
| 39 | + - name: linux-x64-vulkan |
| 40 | + os: ubuntu-22.04 |
| 41 | + cmake_flags: -DGGML_VULKAN=ON |
| 42 | + apt_extra: libvulkan-dev glslang-tools |
| 43 | + |
| 44 | + # ──────────── macOS ──────────────────────────────────────────── |
| 45 | + # macos-latest = arm64 (M-series); Metal + Accelerate auto-enabled |
| 46 | + - name: macos-arm64-metal |
| 47 | + os: macos-latest |
| 48 | + |
| 49 | + # ──────────── Windows ────────────────────────────────────────── |
| 50 | + # - name: windows-x64-cpu |
| 51 | + # os: windows-latest |
| 52 | + |
| 53 | + # CUDA 12.6.3 is pre-installed on windows-latest |
| 54 | + - name: windows-x64-cuda |
| 55 | + os: windows-latest |
| 56 | + cmake_flags: -DGGML_CUDA=ON |
| 57 | + |
| 58 | + - name: windows-x64-vulkan |
| 59 | + os: windows-latest |
| 60 | + cmake_flags: -DGGML_VULKAN=ON |
| 61 | + install_vulkan_sdk: true |
| 62 | + |
| 63 | + steps: |
| 64 | + - name: Checkout |
| 65 | + uses: actions/checkout@v4 |
| 66 | + with: |
| 67 | + submodules: recursive |
| 68 | + |
| 69 | + # ── Linux: base build tools & optional apt packages ─────────────── |
| 70 | + - name: Install build tools (Linux) |
| 71 | + if: runner.os == 'Linux' |
| 72 | + run: | |
| 73 | + sudo apt-get update -qq |
| 74 | + sudo apt-get install -y -qq cmake build-essential ${{ matrix.apt_extra || '' }} |
| 75 | +
|
| 76 | + # ── Linux: CUDA toolkit from NVIDIA apt repository ──────────────── |
| 77 | + - name: Install CUDA toolkit (Linux) |
| 78 | + if: matrix.install_cuda == true |
| 79 | + run: | |
| 80 | + wget -q https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-keyring_1.1-1_all.deb |
| 81 | + sudo dpkg -i cuda-keyring_1.1-1_all.deb |
| 82 | + sudo apt-get update -qq |
| 83 | + sudo apt-get install -y -qq cuda-toolkit-12-8 |
| 84 | + echo "/usr/local/cuda/bin" >> $GITHUB_PATH |
| 85 | +
|
| 86 | + # ── Windows: Vulkan SDK via Chocolatey ──────────────────────────── |
| 87 | + - name: Install Vulkan SDK (Windows) |
| 88 | + if: matrix.install_vulkan_sdk == true |
| 89 | + shell: pwsh |
| 90 | + run: | |
| 91 | + choco install vulkan-sdk --yes --no-progress |
| 92 | + # Reload env so VULKAN_SDK is visible in subsequent steps |
| 93 | + $sdkRoot = (Get-ChildItem 'C:\VulkanSDK' | Sort-Object Name | Select-Object -Last 1).FullName |
| 94 | + "VULKAN_SDK=$sdkRoot" | Out-File -FilePath $env:GITHUB_ENV -Append |
| 95 | + "$sdkRoot\Bin" | Out-File -FilePath $env:GITHUB_PATH -Append |
| 96 | +
|
| 97 | + # ── Configure & Build ───────────────────────────────────────────── |
| 98 | + - name: Configure & Build (Linux / macOS) |
| 99 | + if: runner.os != 'Windows' |
| 100 | + run: | |
| 101 | + mkdir build && cd build |
| 102 | + cmake .. ${{ matrix.cmake_flags || '' }} |
| 103 | + CORES=$(nproc 2>/dev/null || sysctl -n hw.ncpu 2>/dev/null || echo 4) |
| 104 | + cmake --build . --config Release -j"$CORES" |
| 105 | +
|
| 106 | + - name: Configure & Build (Windows) |
| 107 | + if: runner.os == 'Windows' |
| 108 | + shell: pwsh |
| 109 | + run: | |
| 110 | + New-Item -ItemType Directory -Path build | Out-Null |
| 111 | + Set-Location build |
| 112 | + cmake .. ${{ matrix.cmake_flags || '' }} |
| 113 | + cmake --build . --config Release -j $env:NUMBER_OF_PROCESSORS |
| 114 | +
|
| 115 | + # ── Smoke test: verify binaries run (no GPU / model required) ───── |
| 116 | + - name: Smoke test |
| 117 | + shell: bash |
| 118 | + run: | |
| 119 | + if [ "$RUNNER_OS" = "Windows" ]; then |
| 120 | + BIN="build/Release" |
| 121 | + EXT=".exe" |
| 122 | + else |
| 123 | + BIN="build" |
| 124 | + EXT="" |
| 125 | + fi |
| 126 | + "$BIN/ace-qwen3$EXT" --help 2>&1 | head -5 |
| 127 | + "$BIN/dit-vae$EXT" --help 2>&1 | head -5 |
| 128 | + "$BIN/ace-understand$EXT" --help 2>&1 | head -5 |
| 129 | + "$BIN/neural-codec$EXT" --help 2>&1 | head -5 |
| 130 | + # quantize and mp3-codec print usage on bad args (exit 1 swallowed by pipe) |
| 131 | + "$BIN/quantize$EXT" --help 2>&1 | head -3 |
| 132 | + "$BIN/mp3-codec$EXT" 2>&1 | head -3 |
| 133 | +
|
| 134 | + # ── Determine which release tag to upload to ────────────────────── |
| 135 | + - name: Resolve release tag |
| 136 | + id: tag |
| 137 | + shell: bash |
| 138 | + run: | |
| 139 | + if [ "${{ github.event_name }}" = "release" ]; then |
| 140 | + echo "value=${{ github.event.release.tag_name }}" >> $GITHUB_OUTPUT |
| 141 | + else |
| 142 | + echo "value=${{ inputs.release_tag }}" >> $GITHUB_OUTPUT |
| 143 | + fi |
| 144 | +
|
| 145 | + # ── Package binaries ────────────────────────────────────────────── |
| 146 | + - name: Package binaries (Linux / macOS) |
| 147 | + if: runner.os != 'Windows' |
| 148 | + run: | |
| 149 | + mkdir -p dist |
| 150 | + cp build/ace-qwen3 build/dit-vae build/ace-understand \ |
| 151 | + build/quantize build/neural-codec build/mp3-codec dist/ |
| 152 | + tar -C dist -czf "acestep-${{ matrix.name }}.tar.gz" . |
| 153 | +
|
| 154 | + - name: Package binaries (Windows) |
| 155 | + if: runner.os == 'Windows' |
| 156 | + shell: pwsh |
| 157 | + run: | |
| 158 | + New-Item -ItemType Directory -Path dist | Out-Null |
| 159 | + $bins = @('ace-qwen3','dit-vae','ace-understand','quantize','neural-codec','mp3-codec') |
| 160 | + foreach ($b in $bins) { |
| 161 | + Copy-Item "build\Release\$b.exe" dist\ |
| 162 | + } |
| 163 | + Compress-Archive -Path dist\* -DestinationPath "acestep-${{ matrix.name }}.zip" |
| 164 | +
|
| 165 | + # ── Upload archive to the GitHub release ────────────────────────── |
| 166 | + - name: Upload to release (Linux / macOS) |
| 167 | + if: runner.os != 'Windows' |
| 168 | + env: |
| 169 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 170 | + run: | |
| 171 | + gh release upload "${{ steps.tag.outputs.value }}" \ |
| 172 | + "acestep-${{ matrix.name }}.tar.gz" \ |
| 173 | + --clobber |
| 174 | +
|
| 175 | + - name: Upload to release (Windows) |
| 176 | + if: runner.os == 'Windows' |
| 177 | + env: |
| 178 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 179 | + shell: pwsh |
| 180 | + run: | |
| 181 | + gh release upload "${{ steps.tag.outputs.value }}" ` |
| 182 | + "acestep-${{ matrix.name }}.zip" ` |
| 183 | + --clobber |
0 commit comments