Repository navigation
tag_name #72
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Release | |
| on: | |
| workflow_dispatch: # allows manual triggering | |
| inputs: | |
| create_release: | |
| description: 'Create new release' | |
| required: true | |
| type: boolean | |
| push: | |
| branches: | |
| - master | |
| paths: [ | |
| '.github/workflows/release.yml', | |
| '**/CMakeLists.txt', | |
| '**/.cmake', | |
| '**/*.h', | |
| '**/*.hpp', | |
| '**/*.c', | |
| '**/*.cpp', | |
| '**/*.cu', | |
| '**/*.cuh', | |
| '**/*.swift', | |
| '**/*.m', | |
| '**/*.metal', | |
| '**/*.comp', | |
| '**/*.glsl' | |
| ] | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| BRANCH_NAME: ${{ github.head_ref || github.ref_name }} | |
| CMAKE_ARGS: "-DLLAMA_BUILD_EXAMPLES=OFF -DLLAMA_BUILD_TESTS=OFF -DLLAMA_BUILD_TOOLS=ON -DLLAMA_BUILD_SERVER=ON -DGGML_RPC=ON" | |
| # note: run this workflow one at a time for better cache reuse | |
| concurrency: | |
| group: release | |
| queue: max | |
| jobs: | |
| check-release: | |
| runs-on: ubuntu-slim | |
| outputs: | |
| should_release: ${{ steps.check.outputs.should_release }} | |
| tag_name: ${{ steps.tag.outputs.name }} | |
| steps: | |
| - id: check | |
| env: | |
| COMMIT_MESSAGE: ${{ github.event.head_commit.message }} | |
| run: | | |
| if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then | |
| echo "should_release=true" >> $GITHUB_OUTPUT | |
| elif [[ "${{ github.event_name }}" == "push" && "${{ github.ref }}" == "refs/heads/master" ]]; then | |
| if echo "$COMMIT_MESSAGE" | grep -q '\[no release\]'; then | |
| echo "should_release=false" >> $GITHUB_OUTPUT | |
| else | |
| echo "should_release=true" >> $GITHUB_OUTPUT | |
| fi | |
| else | |
| echo "should_release=false" >> $GITHUB_OUTPUT | |
| fi | |
| - name: Clone | |
| if: ${{ steps.check.outputs.should_release == 'true' }} | |
| id: checkout | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: Determine tag name | |
| if: ${{ steps.check.outputs.should_release == 'true' }} | |
| id: tag | |
| uses: ./.github/actions/get-tag-name | |
| - name: Create and push git tag | |
| if: ${{ steps.check.outputs.should_release == 'true' }} | |
| run: | | |
| TAG="${{ steps.tag.outputs.name }}" | |
| 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 | |
| macos-cpu: | |
| needs: [check-release, ui-build] | |
| if: ${{ needs.check-release.outputs.should_release == 'true' }} | |
| strategy: | |
| matrix: | |
| include: | |
| - build: 'arm64' | |
| arch: 'arm64' | |
| os: macos-26 | |
| defines: "-DGGML_METAL_EMBED_LIBRARY=ON -DCMAKE_OSX_DEPLOYMENT_TARGET=13.3" | |
| # TODO: this build is disabled to save Github Actions resources (https://github.com/ggml-org/llama.cpp/pull/23780) | |
| # in order to enable it again, we have to provision dedicated runners to run it | |
| #- build: 'arm64-kleidiai' | |
| # arch: 'arm64' | |
| # os: macos-14 | |
| # defines: "-DGGML_METAL_EMBED_LIBRARY=ON -DCMAKE_OSX_DEPLOYMENT_TARGET=13.3 -DGGML_CPU_KLEIDIAI=ON" | |
| - build: 'x64' | |
| arch: 'x64' | |
| os: macos-15-intel | |
| # Metal is disabled on x64 due to intermittent failures with Github runners not having a GPU: | |
| # https://github.com/ggml-org/llama.cpp/actions/runs/8635935781/job/23674807267#step:5:2313 | |
| defines: "-DGGML_METAL=OFF -DCMAKE_OSX_DEPLOYMENT_TARGET=13.3" | |
| runs-on: ${{ matrix.os }} | |
| permissions: | |
| actions: write | |
| steps: | |
| - name: Clone | |
| id: checkout | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: Download UI build | |
| uses: actions/download-artifact@v8 | |
| with: | |
| name: llama-ui.zip | |
| path: tools/ui/dist | |
| - name: ccache | |
| uses: ggml-org/ccache-action@v1.2.24 | |
| with: | |
| key: release-${{ matrix.os }}-${{ matrix.arch }} | |
| evict-old-files: 1d | |
| - name: Build | |
| id: cmake_build | |
| run: | | |
| sysctl -a | |
| cmake -B build \ | |
| ${{ matrix.defines }} \ | |
| -DCMAKE_INSTALL_RPATH='@loader_path' \ | |
| -DCMAKE_BUILD_WITH_INSTALL_RPATH=ON \ | |
| -DLLAMA_FATAL_WARNINGS=ON \ | |
| -DLLAMA_BUILD_BORINGSSL=ON \ | |
| ${{ env.CMAKE_ARGS }} | |
| cmake --build build --config Release -j $(sysctl -n hw.logicalcpu) | |
| - name: Determine tag name | |
| id: tag | |
| uses: ./.github/actions/get-tag-name | |
| - name: Pack artifacts | |
| id: pack_artifacts | |
| run: | | |
| cp LICENSE ./build/bin/ | |
| tar -czvf llama-${{ needs.check-release.outputs.tag_name }}-bin-macos-${{ matrix.build }}.tar.gz -s ",^\.,llama-${{ needs.check-release.outputs.tag_name }}," -C ./build/bin . | |
| - name: Upload artifacts | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| path: llama-${{ needs.check-release.outputs.tag_name }}-bin-macos-${{ matrix.build }}.tar.gz | |
| archive: false | |
| - name: ccache-clear | |
| uses: ./.github/actions/ccache-clear | |
| with: | |
| key: release-${{ matrix.os }}-${{ matrix.arch }} | |
| ubuntu-cpu: | |
| needs: [check-release, ui-build] | |
| if: ${{ needs.check-release.outputs.should_release == 'true' }} | |
| strategy: | |
| matrix: | |
| include: | |
| - build: 'x64' | |
| os: ubuntu-22.04 | |
| - build: 'arm64' | |
| os: ubuntu-24.04-arm | |
| runs-on: ${{ matrix.os }} | |
| permissions: | |
| actions: write | |
| steps: | |
| - name: Clone | |
| id: checkout | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: Download UI build | |
| uses: actions/download-artifact@v8 | |
| with: | |
| name: llama-ui.zip | |
| path: tools/ui/dist | |
| - name: Dependencies | |
| id: depends | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install build-essential libssl-dev | |
| - name: Toolchain workaround (GCC 14) | |
| if: ${{ contains(matrix.os, 'ubuntu-24.04') }} | |
| run: | | |
| sudo apt-get install -y gcc-14 g++-14 | |
| echo "CC=gcc-14" >> "$GITHUB_ENV" | |
| echo "CXX=g++-14" >> "$GITHUB_ENV" | |
| - name: ccache | |
| if: ${{ matrix.build != 's390x' }} | |
| uses: ggml-org/ccache-action@v1.2.24 | |
| with: | |
| key: release-${{ matrix.os }}-cpu | |
| evict-old-files: 1d | |
| - name: Build | |
| id: cmake_build | |
| run: | | |
| cmake -B build \ | |
| -DCMAKE_INSTALL_RPATH='$ORIGIN' \ | |
| -DCMAKE_BUILD_WITH_INSTALL_RPATH=ON \ | |
| -DGGML_BACKEND_DL=ON \ | |
| -DGGML_NATIVE=OFF \ | |
| -DGGML_CPU_ALL_VARIANTS=ON \ | |
| -DLLAMA_FATAL_WARNINGS=ON \ | |
| ${{ env.CMAKE_ARGS }} | |
| cmake --build build --config Release -j $(nproc) | |
| - name: Determine tag name | |
| id: tag | |
| uses: ./.github/actions/get-tag-name | |
| - name: Pack artifacts | |
| id: pack_artifacts | |
| run: | | |
| cp LICENSE ./build/bin/ | |
| tar -czvf llama-${{ needs.check-release.outputs.tag_name }}-bin-ubuntu-${{ matrix.build }}.tar.gz --transform "s,^\.,llama-${{ needs.check-release.outputs.tag_name }}," -C ./build/bin . | |
| - name: Upload artifacts | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| path: llama-${{ needs.check-release.outputs.tag_name }}-bin-ubuntu-${{ matrix.build }}.tar.gz | |
| archive: false | |
| - name: ccache-clear | |
| if: ${{ matrix.build != 's390x' }} | |
| uses: ./.github/actions/ccache-clear | |
| with: | |
| key: release-${{ matrix.os }}-cpu | |
| ubuntu-vulkan: | |
| needs: [check-release, ui-build] | |
| if: ${{ needs.check-release.outputs.should_release == 'true' }} | |
| strategy: | |
| matrix: | |
| include: | |
| - build: 'x64' | |
| os: ubuntu-22.04 | |
| - build: 'arm64' | |
| os: ubuntu-24.04-arm | |
| runs-on: ${{ matrix.os }} | |
| permissions: | |
| actions: write | |
| steps: | |
| - name: Clone | |
| id: checkout | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: Download UI build | |
| uses: actions/download-artifact@v8 | |
| with: | |
| name: llama-ui.zip | |
| path: tools/ui/dist | |
| - name: Dependencies | |
| id: depends | |
| run: | | |
| if [[ "${{ matrix.os }}" =~ "ubuntu-22.04" ]]; then | |
| wget -qO - https://packages.lunarg.com/lunarg-signing-key-pub.asc | sudo apt-key add - | |
| sudo wget -qO /etc/apt/sources.list.d/lunarg-vulkan-jammy.list https://packages.lunarg.com/vulkan/lunarg-vulkan-jammy.list | |
| sudo apt-get update -y | |
| sudo apt-get install -y build-essential mesa-vulkan-drivers vulkan-sdk libssl-dev | |
| else | |
| sudo apt-get update -y | |
| sudo apt-get install -y gcc-14 g++-14 build-essential glslc libvulkan-dev spirv-headers libssl-dev ninja-build | |
| echo "CC=gcc-14" >> "$GITHUB_ENV" | |
| echo "CXX=g++-14" >> "$GITHUB_ENV" | |
| fi | |
| - name: ccache | |
| uses: ggml-org/ccache-action@v1.2.24 | |
| with: | |
| key: release-${{ matrix.os }}-vulkan | |
| evict-old-files: 1d | |
| - name: Build | |
| id: cmake_build | |
| run: | | |
| cmake -B build \ | |
| -DCMAKE_INSTALL_RPATH='$ORIGIN' \ | |
| -DCMAKE_BUILD_WITH_INSTALL_RPATH=ON \ | |
| -DGGML_BACKEND_DL=ON \ | |
| -DGGML_NATIVE=OFF \ | |
| -DGGML_CPU_ALL_VARIANTS=ON \ | |
| -DGGML_VULKAN=ON \ | |
| ${{ env.CMAKE_ARGS }} | |
| cmake --build build --config Release -j $(nproc) | |
| - name: Determine tag name | |
| id: tag | |
| uses: ./.github/actions/get-tag-name | |
| - name: Pack artifacts | |
| id: pack_artifacts | |
| run: | | |
| cp LICENSE ./build/bin/ | |
| tar -czvf llama-${{ needs.check-release.outputs.tag_name }}-bin-ubuntu-vulkan-${{ matrix.build }}.tar.gz --transform "s,^\.,llama-${{ needs.check-release.outputs.tag_name }}," -C ./build/bin . | |
| - name: Upload artifacts | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| path: llama-${{ needs.check-release.outputs.tag_name }}-bin-ubuntu-vulkan-${{ matrix.build }}.tar.gz | |
| archive: false | |
| - name: ccache-clear | |
| uses: ./.github/actions/ccache-clear | |
| with: | |
| key: release-${{ matrix.os }}-vulkan | |
| windows-cpu: | |
| name: windows-cpu / ${{ matrix.arch }} | |
| needs: [check-release, ui-build] | |
| if: ${{ needs.check-release.outputs.should_release == 'true' }} | |
| runs-on: windows-2025-vs2026 | |
| permissions: | |
| actions: write | |
| strategy: | |
| matrix: | |
| include: | |
| - arch: 'x64' | |
| - arch: 'arm64' | |
| steps: | |
| - name: Clone | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: Download UI build | |
| uses: actions/download-artifact@v8 | |
| with: | |
| name: llama-ui.zip | |
| path: tools/ui/dist | |
| - name: Install Ninja | |
| run: | | |
| choco install ninja | |
| - name: ccache | |
| uses: ggml-org/ccache-action@v1.2.24 | |
| with: | |
| key: release-windows-2025-vs2026-${{ matrix.arch }}-cpu | |
| evict-old-files: 1d | |
| - name: Build | |
| shell: cmd | |
| run: | | |
| call "C:\Program Files\Microsoft Visual Studio\18\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" ${{ matrix.arch == 'x64' && 'x64' || 'amd64_arm64' }} | |
| cmake -S . -B build -G "Ninja Multi-Config" ^ | |
| -D CMAKE_TOOLCHAIN_FILE=cmake/${{ matrix.arch }}-windows-llvm.cmake ^ | |
| -DLLAMA_BUILD_BORINGSSL=ON ^ | |
| -DGGML_NATIVE=OFF ^ | |
| -DGGML_BACKEND_DL=ON ^ | |
| -DGGML_CPU_ALL_VARIANTS=${{ matrix.arch == 'x64' && 'ON' || 'OFF' }} ^ | |
| -DGGML_OPENMP=ON ^ | |
| -DGGML_OPENMP_FETCH=ON ^ | |
| ${{ env.CMAKE_ARGS }} | |
| cmake --build build --config Release | |
| - name: Pack artifacts | |
| id: pack_artifacts | |
| run: | | |
| 7z a -snl llama-bin-win-cpu-${{ matrix.arch }}.zip .\build\bin\Release\* | |
| - name: Upload artifacts | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| path: llama-bin-win-cpu-${{ matrix.arch }}.zip | |
| archive: false | |
| - name: ccache-clear | |
| uses: ./.github/actions/ccache-clear | |
| with: | |
| key: release-windows-2025-vs2026-${{ matrix.arch }}-cpu | |
| # note: builds only the backend library - llama-server (with the embedded UI) | |
| # is injected from the windows-cpu zip during the release "Merge artifacts" step | |
| windows: | |
| needs: [check-release] | |
| if: ${{ needs.check-release.outputs.should_release == 'true' }} | |
| runs-on: windows-2025 | |
| permissions: | |
| actions: write | |
| env: | |
| OPENBLAS_VERSION: 0.3.23 | |
| VULKAN_VERSION: 1.4.357.0 | |
| strategy: | |
| matrix: | |
| include: | |
| - backend: 'vulkan' | |
| arch: 'x64' | |
| defines: '-DGGML_VULKAN=ON' | |
| target: 'ggml-vulkan' | |
| - backend: 'opencl-adreno' | |
| arch: 'arm64' | |
| defines: '-G "Ninja Multi-Config" -D CMAKE_TOOLCHAIN_FILE=cmake/arm64-windows-llvm.cmake -DCMAKE_PREFIX_PATH="$env:RUNNER_TEMP/opencl-arm64-release" -DGGML_OPENCL=ON -DGGML_OPENCL_USE_ADRENO_KERNELS=ON' | |
| target: 'ggml-opencl' | |
| steps: | |
| - name: Clone | |
| id: checkout | |
| uses: actions/checkout@v6 | |
| - name: Install Vulkan SDK | |
| id: get_vulkan | |
| if: ${{ matrix.backend == 'vulkan' }} | |
| 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: Install Ninja | |
| id: install_ninja | |
| run: | | |
| choco install ninja | |
| # TODO: these jobs need to use llvm toolchain in order to utilize the ccache | |
| #- name: ccache | |
| # uses: ggml-org/ccache-action@v1.2.24 | |
| # with: | |
| # key: release-windows-2025-${{ matrix.arch }}-${{ matrix.backend }} | |
| # evict-old-files: 1d | |
| - name: Install OpenCL Headers and Libs | |
| id: install_opencl | |
| if: ${{ matrix.backend == 'opencl-adreno' && matrix.arch == 'arm64' }} | |
| run: | | |
| git clone https://github.com/KhronosGroup/OpenCL-Headers | |
| cd OpenCL-Headers | |
| cmake -B build ` | |
| -DBUILD_TESTING=OFF ` | |
| -DOPENCL_HEADERS_BUILD_TESTING=OFF ` | |
| -DOPENCL_HEADERS_BUILD_CXX_TESTS=OFF ` | |
| -DCMAKE_INSTALL_PREFIX="$env:RUNNER_TEMP/opencl-arm64-release" | |
| cmake --build build --target install | |
| git clone https://github.com/KhronosGroup/OpenCL-ICD-Loader | |
| cd OpenCL-ICD-Loader | |
| cmake -B build-arm64-release ` | |
| -A arm64 ` | |
| -DCMAKE_PREFIX_PATH="$env:RUNNER_TEMP/opencl-arm64-release" ` | |
| -DCMAKE_INSTALL_PREFIX="$env:RUNNER_TEMP/opencl-arm64-release" | |
| cmake --build build-arm64-release --target install --config release | |
| - name: Build | |
| id: cmake_build | |
| run: | | |
| cmake -S . -B build ${{ matrix.defines }} -DGGML_NATIVE=OFF -DGGML_CPU=OFF -DGGML_BACKEND_DL=ON -DLLAMA_BUILD_BORINGSSL=ON | |
| cmake --build build --config Release --target ${{ matrix.target }} | |
| #- name: ccache-clear | |
| # uses: ./.github/actions/ccache-clear | |
| # with: | |
| # key: release-windows-2025-${{ matrix.arch }}-${{ matrix.backend }} | |
| - name: Pack artifacts | |
| id: pack_artifacts | |
| run: | | |
| 7z a -snl llama-bin-win-${{ matrix.backend }}-${{ matrix.arch }}.zip .\build\bin\Release\${{ matrix.target }}.dll | |
| - name: Upload artifacts | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| path: llama-bin-win-${{ matrix.backend }}-${{ matrix.arch }}.zip | |
| archive: false | |
| ui-build: | |
| needs: [check-release] | |
| if: ${{ needs.check-release.outputs.should_release == 'true' }} | |
| uses: ./.github/workflows/ui-build.yml |