Give the release workflow CMake when the runner has none on its path

This commit is contained in:
CRTkafa 2026-10-20 04:03:12 +07:00
parent 7f63f5415c
commit 705828e012

View file

@ -23,6 +23,17 @@ jobs:
ref: ${{ inputs.ref }} ref: ${{ inputs.ref }}
# Full history, so a short commit id resolves too. # Full history, so a short commit id resolves too.
fetch-depth: 0 fetch-depth: 0
# sherpa-onnx builds with CMake. The runner's own copy if it has one, else Kitware's portable
# build, pinned by hash, unpacked into the job's folder (nothing is installed on the runner).
- name: CMake
run: |
if command -v cmake >/dev/null; then cmake --version; exit 0; fi
vs=$(ls -d "/c/Program Files"*"/Microsoft Visual Studio/2022/"*"/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/bin" 2>/dev/null | head -1 || true)
if [ -n "$vs" ] && [ -x "$vs/cmake.exe" ]; then echo "$vs" >> "$GITHUB_PATH"; "$vs/cmake.exe" --version; exit 0; fi
curl -sSLfo cmake.zip https://github.com/Kitware/CMake/releases/download/v3.31.8/cmake-3.31.8-windows-x86_64.zip
echo "81aa9964dbabd71fe02e7ec50472fd3ad56138c49944515ece9001efbff8d719 cmake.zip" | sha256sum -c -
unzip -q cmake.zip -d "$RUNNER_TEMP" && rm cmake.zip
echo "$(cygpath -w "$RUNNER_TEMP/cmake-3.31.8-windows-x86_64/bin")" >> "$GITHUB_PATH"
- name: Build the installer, path-free - name: Build the installer, path-free
run: | run: |
bun install bun install