hex/.github/workflows/check-windows.yml
Dax f9ab7b5a9c
Security: sign Linux releases, lock the installers, vendor the release client, pin actions and download hosts (#370)
From the 2026-10-29 security review:
- H1: Release signs each Linux executable with Anomaly's ed25519 key (HEX_RELEASE_SIGNING_KEY, .github/release/sign-linux.sh, which refuses a key that does not match linux-signing.pub) and publishes the signature as the linux-<arch>-sig target. The updater (updater/linux.rs SIGNING_KEY) and install-linux.sh refuse an executable without a valid signature over its SHA-256, before downloading it. Installed builds that predate this ignore the extra target, so the transition needs nothing from them.
- H3: the installers move to the locked .github/release/ (CODEOWNERS @thdxr); the Installers workflow publishes them from a sparse checkout of that directory.
- M1: the release service client is vendored as .github/release/release-client.sh instead of piping anoma.ly/release/client.sh into bash.
- M2: check-windows.yml gets permissions: contents: read; every third-party action is pinned by SHA.
- M3: resolve_url accepts only URLs on the manifest's host.
2026-10-29 11:06:30 -04:00

101 lines
4.3 KiB
YAML

name: Check Windows
on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
push:
branches: [dev]
workflow_dispatch:
permissions:
contents: read
# A new push to a pull request cancels its stale run. Every push and manual run
# keeps its own group, so each dev commit gets a result.
concurrency:
group: ${{ github.event_name == 'pull_request' && format('{0}-pr-{1}', github.workflow, github.event.pull_request.number) || format('{0}-run-{1}', github.workflow, github.run_id) }}
cancel-in-progress: true
jobs:
x64:
name: x64 (Vulkan)
if: ${{ !github.event.pull_request.draft }}
runs-on: windows-latest
timeout-minutes: 90
env:
# Portable CPU kernels: without this, ggml tunes to the runner's CPU.
TRANSCRIBE_CMAKE_ARGS: -DGGML_NATIVE=OFF
steps:
- uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 # v5
- uses: dtolnay/rust-toolchain@b725eda525362e7cf34af9a7243cac1e3f01a7ec # stable
with:
toolchain: stable
components: clippy, rustfmt
- uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2
- uses: taiki-e/install-action@86f7a0ffb25f40114606501a311ebcfaf882ea32 # v2
with:
tool: cargo-nextest
- name: Install the Vulkan SDK
uses: humbletim/install-vulkan-sdk@30ba978f977e81b72d091fc8888feb1fb26f9aff # v1.2
with:
version: 1.4.309.0
cache: true
- name: Install SPIRV-Headers for the Vulkan backend
shell: pwsh
run: |
vcpkg install spirv-headers:x64-windows
if ($LASTEXITCODE -ne 0) { throw "vcpkg install spirv-headers failed" }
$prefix = "$env:VCPKG_INSTALLATION_ROOT/installed/x64-windows" -replace '\\','/'
$combined = if ($env:CMAKE_PREFIX_PATH) { "$prefix;$env:CMAKE_PREFIX_PATH" } else { $prefix }
Add-Content $env:GITHUB_ENV "CMAKE_PREFIX_PATH=$combined"
- run: cargo fmt --check
- run: cargo clippy --release --all-targets -- -D warnings
- run: cargo nextest run --release --profile ci
- run: cargo build --locked --release
- name: Check the executable needs no Visual C++ Redistributable
shell: pwsh
run: |
$dumpbin = Get-ChildItem "${env:ProgramFiles}\Microsoft Visual Studio" -Recurse -Filter dumpbin.exe -ErrorAction SilentlyContinue |
Where-Object { $_.FullName -match 'Hostx64\\x64' } | Select-Object -First 1
$imports = & $dumpbin.FullName /dependents target\release\hex.exe
$redist = $imports | Select-String -Pattern 'VCRUNTIME|MSVCP|vcomp'
if ($redist) { throw "hex.exe imports Visual C++ runtime DLLs: $redist" }
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: hex-windows-x86_64
path: target/release/hex.exe
arm64:
name: ARM64 (CPU)
if: ${{ !github.event.pull_request.draft }}
runs-on: windows-11-arm
timeout-minutes: 90
env:
# ggml's ARM CPU backend refuses MSVC, so the native core builds with
# clang-cl through Ninja (the cmake crate takes the compiler from CC/CXX).
# clang-cl's /openmp needs an LLVM OpenMP runtime, and ggml's own
# threadpool is correct under LLVM codegen, so OpenMP stays off.
CC: clang-cl
CXX: clang-cl
CMAKE_C_COMPILER: clang-cl
CMAKE_CXX_COMPILER: clang-cl
CMAKE_C_COMPILER_TARGET: aarch64-pc-windows-msvc
CMAKE_CXX_COMPILER_TARGET: aarch64-pc-windows-msvc
CMAKE_GENERATOR: Ninja
CL: /EHsc
TRANSCRIBE_CMAKE_ARGS: -DGGML_NATIVE=OFF -DGGML_OPENMP=OFF
steps:
- uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 # v5
- uses: dtolnay/rust-toolchain@b725eda525362e7cf34af9a7243cac1e3f01a7ec # stable
with:
toolchain: stable
- uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2
- uses: taiki-e/install-action@86f7a0ffb25f40114606501a311ebcfaf882ea32 # v2
with:
tool: cargo-nextest
- run: cargo nextest run --release --profile ci
- run: cargo build --locked --release
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: hex-windows-aarch64
path: target/release/hex.exe