diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index df7dfb9..94c23aa 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -10,7 +10,10 @@ on: jobs: validate_build: name: Validate Build - runs-on: windows-latest + runs-on: windows-2022 + env: + VCPKG_DEFAULT_BINARY_CACHE: ${{ github.workspace }}\vcpkg_cache + strategy: matrix: config: [ debug, release ] @@ -28,15 +31,16 @@ jobs: - name: Restore vcpkg cache uses: actions/cache@v4 with: - path: ${{ github.workspace }}/extern/vcpkg/packages + path: | + ${{ env.VCPKG_DEFAULT_BINARY_CACHE }} + vcpkg_installed/ key: vcpkg-${{ runner.os }}-${{ hashFiles('**/vcpkg.json', '**/vcpkg-configuration.json') }} restore-keys: | vcpkg-${{ runner.os }}- - - name: Setup VS environment - uses: ilammy/msvc-dev-cmd@v1 - with: - arch: x64 + - name: Create vcpkg cache directory + shell: pwsh + run: New-Item -Path "${{ env.VCPKG_DEFAULT_BINARY_CACHE }}" -ItemType Directory -Force - name: Build ${{ matrix.config }} run: | @@ -52,8 +56,11 @@ jobs: create_release: name: Create Release with MSI - runs-on: windows-latest + runs-on: windows-2022 if: startsWith(github.ref, 'refs/tags/v') + env: + VCPKG_DEFAULT_BINARY_CACHE: ${{ github.workspace }}\vcpkg_cache + needs: validate_build permissions: @@ -73,15 +80,16 @@ jobs: - name: Restore vcpkg cache uses: actions/cache@v4 with: - path: ${{ github.workspace }}/extern/vcpkg/packages + path: | + ${{ env.VCPKG_DEFAULT_BINARY_CACHE }} + vcpkg_installed/ key: vcpkg-${{ runner.os }}-${{ hashFiles('**/vcpkg.json', '**/vcpkg-configuration.json') }} restore-keys: | vcpkg-${{ runner.os }}- - - name: Setup VS environment - uses: ilammy/msvc-dev-cmd@v1 - with: - arch: x64 + - name: Create vcpkg cache directory + shell: pwsh + run: New-Item -Path "${{ env.VCPKG_DEFAULT_BINARY_CACHE }}" -ItemType Directory -Force - name: Install WiX v6 Toolset from MSI shell: pwsh