From 361276fd08c5a066145eea1ad23ccadbda118a70 Mon Sep 17 00:00:00 2001 From: briaguya <70942617+briaguya0@users.noreply.github.com> Date: Thu, 30 Jul 2026 14:11:47 -0400 Subject: Use our own vcpkg root on Windows instead of the runner's (#240) --- .github/workflows/windows_build.yml | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/.github/workflows/windows_build.yml b/.github/workflows/windows_build.yml index 3daccd3..4819b62 100644 --- a/.github/workflows/windows_build.yml +++ b/.github/workflows/windows_build.yml @@ -28,13 +28,21 @@ jobs: standalone: OFF steps: - uses: actions/checkout@v4 + - name: Cache vcpkg + uses: actions/cache@v4 + with: + key: ${{ runner.os }}-vcpkg-x64-windows-static-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-vcpkg-x64-windows-static- + path: D:/a/vcpkg - name: Build Visual Studio if: ${{ matrix.generate == 'Visual Studio 17 2022' }} + env: + VCPKG_ROOT: D:/a/vcpkg run: | # Enable the viewer in CI (BUILD_UI is off by default), except on Win32: - # libultraship is x64-only. Its automate-vcpkg bootstraps the runner's - # vcpkg to fetch SDL2/GLEW/libzip/nlohmann-json/tinyxml2/spdlog. - $env:VCPKG_ROOT=$env:VCPKG_INSTALLATION_ROOT + # libultraship is x64-only. Its automate-vcpkg bootstraps vcpkg to + # fetch SDL2/GLEW/libzip/nlohmann-json/tinyxml2/spdlog. cmake -S . -B "build/${{ matrix.arch }}" -G "${{ matrix.generate }}" -DCMAKE_TOOLCHAIN_FILE="cmake/toolchain/${{ matrix.toolchain }}.cmake" -DCMAKE_GENERATOR_PLATFORM=${{ matrix.arch }} -DCMAKE_BUILD_TYPE:STRING=${{ matrix.config }} -DUSE_STANDALONE=${{ matrix.standalone }} -DBUILD_UI=${{ matrix.arch == 'Win32' && 'OFF' || 'ON' }} -DUSE_AUTO_VCPKG=ON -DVCPKG_TARGET_TRIPLET=x64-windows-static # Multi-config generator: pass --config, else it builds Debug and the # Release artifact path below finds nothing. @@ -46,11 +54,12 @@ jobs: arch: ${{ matrix.arch }} - name: Build Ninja if: ${{ matrix.generate == 'Ninja' }} + env: + VCPKG_ROOT: D:/a/vcpkg run: | # Enable the viewer in CI, off on Win32 (libultraship is x64-only). Ninja # is single-platform, so name the vcpkg triplet explicitly (there is no # CMAKE_VS_PLATFORM_NAME for automate-vcpkg to key off). - $env:VCPKG_ROOT=$env:VCPKG_INSTALLATION_ROOT cmake -S . -B "build/${{ matrix.arch }}" -G "${{ matrix.generate }}" -DCMAKE_TOOLCHAIN_FILE="cmake/toolchain/${{ matrix.toolchain }}.cmake" -DCMAKE_BUILD_TYPE:STRING=${{ matrix.config }} -DUSE_STANDALONE=${{ matrix.standalone }} -DBUILD_UI=${{ matrix.arch == 'Win32' && 'OFF' || 'ON' }} -DUSE_AUTO_VCPKG=ON -DVCPKG_TARGET_TRIPLET=x64-windows-static cmake --build ./build/${{ matrix.arch }} - name: Publish packaged artifacts -- cgit v1.2.3