# audio.cpp - release.yml # # Ported from llama.cpp's release workflow and stripped to the backends # audio.cpp ships: CPU, CUDA, Vulkan, Metal and best-effort HIP test builds. # Windows CUDA uses the GGML_BACKEND_DL model so the # CUDA backend is shipped once as ggml-cuda.dll (thin cli/server/gguf shells) # with the heavy CUDA runtime DLLs in a separate cudart...zip, and the release # job publishes. # # Semantic-version, tag-driven releases. The workflow runs when a `v*` (semver) # tag is pushed (drafting a Release and Publishing it) or when run manually # from the Actions UI with an explicit version. Publishing attaches the built # binaries to that version's GitHub Release. There is NO auto-release on every # push to `main`. name: Release on: workflow_dispatch: inputs: version: description: 'Semantic version to release, e.g. 1.2.0 or v1.2.0 (used for manual runs; tag-triggered runs use the pushed tag).' required: true default: '' type: string publish: description: 'Publish a GitHub Release after the build. Leave unchecked for a build-only dry run.' required: false default: false type: boolean source_repository: description: 'Optional source repository; defaults to this repository.' required: false default: '' type: string source_ref: description: 'Optional source revision; defaults to the workflow revision.' required: false default: '' type: string push: tags: - 'v*' env: GH_TOKEN: ${{ github.token }} BUILD_TARGETS: audiocpp_cli audiocpp_server audiocpp_gguf VULKAN_VERSION: '1.4.357.0' CMAKE_ARGS: "-DAUDIOCPP_DEPLOYMENT_BUILD=ON -DAUDIOCPP_BUILD_NATIVE_MODEL_MANAGER=ON -DENGINE_ENABLE_LLAMAFILE=ON -DENGINE_ENABLE_CUDA_GRAPHS=ON" # note: run this workflow one at a time for better cache reuse concurrency: group: release queue: max jobs: check-release: runs-on: ubuntu-latest outputs: should_release: ${{ steps.check.outputs.should_release }} steps: # The only triggers are a manually-run workflow or a pushed `v*` tag - # both are intentional, so always proceed. - id: check run: echo "should_release=true" >> "$GITHUB_OUTPUT" get-version: runs-on: ubuntu-latest outputs: tag: ${{ steps.version.outputs.tag }} version: ${{ steps.version.outputs.version }} source_sha: ${{ steps.source.outputs.sha }} needs: check-release if: ${{ needs.check-release.outputs.should_release == 'true' }} steps: - uses: actions/checkout@v4 with: fetch-depth: 0 repository: ${{ inputs.source_repository || github.repository }} ref: ${{ inputs.source_ref || github.sha }} - name: Resolve source revision id: source shell: bash env: SOURCE_REPOSITORY: ${{ inputs.source_repository || github.repository }} PUBLISH: ${{ github.ref_type == 'tag' || inputs.publish }} run: | if [[ "$PUBLISH" == true && "$SOURCE_REPOSITORY" != "$GITHUB_REPOSITORY" ]]; then echo "::error::Publish from the source repository, not a separate workflow repository." exit 1 fi echo "sha=$(git rev-parse HEAD)" >> "$GITHUB_OUTPUT" - name: Resolve release tag id: version run: | if [[ "${{ github.ref_type }}" == "tag" ]]; then TAG="${{ github.ref_name }}" elif [[ -n "${{ inputs.version }}" ]]; then TAG="${{ inputs.version }}" else echo "::error::No semver tag or version provided (push a v* tag, or run manually with a version)." exit 1 fi [[ "$TAG" == v* ]] || TAG="v${TAG}" VERSION="${TAG#v}" echo "tag=${TAG}" >> "$GITHUB_OUTPUT" echo "version=${VERSION}" >> "$GITHUB_OUTPUT" server-config-examples: name: Server config examples needs: get-version runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 with: repository: ${{ inputs.source_repository || github.repository }} ref: ${{ needs.get-version.outputs.source_sha }} - name: Package server config examples env: TAG: ${{ needs.get-version.outputs.tag }} run: zip -qr "audio-${TAG}-server-config-examples.zip" LICENSE examples/server - uses: actions/upload-artifact@v4 with: name: audio-${{ needs.get-version.outputs.tag }}-server-config-examples path: audio-${{ needs.get-version.outputs.tag }}-server-config-examples.zip if-no-files-found: error macos-metal: name: macOS (${{ matrix.build }}) needs: [check-release, get-version] if: ${{ needs.check-release.outputs.should_release == 'true' }} runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: include: - build: 'arm64' arch: 'arm64' os: macos-26 defines: '-DGGML_METAL=ON -DCMAKE_OSX_DEPLOYMENT_TARGET=13.3 -DENGINE_ENABLE_OPENMP=OFF -DGGML_OPENMP=OFF' - build: 'x64' arch: 'x64' os: macos-26-intel # Metal disabled on x64 (GitHub Intel runners have no usable GPU) defines: '-DGGML_METAL=OFF -DCMAKE_OSX_DEPLOYMENT_TARGET=13.3 -DENGINE_ENABLE_OPENMP=OFF -DGGML_OPENMP=OFF' steps: - uses: actions/checkout@v4 with: fetch-depth: 0 repository: ${{ inputs.source_repository || github.repository }} ref: ${{ needs.get-version.outputs.source_sha }} - name: Configure run: | cmake -S . -B build -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_INSTALL_RPATH='@loader_path' -DCMAKE_BUILD_WITH_INSTALL_RPATH=ON \ -DENGINE_ENABLE_CUDA=OFF -DENGINE_ENABLE_VULKAN=OFF \ -DAUDIOCPP_VERSION=${{ needs.get-version.outputs.version }} \ ${{ matrix.defines }} ${{ env.CMAKE_ARGS }} - name: Build run: cmake --build build --config Release --parallel "$(sysctl -n hw.logicalcpu)" --target ${{ env.BUILD_TARGETS }} - name: Stage bundle run: | cp LICENSE build/bin/ 2>/dev/null || true cp -r tools build/bin/tools 2>/dev/null || true cp -r model_specs build/bin/model_specs 2>/dev/null || true - uses: actions/upload-artifact@v4 with: name: audio-${{ needs.get-version.outputs.tag }}-bin-macos-${{ matrix.arch }}-metal path: build/bin/* - name: Build and stage C API library run: | cmake -S . -B build -DAUDIOCPP_BUILD_C_API=ON cmake --build build --parallel "$(sysctl -n hw.logicalcpu)" --target audiocpp mkdir -p dist-lib/libs dist-lib/include cp include/audiocpp.h dist-lib/include/ cp LICENSE dist-lib/ find build/bin -maxdepth 1 \( -name '*.so*' -o -name '*.dylib' \) -exec cp -P {} dist-lib/libs/ \; mv build/bin/libaudiocpp* dist-lib/libs/ tar -czf audio-${{ needs.get-version.outputs.tag }}-lib-macos-${{ matrix.arch }}-metal.tar.gz -C dist-lib . - uses: actions/upload-artifact@v4 with: name: audio-${{ needs.get-version.outputs.tag }}-lib-macos-${{ matrix.arch }}-metal path: audio-${{ needs.get-version.outputs.tag }}-lib-macos-${{ matrix.arch }}-metal.tar.gz linux-cpu: name: Ubuntu x64 (CPU) needs: [check-release, get-version] if: ${{ needs.check-release.outputs.should_release == 'true' }} runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 with: fetch-depth: 0 repository: ${{ inputs.source_repository || github.repository }} ref: ${{ needs.get-version.outputs.source_sha }} - name: Install deps run: sudo apt-get update && sudo apt-get install -y build-essential cmake make glslc libvulkan-dev spirv-headers - name: Configure run: | cmake -S . -B build -DCMAKE_BUILD_TYPE=Release \ -DENGINE_ENABLE_CUDA=OFF -DENGINE_ENABLE_VULKAN=OFF \ -DAUDIOCPP_VERSION=${{ needs.get-version.outputs.version }} \ ${{ env.CMAKE_ARGS }} - name: Build run: cmake --build build --config Release --parallel "$(nproc)" --target ${{ env.BUILD_TARGETS }} - name: Stage bundle run: | cp LICENSE build/bin/ 2>/dev/null || true cp -r tools build/bin/tools 2>/dev/null || true cp -r model_specs build/bin/model_specs 2>/dev/null || true - uses: actions/upload-artifact@v4 with: name: audio-${{ needs.get-version.outputs.tag }}-bin-ubuntu-x64-cpu path: build/bin/* - name: Build and stage C API library run: | cmake -S . -B build -DAUDIOCPP_BUILD_C_API=ON cmake --build build --parallel "$(nproc)" --target audiocpp mkdir -p dist-lib/libs dist-lib/include cp include/audiocpp.h dist-lib/include/ cp LICENSE dist-lib/ find build/bin -maxdepth 1 \( -name '*.so*' -o -name '*.dylib' \) -exec cp -P {} dist-lib/libs/ \; mv build/bin/libaudiocpp* dist-lib/libs/ tar -czf audio-${{ needs.get-version.outputs.tag }}-lib-ubuntu-x64-cpu.tar.gz -C dist-lib . - uses: actions/upload-artifact@v4 with: name: audio-${{ needs.get-version.outputs.tag }}-lib-ubuntu-x64-cpu path: audio-${{ needs.get-version.outputs.tag }}-lib-ubuntu-x64-cpu.tar.gz linux-cpu-portable: name: Ubuntu x64 (CPU portable) needs: [check-release, get-version] if: ${{ needs.check-release.outputs.should_release == 'true' }} runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 with: fetch-depth: 0 repository: ${{ inputs.source_repository || github.repository }} ref: ${{ needs.get-version.outputs.source_sha }} - name: Install deps run: sudo apt-get update && sudo apt-get install -y build-essential cmake make glslc libvulkan-dev spirv-headers - name: Configure run: | cmake -S . -B build -DCMAKE_BUILD_TYPE=Release \ -DENGINE_ENABLE_CUDA=OFF -DENGINE_ENABLE_VULKAN=OFF \ -DENGINE_ENABLE_NATIVE_CPU=OFF \ -DENGINE_ENABLE_CPU_ALL_VARIANTS=ON \ -DAUDIOCPP_VERSION=${{ needs.get-version.outputs.version }} \ ${{ env.CMAKE_ARGS }} - name: Build run: cmake --build build --config Release --parallel "$(nproc)" --target ${{ env.BUILD_TARGETS }} - name: Stage bundle run: | cp LICENSE build/bin/ 2>/dev/null || true cp -r tools build/bin/tools 2>/dev/null || true cp -r model_specs build/bin/model_specs 2>/dev/null || true - uses: actions/upload-artifact@v4 with: name: audio-${{ needs.get-version.outputs.tag }}-bin-ubuntu-x64-cpu-portable path: build/bin/* - name: Build and stage C API library run: | cmake -S . -B build -DAUDIOCPP_BUILD_C_API=ON cmake --build build --parallel "$(nproc)" --target audiocpp mkdir -p dist-lib/libs dist-lib/include cp include/audiocpp.h dist-lib/include/ cp LICENSE dist-lib/ find build/bin -maxdepth 1 \( -name '*.so*' -o -name '*.dylib' \) -exec cp -P {} dist-lib/libs/ \; mv build/bin/libaudiocpp* dist-lib/libs/ tar -czf audio-${{ needs.get-version.outputs.tag }}-lib-ubuntu-x64-cpu-portable.tar.gz -C dist-lib . - uses: actions/upload-artifact@v4 with: name: audio-${{ needs.get-version.outputs.tag }}-lib-ubuntu-x64-cpu-portable path: audio-${{ needs.get-version.outputs.tag }}-lib-ubuntu-x64-cpu-portable.tar.gz linux-vulkan: name: Ubuntu x64 (Vulkan) needs: [check-release, get-version] if: ${{ needs.check-release.outputs.should_release == 'true' }} runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 with: fetch-depth: 0 repository: ${{ inputs.source_repository || github.repository }} ref: ${{ needs.get-version.outputs.source_sha }} - name: Install deps run: sudo apt-get update && sudo apt-get install -y build-essential cmake make glslc libvulkan-dev spirv-headers - name: Configure run: | cmake -S . -B build -DCMAKE_BUILD_TYPE=Release \ -DENGINE_ENABLE_CUDA=OFF -DENGINE_ENABLE_VULKAN=ON \ -DAUDIOCPP_VERSION=${{ needs.get-version.outputs.version }} \ ${{ env.CMAKE_ARGS }} - name: Build run: cmake --build build --config Release --parallel "$(nproc)" --target ${{ env.BUILD_TARGETS }} - name: Stage bundle run: | cp LICENSE build/bin/ 2>/dev/null || true cp -r tools build/bin/tools 2>/dev/null || true cp -r model_specs build/bin/model_specs 2>/dev/null || true - uses: actions/upload-artifact@v4 with: name: audio-${{ needs.get-version.outputs.tag }}-bin-ubuntu-x64-vulkan path: build/bin/* - name: Build and stage C API library run: | cmake -S . -B build -DAUDIOCPP_BUILD_C_API=ON cmake --build build --parallel "$(nproc)" --target audiocpp mkdir -p dist-lib/libs dist-lib/include cp include/audiocpp.h dist-lib/include/ cp LICENSE dist-lib/ find build/bin -maxdepth 1 \( -name '*.so*' -o -name '*.dylib' \) -exec cp -P {} dist-lib/libs/ \; mv build/bin/libaudiocpp* dist-lib/libs/ tar -czf audio-${{ needs.get-version.outputs.tag }}-lib-ubuntu-x64-vulkan.tar.gz -C dist-lib . - uses: actions/upload-artifact@v4 with: name: audio-${{ needs.get-version.outputs.tag }}-lib-ubuntu-x64-vulkan path: audio-${{ needs.get-version.outputs.tag }}-lib-ubuntu-x64-vulkan.tar.gz linux-vulkan-portable: name: Ubuntu x64 (Vulkan portable) needs: [check-release, get-version] if: ${{ needs.check-release.outputs.should_release == 'true' }} runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 with: fetch-depth: 0 repository: ${{ inputs.source_repository || github.repository }} ref: ${{ needs.get-version.outputs.source_sha }} - name: Install deps run: sudo apt-get update && sudo apt-get install -y build-essential cmake make glslc libvulkan-dev spirv-headers - name: Configure run: | cmake -S . -B build -DCMAKE_BUILD_TYPE=Release \ -DENGINE_ENABLE_CUDA=OFF -DENGINE_ENABLE_VULKAN=ON \ -DENGINE_ENABLE_NATIVE_CPU=OFF \ -DENGINE_ENABLE_CPU_ALL_VARIANTS=ON \ -DAUDIOCPP_VERSION=${{ needs.get-version.outputs.version }} \ ${{ env.CMAKE_ARGS }} - name: Build run: cmake --build build --config Release --parallel "$(nproc)" --target ${{ env.BUILD_TARGETS }} - name: Stage bundle run: | cp LICENSE build/bin/ 2>/dev/null || true cp -r tools build/bin/tools 2>/dev/null || true cp -r model_specs build/bin/model_specs 2>/dev/null || true - uses: actions/upload-artifact@v4 with: name: audio-${{ needs.get-version.outputs.tag }}-bin-ubuntu-x64-vulkan-portable path: build/bin/* - name: Build and stage C API library run: | cmake -S . -B build -DAUDIOCPP_BUILD_C_API=ON cmake --build build --parallel "$(nproc)" --target audiocpp mkdir -p dist-lib/libs dist-lib/include cp include/audiocpp.h dist-lib/include/ cp LICENSE dist-lib/ find build/bin -maxdepth 1 \( -name '*.so*' -o -name '*.dylib' \) -exec cp -P {} dist-lib/libs/ \; mv build/bin/libaudiocpp* dist-lib/libs/ tar -czf audio-${{ needs.get-version.outputs.tag }}-lib-ubuntu-x64-vulkan-portable.tar.gz -C dist-lib . - uses: actions/upload-artifact@v4 with: name: audio-${{ needs.get-version.outputs.tag }}-lib-ubuntu-x64-vulkan-portable path: audio-${{ needs.get-version.outputs.tag }}-lib-ubuntu-x64-vulkan-portable.tar.gz linux-cuda-library: name: 'Ubuntu x64 library (CUDA ${{ matrix.label }})' needs: [check-release, get-version] if: ${{ needs.check-release.outputs.should_release == 'true' }} runs-on: ubuntu-latest container: nvidia/cuda:${{ matrix.cuda }}-devel-ubuntu22.04 defaults: run: shell: bash strategy: fail-fast: false matrix: include: - cuda: '12.8.1' label: '12.8' archs: '75;80;86;89;90' - cuda: '13.3.0' label: '13.3' archs: '75;80;86;89;90;120' steps: - uses: actions/checkout@v4 with: fetch-depth: 0 repository: ${{ inputs.source_repository || github.repository }} ref: ${{ needs.get-version.outputs.source_sha }} - name: Install dependencies run: | apt-get update DEBIAN_FRONTEND=noninteractive apt-get install -y software-properties-common add-apt-repository -y ppa:ubuntu-toolchain-r/test apt-get update DEBIAN_FRONTEND=noninteractive apt-get install -y gcc-13 g++-13 cmake ninja-build python3 python-is-python3 - name: Build library env: CC: gcc-13 CXX: g++-13 CUDAHOSTCXX: g++-13 run: | cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release \ "-DCMAKE_CUDA_ARCHITECTURES=${{ matrix.archs }}" \ ${{ matrix.label == '12.8' && '-DGGML_CUDA_NCCL=OFF' || '' }} \ -DENGINE_ENABLE_CUDA=ON -DENGINE_ENABLE_VULKAN=OFF \ -DENGINE_ENABLE_NATIVE_CPU=OFF -DENGINE_BUILD_TESTS=OFF \ -DCMAKE_SHARED_LINKER_FLAGS='-static-libstdc++ -static-libgcc' \ -DCMAKE_INSTALL_RPATH='$ORIGIN' -DCMAKE_BUILD_WITH_INSTALL_RPATH=ON \ -DAUDIOCPP_BUILD_C_API=ON -DAUDIOCPP_DEPLOYMENT_BUILD=ON \ -DENGINE_ENABLE_LLAMAFILE=ON -DENGINE_ENABLE_CUDA_GRAPHS=ON \ -DAUDIOCPP_VERSION=${{ needs.get-version.outputs.version }} cmake --build build --parallel "$(nproc)" --target audiocpp - name: Stage library run: | mkdir -p dist-lib/libs dist-lib/include dist-cudart cp include/audiocpp.h dist-lib/include/ cp LICENSE dist-lib/ cp -P build/bin/libaudiocpp.so* dist-lib/libs/ ldd build/bin/libaudiocpp.so > build/library-dependencies.txt awk '$3 ~ /^\/usr\/local\/cuda/ {print $1, $3}' build/library-dependencies.txt | sort -u | while read -r name path; do cp -L "$path" "dist-cudart/$name"; done cp /usr/share/doc/gcc-13-base/copyright dist-lib/GCC-RUNTIME-LICENSE tar -czf audio-${{ needs.get-version.outputs.tag }}-cudart-ubuntu-x64-cuda${{ matrix.label }}.tar.gz -C dist-cudart . tar -czf audio-${{ needs.get-version.outputs.tag }}-lib-ubuntu-x64-cuda${{ matrix.label }}.tar.gz -C dist-lib . - uses: actions/upload-artifact@v4 with: name: audio-${{ needs.get-version.outputs.tag }}-lib-ubuntu-x64-cuda${{ matrix.label }} path: audio-${{ needs.get-version.outputs.tag }}-lib-ubuntu-x64-cuda${{ matrix.label }}.tar.gz - uses: actions/upload-artifact@v4 with: name: audio-${{ needs.get-version.outputs.tag }}-cudart-ubuntu-x64-cuda${{ matrix.label }} path: audio-${{ needs.get-version.outputs.tag }}-cudart-ubuntu-x64-cuda${{ matrix.label }}.tar.gz linux-cuda-colab: name: Ubuntu x64 (CUDA 12.8, Colab T4) needs: [check-release, get-version] if: ${{ needs.check-release.outputs.should_release == 'true' }} runs-on: ubuntu-latest continue-on-error: true container: nvidia/cuda:12.8.1-devel-ubuntu22.04 env: CC: gcc-13 CXX: g++-13 CUDAHOSTCXX: g++-13 steps: - uses: actions/checkout@v4 with: fetch-depth: 0 repository: ${{ inputs.source_repository || github.repository }} ref: ${{ needs.get-version.outputs.source_sha }} - name: Install dependencies run: | apt-get update -qq DEBIAN_FRONTEND=noninteractive apt-get install -y -qq software-properties-common add-apt-repository -y ppa:ubuntu-toolchain-r/test apt-get update -qq DEBIAN_FRONTEND=noninteractive apt-get install -y -qq gcc-13 g++-13 cmake ninja-build libssl-dev - name: Configure run: | cmake -S . -B build/colab-cuda -G Ninja \ -DCMAKE_BUILD_TYPE=Release \ "-DCMAKE_CUDA_ARCHITECTURES=75;80;86;89;90" \ -DCMAKE_EXE_LINKER_FLAGS='-static-libstdc++ -static-libgcc' \ -DENGINE_ENABLE_CUDA=ON \ -DENGINE_ENABLE_VULKAN=OFF \ -DENGINE_ENABLE_NATIVE_CPU=OFF \ -DENGINE_BUILD_TESTS=OFF \ -DAUDIOCPP_VERSION=${{ needs.get-version.outputs.version }} \ -DAUDIOCPP_DEPLOYMENT_BUILD=ON \ -DAUDIOCPP_BUILD_NATIVE_MODEL_MANAGER=ON \ -DAUDIOCPP_USE_SYSTEM_OPENSSL=ON \ -DENGINE_ENABLE_LLAMAFILE=ON \ -DENGINE_ENABLE_CUDA_GRAPHS=ON - name: Build server run: cmake --build build/colab-cuda --parallel "$(nproc)" --target audiocpp_server - name: Verify portable executable run: | ldd build/colab-cuda/bin/audiocpp_server | tee /tmp/audiocpp_server.ldd if awk '/libcuda\.so\.1/ && /not found/ { next } /not found/ { print; bad=1 } END { exit bad ? 1 : 0 }' /tmp/audiocpp_server.ldd > /tmp/audiocpp_server.bad; then true else echo "::error::The Colab executable has missing runtime dependencies." cat /tmp/audiocpp_server.bad exit 1 fi readelf -d build/colab-cuda/bin/audiocpp_server | tee /tmp/audiocpp_server.needed if grep -E 'Shared library: \[(libstdc\+\+|libgcc_s)\.so' /tmp/audiocpp_server.needed > /tmp/audiocpp_server.direct_bad; then echo "::error::The Colab executable directly depends on non-portable C++ runtime libraries." cat /tmp/audiocpp_server.direct_bad exit 1 fi - name: Stage bundle run: | mkdir -p dist/models install -m 0755 build/colab-cuda/bin/audiocpp_server dist/audiocpp_server install -m 0644 LICENSE dist/LICENSE cp -r tools dist/tools cp -r model_specs dist/model_specs sha256sum dist/audiocpp_server > dist/SHA256SUMS - uses: actions/upload-artifact@v4 with: name: audio-${{ needs.get-version.outputs.tag }}-bin-ubuntu-x64-cuda12.8-colab path: dist/* windows-cpu: name: Windows x64 (CPU) needs: [check-release, get-version] if: ${{ needs.check-release.outputs.should_release == 'true' }} runs-on: windows-2022 steps: - uses: actions/checkout@v4 with: fetch-depth: 0 repository: ${{ inputs.source_repository || github.repository }} ref: ${{ needs.get-version.outputs.source_sha }} - name: Build shell: pwsh run: | .\scripts\build_windows.ps1 -Preset windows-cpu-release -Target audiocpp_cli -DeploymentBuild -NativeModelManager -Version ${{ needs.get-version.outputs.version }} .\scripts\build_windows.ps1 -Preset windows-cpu-release -Target audiocpp_server -DeploymentBuild -NativeModelManager -Version ${{ needs.get-version.outputs.version }} .\scripts\build_windows.ps1 -Preset windows-cpu-release -Target audiocpp_gguf -DeploymentBuild -NativeModelManager -Version ${{ needs.get-version.outputs.version }} - name: Bundle VC runtime shell: pwsh working-directory: build/windows-cpu-release/bin # App-local deployment of the MSVC runtime so the prebuilt binaries run # on clean Windows without a separately installed VC++ Redistributable. # Sizes: vcruntime140* + msvcp140* + vcomp140 ~2 MB (well under 1 MB # compressed), negligible against the CPU/Vulkan/CUDA zip sizes. run: | $vswhere = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" $vs = & $vswhere -latest -property installationPath $redist = Get-ChildItem "$vs\VC\Redist\MSVC" -Directory | Sort-Object { try { [version]$_.Name } catch { [version]'0.0' } } -Descending | Select-Object -First 1 foreach ($sub in 'x64\Microsoft.VC143.CRT', 'x64\Microsoft.VC143.OPENMP') { $dir = Join-Path $redist.FullName $sub if (Test-Path $dir) { Get-ChildItem "$dir\*.dll" | Where-Object { $_.Name -match '^(vcruntime140|msvcp140|vcomp140)' } | Copy-Item -Destination . -ErrorAction SilentlyContinue } } Get-ChildItem *.dll | Select-Object Name | Out-String | Write-Host - name: Stage bundle shell: pwsh working-directory: build/windows-cpu-release/bin run: | cp ..\..\..\LICENSE . 2>$null Copy-Item -Recurse ..\..\..\tools .\tools -ErrorAction SilentlyContinue Copy-Item -Recurse ..\..\..\model_specs .\model_specs -ErrorAction SilentlyContinue - uses: actions/upload-artifact@v4 with: name: audio-${{ needs.get-version.outputs.tag }}-bin-windows-x64-cpu path: build/windows-cpu-release/bin/* - name: Build and stage C API library shell: pwsh run: | $ErrorActionPreference = 'Stop' $vswhere = "${env:ProgramFiles(x86)}/Microsoft Visual Studio/Installer/vswhere.exe" $vs = & $vswhere -latest -property installationPath & "$vs/Common7/Tools/Launch-VsDevShell.ps1" -Arch amd64 -HostArch amd64 -SkipAutomaticLocation cmake -S . -B build/windows-cpu-release -DAUDIOCPP_BUILD_C_API=ON if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } cmake --build build/windows-cpu-release --config Release --parallel $env:NUMBER_OF_PROCESSORS --target audiocpp if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } New-Item -ItemType Directory -Force -Path dist-lib/libs, dist-lib/include | Out-Null Copy-Item include/audiocpp.h dist-lib/include/ Copy-Item LICENSE dist-lib/ Copy-Item build/windows-cpu-release/bin/*.dll dist-lib/libs/ Move-Item build/windows-cpu-release/bin/audiocpp.* dist-lib/libs/ -Force Compress-Archive -Path dist-lib/* -DestinationPath audio-${{ needs.get-version.outputs.tag }}-lib-windows-x64-cpu.zip - uses: actions/upload-artifact@v4 with: name: audio-${{ needs.get-version.outputs.tag }}-lib-windows-x64-cpu path: audio-${{ needs.get-version.outputs.tag }}-lib-windows-x64-cpu.zip windows-cpu-portable: name: Windows x64 (CPU portable) needs: [check-release, get-version] if: ${{ needs.check-release.outputs.should_release == 'true' }} runs-on: windows-2022 steps: - uses: actions/checkout@v4 with: fetch-depth: 0 repository: ${{ inputs.source_repository || github.repository }} ref: ${{ needs.get-version.outputs.source_sha }} - name: Build shell: pwsh run: | .\scripts\build_windows.ps1 -Preset windows-cpu-release -Target audiocpp_cli -DeploymentBuild -NativeModelManager -CpuArch baseline -Llamafile OFF -Version ${{ needs.get-version.outputs.version }} .\scripts\build_windows.ps1 -Preset windows-cpu-release -Target audiocpp_server -DeploymentBuild -NativeModelManager -CpuArch baseline -Llamafile OFF -Version ${{ needs.get-version.outputs.version }} .\scripts\build_windows.ps1 -Preset windows-cpu-release -Target audiocpp_gguf -DeploymentBuild -NativeModelManager -CpuArch baseline -Llamafile OFF -Version ${{ needs.get-version.outputs.version }} - name: Bundle VC runtime shell: pwsh working-directory: build/windows-cpu-release/bin # App-local deployment of the MSVC runtime so the prebuilt binaries run # on clean Windows without a separately installed VC++ Redistributable. # Sizes: vcruntime140* + msvcp140* + vcomp140 ~2 MB (well under 1 MB # compressed), negligible against the CPU/Vulkan/CUDA zip sizes. run: | $vswhere = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" $vs = & $vswhere -latest -property installationPath $redist = Get-ChildItem "$vs\VC\Redist\MSVC" -Directory | Sort-Object { try { [version]$_.Name } catch { [version]'0.0' } } -Descending | Select-Object -First 1 foreach ($sub in 'x64\Microsoft.VC143.CRT', 'x64\Microsoft.VC143.OPENMP') { $dir = Join-Path $redist.FullName $sub if (Test-Path $dir) { Get-ChildItem "$dir\*.dll" | Where-Object { $_.Name -match '^(vcruntime140|msvcp140|vcomp140)' } | Copy-Item -Destination . -ErrorAction SilentlyContinue } } Get-ChildItem *.dll | Select-Object Name | Out-String | Write-Host - name: Stage bundle shell: pwsh working-directory: build/windows-cpu-release/bin run: | cp ..\..\..\LICENSE . 2>$null Copy-Item -Recurse ..\..\..\tools .\tools -ErrorAction SilentlyContinue Copy-Item -Recurse ..\..\..\model_specs .\model_specs -ErrorAction SilentlyContinue - uses: actions/upload-artifact@v4 with: name: audio-${{ needs.get-version.outputs.tag }}-bin-windows-x64-cpu-portable path: build/windows-cpu-release/bin/* - name: Build and stage C API library shell: pwsh run: | $ErrorActionPreference = 'Stop' $vswhere = "${env:ProgramFiles(x86)}/Microsoft Visual Studio/Installer/vswhere.exe" $vs = & $vswhere -latest -property installationPath & "$vs/Common7/Tools/Launch-VsDevShell.ps1" -Arch amd64 -HostArch amd64 -SkipAutomaticLocation cmake -S . -B build/windows-cpu-release -DAUDIOCPP_BUILD_C_API=ON if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } cmake --build build/windows-cpu-release --config Release --parallel $env:NUMBER_OF_PROCESSORS --target audiocpp if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } New-Item -ItemType Directory -Force -Path dist-lib/libs, dist-lib/include | Out-Null Copy-Item include/audiocpp.h dist-lib/include/ Copy-Item LICENSE dist-lib/ Copy-Item build/windows-cpu-release/bin/*.dll dist-lib/libs/ Move-Item build/windows-cpu-release/bin/audiocpp.* dist-lib/libs/ -Force Compress-Archive -Path dist-lib/* -DestinationPath audio-${{ needs.get-version.outputs.tag }}-lib-windows-x64-cpu-portable.zip - uses: actions/upload-artifact@v4 with: name: audio-${{ needs.get-version.outputs.tag }}-lib-windows-x64-cpu-portable path: audio-${{ needs.get-version.outputs.tag }}-lib-windows-x64-cpu-portable.zip windows-vulkan: name: Windows x64 (Vulkan) needs: [check-release, get-version] if: ${{ needs.check-release.outputs.should_release == 'true' }} runs-on: windows-2022 steps: - uses: actions/checkout@v4 with: fetch-depth: 0 repository: ${{ inputs.source_repository || github.repository }} ref: ${{ needs.get-version.outputs.source_sha }} - name: Install Vulkan SDK shell: pwsh run: | curl.exe -o "$env:RUNNER_TEMP\VulkanSDK-Installer.exe" -L "https://sdk.lunarg.com/sdk/download/${env:VULKAN_VERSION}/windows/vulkansdk-windows-X64-${env:VULKAN_VERSION}.exe" & "$env:RUNNER_TEMP\VulkanSDK-Installer.exe" --accept-licenses --default-answer --confirm-command install Add-Content $env:GITHUB_ENV "VULKAN_SDK=C:\\VulkanSDK\\${env:VULKAN_VERSION}" Add-Content $env:GITHUB_PATH "C:\\VulkanSDK\\${env:VULKAN_VERSION}\\bin" - name: Build shell: pwsh run: | .\scripts\build_windows.ps1 -Preset windows-vulkan-release -Target audiocpp_cli -DeploymentBuild -NativeModelManager -Version ${{ needs.get-version.outputs.version }} .\scripts\build_windows.ps1 -Preset windows-vulkan-release -Target audiocpp_server -DeploymentBuild -NativeModelManager -Version ${{ needs.get-version.outputs.version }} .\scripts\build_windows.ps1 -Preset windows-vulkan-release -Target audiocpp_gguf -DeploymentBuild -NativeModelManager -Version ${{ needs.get-version.outputs.version }} - name: Bundle VC runtime shell: pwsh working-directory: build/windows-vulkan-release/bin # App-local deployment of the MSVC runtime (see windows-cpu comments). run: | $vswhere = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" $vs = & $vswhere -latest -property installationPath $redist = Get-ChildItem "$vs\VC\Redist\MSVC" -Directory | Sort-Object { try { [version]$_.Name } catch { [version]'0.0' } } -Descending | Select-Object -First 1 foreach ($sub in 'x64\Microsoft.VC143.CRT', 'x64\Microsoft.VC143.OPENMP') { $dir = Join-Path $redist.FullName $sub if (Test-Path $dir) { Get-ChildItem "$dir\*.dll" | Where-Object { $_.Name -match '^(vcruntime140|msvcp140|vcomp140)' } | Copy-Item -Destination . -ErrorAction SilentlyContinue } } Get-ChildItem *.dll | Select-Object Name | Out-String | Write-Host - name: Stage bundle shell: pwsh working-directory: build/windows-vulkan-release/bin run: | cp ..\..\..\LICENSE . 2>$null Copy-Item -Recurse ..\..\..\tools .\tools -ErrorAction SilentlyContinue Copy-Item -Recurse ..\..\..\model_specs .\model_specs -ErrorAction SilentlyContinue - uses: actions/upload-artifact@v4 with: name: audio-${{ needs.get-version.outputs.tag }}-bin-windows-x64-vulkan path: build/windows-vulkan-release/bin/* - name: Build and stage C API library shell: pwsh run: | $ErrorActionPreference = 'Stop' $vswhere = "${env:ProgramFiles(x86)}/Microsoft Visual Studio/Installer/vswhere.exe" $vs = & $vswhere -latest -property installationPath & "$vs/Common7/Tools/Launch-VsDevShell.ps1" -Arch amd64 -HostArch amd64 -SkipAutomaticLocation cmake -S . -B build/windows-vulkan-release -DAUDIOCPP_BUILD_C_API=ON if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } cmake --build build/windows-vulkan-release --config Release --parallel $env:NUMBER_OF_PROCESSORS --target audiocpp if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } New-Item -ItemType Directory -Force -Path dist-lib/libs, dist-lib/include | Out-Null Copy-Item include/audiocpp.h dist-lib/include/ Copy-Item LICENSE dist-lib/ Copy-Item build/windows-vulkan-release/bin/*.dll dist-lib/libs/ Move-Item build/windows-vulkan-release/bin/audiocpp.* dist-lib/libs/ -Force Compress-Archive -Path dist-lib/* -DestinationPath audio-${{ needs.get-version.outputs.tag }}-lib-windows-x64-vulkan.zip - uses: actions/upload-artifact@v4 with: name: audio-${{ needs.get-version.outputs.tag }}-lib-windows-x64-vulkan path: audio-${{ needs.get-version.outputs.tag }}-lib-windows-x64-vulkan.zip windows-vulkan-portable: name: Windows x64 (Vulkan portable) needs: [check-release, get-version] if: ${{ needs.check-release.outputs.should_release == 'true' }} runs-on: windows-2022 steps: - uses: actions/checkout@v4 with: fetch-depth: 0 repository: ${{ inputs.source_repository || github.repository }} ref: ${{ needs.get-version.outputs.source_sha }} - name: Install Vulkan SDK shell: pwsh run: | curl.exe -o "$env:RUNNER_TEMP\VulkanSDK-Installer.exe" -L "https://sdk.lunarg.com/sdk/download/${env:VULKAN_VERSION}/windows/vulkansdk-windows-X64-${env:VULKAN_VERSION}.exe" & "$env:RUNNER_TEMP\VulkanSDK-Installer.exe" --accept-licenses --default-answer --confirm-command install Add-Content $env:GITHUB_ENV "VULKAN_SDK=C:\\VulkanSDK\\${env:VULKAN_VERSION}" Add-Content $env:GITHUB_PATH "C:\\VulkanSDK\\${env:VULKAN_VERSION}\\bin" - name: Build shell: pwsh run: | .\scripts\build_windows.ps1 -Preset windows-vulkan-release -ConfigureOnly -DeploymentBuild -NativeModelManager -CpuArch baseline -Llamafile OFF -Version ${{ needs.get-version.outputs.version }} if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } # The existing baseline preset disables AVX; also remove the remaining # optional x86 extensions for this new portable target only. cmake -S . -B build/windows-vulkan-release -DGGML_SSE42=OFF -DGGML_BMI2=OFF if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } cmake --build build/windows-vulkan-release --config Release --parallel $env:NUMBER_OF_PROCESSORS --target ($env:BUILD_TARGETS -split ' ') if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } - name: Bundle VC runtime shell: pwsh working-directory: build/windows-vulkan-release/bin # App-local deployment of the MSVC runtime (see windows-cpu comments). run: | $vswhere = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" $vs = & $vswhere -latest -property installationPath $redist = Get-ChildItem "$vs\VC\Redist\MSVC" -Directory | Sort-Object { try { [version]$_.Name } catch { [version]'0.0' } } -Descending | Select-Object -First 1 foreach ($sub in 'x64\Microsoft.VC143.CRT', 'x64\Microsoft.VC143.OPENMP') { $dir = Join-Path $redist.FullName $sub if (Test-Path $dir) { Get-ChildItem "$dir\*.dll" | Where-Object { $_.Name -match '^(vcruntime140|msvcp140|vcomp140)' } | Copy-Item -Destination . -ErrorAction SilentlyContinue } } Get-ChildItem *.dll | Select-Object Name | Out-String | Write-Host - name: Stage bundle shell: pwsh working-directory: build/windows-vulkan-release/bin run: | cp ..\..\..\LICENSE . 2>$null Copy-Item -Recurse ..\..\..\tools .\tools -ErrorAction SilentlyContinue Copy-Item -Recurse ..\..\..\model_specs .\model_specs -ErrorAction SilentlyContinue - uses: actions/upload-artifact@v4 with: name: audio-${{ needs.get-version.outputs.tag }}-bin-windows-x64-vulkan-portable path: build/windows-vulkan-release/bin/* - name: Build and stage C API library shell: pwsh run: | $ErrorActionPreference = 'Stop' $vswhere = "${env:ProgramFiles(x86)}/Microsoft Visual Studio/Installer/vswhere.exe" $vs = & $vswhere -latest -property installationPath & "$vs/Common7/Tools/Launch-VsDevShell.ps1" -Arch amd64 -HostArch amd64 -SkipAutomaticLocation cmake -S . -B build/windows-vulkan-release -DAUDIOCPP_BUILD_C_API=ON if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } cmake --build build/windows-vulkan-release --config Release --parallel $env:NUMBER_OF_PROCESSORS --target audiocpp if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } New-Item -ItemType Directory -Force -Path dist-lib/libs, dist-lib/include | Out-Null Copy-Item include/audiocpp.h dist-lib/include/ Copy-Item LICENSE dist-lib/ Copy-Item build/windows-vulkan-release/bin/*.dll dist-lib/libs/ Move-Item build/windows-vulkan-release/bin/audiocpp.* dist-lib/libs/ -Force Compress-Archive -Path dist-lib/* -DestinationPath audio-${{ needs.get-version.outputs.tag }}-lib-windows-x64-vulkan-portable.zip - uses: actions/upload-artifact@v4 with: name: audio-${{ needs.get-version.outputs.tag }}-lib-windows-x64-vulkan-portable path: audio-${{ needs.get-version.outputs.tag }}-lib-windows-x64-vulkan-portable.zip windows-cuda: name: 'Windows x64 (CUDA ${{ matrix.label }})' needs: [check-release, get-version] if: ${{ needs.check-release.outputs.should_release == 'true' }} runs-on: windows-2022 strategy: fail-fast: false matrix: include: - cuda: '12.4.1' label: '12.4' cuda_archs: '61-virtual;70;75;80;86;89;90' - cuda: '13.3.0' label: '13.3' cuda_archs: '75;80;86;89;90;120' steps: - uses: actions/checkout@v4 with: fetch-depth: 0 repository: ${{ inputs.source_repository || github.repository }} ref: ${{ needs.get-version.outputs.source_sha }} - name: Install CUDA build tools uses: Jimver/cuda-toolkit@v0.2.36 with: cuda: ${{ matrix.cuda }} method: 'local' - name: Configure + Build (OpenMP off) shell: cmd # Direct CMake (bypasses build_windows.ps1, which hard-requires OpenMP and # asserts under the CUDA toolchain). OpenMP off matches llama.cpp's CUDA # path. vcvarsall.bat puts cl.exe on PATH for nvcc. # # ENGINE_ENABLE_CPU_ALL_VARIANTS flips BUILD_SHARED_LIBS=ON + # GGML_BACKEND_DL=ON (audio.cpp/CMakeLists.txt), building the CUDA backend # once as ggml-cuda.dll and keeping cli/server/gguf as thin shells that # load backends at runtime -- the same distribution model llama.cpp uses. # CUDA kernels are no longer duplicated into 3 executables. # # CMAKE_CUDA_ARCHITECTURES must be pinned: audio.cpp defaults to # "native" (the build host GPU), which is meaningless on GPU-less CI # runners and yields an unreliable CUDA fatbin. Use fixed arch lists per # toolkit so the released binaries carry correct kernels for the # supported GPUs (RTX 20/30/40/50-series and datacenter-class). The # value is quoted so the ';' separators survive cmd's tokenizer. run: | call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64 >nul cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release ^ -DENGINE_ENABLE_CUDA=ON -DENGINE_ENABLE_OPENMP=OFF -DGGML_OPENMP=OFF ^ -DENGINE_ENABLE_CUDA_GRAPHS=ON -DENGINE_ENABLE_VULKAN=OFF -DENGINE_ENABLE_METAL=OFF ^ -DENGINE_ENABLE_LLAMAFILE=ON -DENGINE_ENABLE_NATIVE_CPU=ON -DENGINE_BUILD_TESTS=OFF ^ -DENGINE_ENABLE_CPU_ALL_VARIANTS=ON ^ "-DCMAKE_CUDA_ARCHITECTURES=${{ matrix.cuda_archs }}" ^ -DAUDIOCPP_VERSION=${{ needs.get-version.outputs.version }} ^ -DAUDIOCPP_DEPLOYMENT_BUILD=ON -DAUDIOCPP_BUILD_NATIVE_MODEL_MANAGER=ON -DCUDAToolkit_ROOT="%CUDA_PATH%" cmake --build build --config Release -j %NUMBER_OF_PROCESSORS% --target ${{ env.BUILD_TARGETS }} - name: Bundle CUDA runtime shell: pwsh # llama.cpp copies the runtime DLLs from every candidate dir without # looking at robocopy's exit code: bin\x64 is a CUDA 13 layout, so on # CUDA 12.x robocopy returns 16 for that missing dir, which is benign # (llama's step ends on the successful 7z). Mirror that here -- copy # from whichever dir exists and terminate on exit 0. The trailing guard # only trips if NO cudart was copied at all (a broken/empty toolkit). # cufft64_*.dll is included because engine_runtime links CUDA::cufft # for its CUDA inverse-STFT kernel (CMakeLists.txt). # # Staged outside build/bin so the bin artifact stays free of the heavy # runtime DLLs; the cudart artifact is uploaded separately below. run: | $dst = "build\cudart" New-Item -ItemType Directory -Force -Path $dst | Out-Null $dlls = "cudart64_*.dll", "cublas64_*.dll", "cublasLt64_*.dll", "cufft64_*.dll" robocopy "$env:CUDA_PATH\bin" $dst $dlls robocopy "$env:CUDA_PATH\lib" $dst $dlls robocopy "$env:CUDA_PATH\bin\x64" $dst $dlls if (-not (Get-ChildItem -Path $dst -Filter 'cudart64_*.dll' -ErrorAction SilentlyContinue)) { Write-Error "CUDA runtime DLLs were not found under $env:CUDA_PATH" exit 1 } exit 0 - name: Bundle VC runtime shell: pwsh working-directory: build/bin # App-local deployment of the MSVC runtime (see windows-cpu comments). # The CUDA build disables OpenMP, so vcomp140 is not needed - only the # CRT DLLs for the host-side /MD runtime. run: | $vswhere = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" $vs = & $vswhere -latest -property installationPath $redist = Get-ChildItem "$vs\VC\Redist\MSVC" -Directory | Sort-Object { try { [version]$_.Name } catch { [version]'0.0' } } -Descending | Select-Object -First 1 $dir = Join-Path $redist.FullName 'x64\Microsoft.VC143.CRT' if (Test-Path $dir) { Get-ChildItem "$dir\*.dll" | Where-Object { $_.Name -match '^(vcruntime140|msvcp140)' } | Copy-Item -Destination . -ErrorAction SilentlyContinue } Get-ChildItem *.dll | Select-Object Name | Out-String | Write-Host - name: Stage bundle shell: pwsh working-directory: build/bin run: | cp ..\..\LICENSE . 2>$null Copy-Item -Recurse ..\..\tools .\tools -ErrorAction SilentlyContinue Copy-Item -Recurse ..\..\model_specs .\model_specs -ErrorAction SilentlyContinue - uses: actions/upload-artifact@v4 with: name: audio-${{ needs.get-version.outputs.tag }}-bin-windows-x64-cuda${{ matrix.label }} path: build/bin/* - uses: actions/upload-artifact@v4 with: name: audio-${{ needs.get-version.outputs.tag }}-cudart-windows-x64-cuda${{ matrix.label }} path: build/cudart/* - name: Build and stage C API library shell: pwsh run: | $ErrorActionPreference = 'Stop' $vswhere = "${env:ProgramFiles(x86)}/Microsoft Visual Studio/Installer/vswhere.exe" $vs = & $vswhere -latest -property installationPath & "$vs/Common7/Tools/Launch-VsDevShell.ps1" -Arch amd64 -HostArch amd64 -SkipAutomaticLocation cmake -S . -B build -DAUDIOCPP_BUILD_C_API=ON if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } cmake --build build --config Release --parallel $env:NUMBER_OF_PROCESSORS --target audiocpp if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } New-Item -ItemType Directory -Force -Path dist-lib/libs, dist-lib/include | Out-Null Copy-Item include/audiocpp.h dist-lib/include/ Copy-Item LICENSE dist-lib/ Copy-Item build/bin/*.dll dist-lib/libs/ Move-Item build/bin/audiocpp.* dist-lib/libs/ -Force Compress-Archive -Path dist-lib/* -DestinationPath audio-${{ needs.get-version.outputs.tag }}-lib-windows-x64-cuda${{ matrix.label }}.zip - uses: actions/upload-artifact@v4 with: name: audio-${{ needs.get-version.outputs.tag }}-lib-windows-x64-cuda${{ matrix.label }} path: audio-${{ needs.get-version.outputs.tag }}-lib-windows-x64-cuda${{ matrix.label }}.zip hip: name: HIP test binaries (best-effort) needs: [check-release, get-version] if: ${{ needs.check-release.outputs.should_release == 'true' }} permissions: contents: read actions: read uses: ./.github/workflows/release-hip.yml with: source_repository: ${{ inputs.source_repository || github.repository }} source_sha: ${{ needs.get-version.outputs.source_sha }} version: ${{ needs.get-version.outputs.tag }} release: name: Create release needs: - check-release - get-version - server-config-examples - macos-metal - linux-cpu - linux-cpu-portable - linux-vulkan - linux-vulkan-portable - windows-cpu - windows-cpu-portable - windows-vulkan - windows-cuda - linux-cuda-colab - linux-cuda-library - windows-vulkan-portable # Wait for any HIP artifacts, but do not require success, like Colab. - hip if: >- ${{ always() && needs.check-release.outputs.should_release == 'true' && (github.ref_type == 'tag' || inputs.publish) && needs.get-version.result == 'success' && needs.server-config-examples.result == 'success' && needs.macos-metal.result == 'success' && needs.linux-cpu.result == 'success' && needs.linux-cpu-portable.result == 'success' && needs.linux-vulkan.result == 'success' && needs.linux-vulkan-portable.result == 'success' && needs.windows-cpu.result == 'success' && needs.windows-cpu-portable.result == 'success' && needs.windows-vulkan.result == 'success' && needs.windows-cuda.result == 'success' && needs.linux-cuda-library.result == 'success' && needs.windows-vulkan-portable.result == 'success' }} runs-on: ubuntu-latest permissions: contents: write steps: - uses: actions/checkout@v4 with: fetch-depth: 0 repository: ${{ inputs.source_repository || github.repository }} ref: ${{ needs.get-version.outputs.source_sha }} - name: Download artifacts uses: actions/download-artifact@v4 with: path: release-assets pattern: '{audio-*,hip-release-*}' # Each artifact downloads into release-assets// holding the raw # bundle (binaries + tools/ + model_specs/). Archive per platform here so # the release ships the same zip/tar.gz layout as before; artifact names # already match the final asset basenames. - name: Create release archives run: | set -euo pipefail if ! command -v zip >/dev/null; then sudo apt-get update sudo apt-get install -y zip fi cd release-assets for d in */; do name="${d%/}" echo "Packing ${name}" case "$name" in hip-release-*) # HIP archives are prepacked to preserve executable permissions. find "$d" -maxdepth 1 -type f \( -name '*.tar.gz' -o -name '*.zip' \) -exec mv {} . \; ;; *-lib-*|*-cudart-ubuntu-*|*-server-config-examples) mv "$d"* . ;; *windows*) (cd "$d" && zip -qqr "../${name}.zip" .) ;; *) # upload-artifact drops file modes; restore the executable bit chmod +x "$d"audiocpp_* (cd "$d" && tar -czf "../${name}.tar.gz" .) ;; esac done rm -rf -- */ ls -la - name: Create and push git tag run: | TAG="${{ needs.get-version.outputs.tag }}" if git rev-parse -q --verify "refs/tags/${TAG}" >/dev/null 2>&1; then echo "Tag ${TAG} already exists, skipping creation" else git tag "${TAG}" git push origin "${TAG}" fi - name: Check for existing release id: relstate run: | TAG="${{ needs.get-version.outputs.tag }}" if gh release view "$TAG" --repo "$GITHUB_REPOSITORY" >/dev/null 2>&1; then echo "exists=true" >> "$GITHUB_OUTPUT" else echo "exists=false" >> "$GITHUB_OUTPUT" fi # Existing release (e.g. one the maintainer drafted and published): # attach the built binaries only, preserving its pre-release flag and # hand-written notes. --clobber allows rebuilding the same version. - name: Upload binaries to existing release if: ${{ steps.relstate.outputs.exists == 'true' }} run: | gh release upload "${{ needs.get-version.outputs.tag }}" release-assets/*.zip release-assets/*.tar.gz --clobber --repo "$GITHUB_REPOSITORY" # Newly-created tag with no release yet: create the release w/ notes. - name: Create release if: ${{ steps.relstate.outputs.exists != 'true' }} run: | gh release create "${{ needs.get-version.outputs.tag }}" release-assets/*.zip release-assets/*.tar.gz --title "${{ needs.get-version.outputs.tag }}" --generate-notes --repo "$GITHUB_REPOSITORY"