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