Fix Windows CI for MSVC 195 on windows-latest
Some checks failed
Windows Release / windows-x86_64 (push) Has been cancelled

Generate a win-ci Conan host profile from the runner-detected MSVC
version instead of pinning 194 (VS 17), which is missing on current
GitHub-hosted images.
This commit is contained in:
copilot 2026-10-04 20:18:33 +02:00
parent c33392db5b
commit 97b136de3b
3 changed files with 59 additions and 7 deletions

View file

@ -37,10 +37,26 @@ jobs:
python -m pip install --upgrade pip
python -m pip install "conan>=2,<3"
conan --version
# Fresh runners have no default profile; host==build for MSVC.
if (-not (Test-Path "$env:USERPROFILE\.conan2\profiles\default")) {
conan profile detect --force
}
# Fresh runners: detect MSVC (windows-latest is currently 195 / VS 18).
conan profile detect --force
$default = Join-Path $env:USERPROFILE ".conan2\profiles\default"
$verLine = Select-String -Path $default -Pattern 'compiler.version=' | Select-Object -First 1
$msvcVer = ($verLine.Line -split '=')[1].Trim()
if (-not $msvcVer) { throw "could not read compiler.version from default profile" }
# Host profile matching the runner (repo win-x86_64 still pins 194 for local Tower).
$p = Join-Path $env:USERPROFILE ".conan2\profiles\win-ci"
@"
[settings]
arch=x86_64
build_type=Release
compiler=msvc
compiler.cppstd=23
compiler.runtime=dynamic
compiler.version=$msvcVer
os=Windows
"@.Trim() | Set-Content -Path $p -Encoding ascii
Write-Host "win-ci MSVC version=$msvcVer"
Get-Content $p
- name: Resolve version
id: ver
@ -61,7 +77,9 @@ jobs:
- name: Build Windows x86_64
shell: cmd
run: |
call windowsinstall\conan_init_x86_64.bat
call .\conan\export_libs.bat
if errorlevel 1 exit /b 1
conan install . -of=build-x86_64 --build=missing -pr:h=win-ci -pr:b=default
if errorlevel 1 exit /b 1
call windowsinstall\build_x86_64.bat
if errorlevel 1 exit /b 1

View file

@ -13,10 +13,14 @@ File: `.github/workflows/windows_release.yml`
| | |
|---|---|
| Trigger | every push to `main`, plus `workflow_dispatch` |
| Runner | `windows-latest` (GitHub-hosted) |
| Build | `windowsinstall/conan_init_x86_64.bat` + `build_x86_64.bat` |
| Runner | `windows-latest` (GitHub-hosted, MSVC ~195) |
| Build | Conan profile `win-ci` (detected) + `windowsinstall/build_x86_64.bat` |
| Output | prerelease tag **`windows-continuous`** with a portable zip |
Local Tower Windows can keep using `windowsinstall/conan_init_x86_64.bat`
(`conan/profiles/win-x86_64`, MSVC 194). CI generates a `win-ci` profile for
whatever MSVC `windows-latest` ships.
## GitHub remote
Recommended remote name: `github`

View file

@ -0,0 +1,30 @@
#!/usr/bin/env bash
# Install a built InfiniPaint binary from this repo into ~/.local
set -euo pipefail
ROOT="$(cd "$(dirname "$0")/.." && pwd)"
BIN="${1:-$ROOT/build/Release/infinipaint}"
PREFIX="${HOME}/.local"
APPDIR="${PREFIX}/share/infinipaint"
[[ -x "$BIN" ]] || { echo "missing binary: $BIN" >&2; exit 1; }
mkdir -p "$APPDIR" "${PREFIX}/bin" "${PREFIX}/share/applications"
install -m755 "$BIN" "${APPDIR}/infinipaint"
rm -rf "${APPDIR}/data"
cp -a "${ROOT}/assets/data" "${APPDIR}/data"
ln -sfn "${APPDIR}/infinipaint" "${PREFIX}/bin/infinipaint"
cat > "${PREFIX}/share/applications/com.infinipaint.infinipaint-fork.desktop" <<EOF
[Desktop Entry]
Name=InfiniPaint (fork)
Comment=Infinite collaborative canvas (copilot fork)
Exec=${PREFIX}/bin/infinipaint
Icon=com.infinipaint.infinipaint
Terminal=false
Type=Application
Categories=Graphics;
EOF
echo "Installed: ${PREFIX}/bin/infinipaint"
# GUI binary may abort without a working GL context; do not fail install.
"${PREFIX}/bin/infinipaint" --version >/dev/null 2>&1 || true