Skip to content

Add options to skip builds for different OS #18

Add options to skip builds for different OS

Add options to skip builds for different OS #18

Workflow file for this run

name: Build & Release Binaries

Check failure on line 1 in .github/workflows/release.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/release.yml

Invalid workflow file

(Line: 35, Col: 9): Unrecognized named-value: 'matrix'. Located at position 2 within expression: !matrix.exclude
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
skip_linux:
description: 'Skip Linux build'
required: false
type: boolean
default: false
skip_mac:
description: 'Skip macOS build'
required: false
type: boolean
default: false
skip_windows:
description: 'Skip Windows build'
required: false
type: boolean
default: false
permissions:
contents: write
jobs:
build:
name: Build · ${{ matrix.name }}
runs-on: ${{ matrix.os }}
if: ${{ !matrix.exclude }}
strategy:
fail-fast: false
matrix:
include:
- name: linux-x64
os: ubuntu-22.04
cmake_flags: -DGGML_BLAS=ON
apt_extra: pkg-config libopenblas-dev
install_cuda: true
install_vulkan: true
exclude: ${{ inputs.skip_linux || false }}
- name: macos-arm64-metal
os: macos-latest
exclude: ${{ inputs.skip_mac || false }}
- name: windows-x64
os: windows-latest
install_cuda: true
install_vulkan: true
exclude: ${{ inputs.skip_mac || false }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- 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 || '' }}
- name: ccache
if: runner.os != 'Windows'
uses: hendrikmuhs/ccache-action@v1.2
with:
create-symlink: true
key: ${{ github.job }}-${{ matrix.os }}
- name: Install CUDA toolkit
uses: Jimver/cuda-toolkit@v0.2.30
if: matrix.install_cuda == true
with:
log-file-suffix: '${{matrix.os}}.txt'
- name: Install Vulkan SDK
if: matrix.install_vulkan == true
uses: humbletim/install-vulkan-sdk@v1.2
with:
version: 1.4.309.0
cache: true
- name: Configure & Build (Linux / macOS)
if: runner.os == 'Linux'
run: |
./buildall.sh
- name: Configure & Build (Linux / macOS)
if: runner.os == 'macOS'
run: |
mkdir build
cd build
cmake ..
cmake --build . --config Release -j "$(nproc)"
- name: Configure & Build (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: |
New-Item -ItemType Directory -Path build | Out-Null
Set-Location build
cmake -B build-msvc -DGGML_CPU_ALL_VARIANTS=ON -DGGML_CUDA=ON -DGGML_VULKAN=ON -DGGML_BACKEND_DL=ON
cmake --build build-msvc --config Release -j $env:NUMBER_OF_PROCESSORS
- 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-lm$EXT" 2>&1 | head -5
"$BIN/ace-synth$EXT" 2>&1 | head -5
"$BIN/ace-understand$EXT" 2>&1 | head -5
"$BIN/neural-codec$EXT" 2>&1 | head -5
"$BIN/quantize$EXT" 2>&1 | head -3
"$BIN/mp3-codec$EXT" 2>&1 | head -3
- 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
- name: Package binaries (Linux)
if: runner.os == 'Linux'
run: |
mkdir -p dist
cp build/ace-* \
build/quantize build/neural-codec build/mp3-codec build/*.so dist/
tar -C dist -czf "acestep-${{ matrix.name }}.tar.gz" .
- name: Package binaries (macOS)
if: runner.os == 'macOS'
run: |
mkdir -p dist
cd build
for bin in ace-* quantize neural-codec mp3-codec; do
install_name_tool -add_rpath @executable_path "$bin"
done
cp -P ace-* quantize neural-codec mp3-codec libacestep*.a libggml*.dylib ../dist/
cd ..
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
Copy-Item "build\Release\*.exe" dist\ -ErrorAction SilentlyContinue
Copy-Item "build\Release\*.dll" dist\ -ErrorAction SilentlyContinue
Compress-Archive -Path dist\* -DestinationPath "acestep-${{ matrix.name }}.zip"
- 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