Skip to content

Commit 8b8a9fb

Browse files
authored
Fix build workflow (#89)
1 parent f517230 commit 8b8a9fb

1 file changed

Lines changed: 20 additions & 12 deletions

File tree

.github/workflows/build.yml

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,10 @@ on:
1010
jobs:
1111
validate_build:
1212
name: Validate Build
13-
runs-on: windows-latest
13+
runs-on: windows-2022
14+
env:
15+
VCPKG_DEFAULT_BINARY_CACHE: ${{ github.workspace }}\vcpkg_cache
16+
1417
strategy:
1518
matrix:
1619
config: [ debug, release ]
@@ -28,15 +31,16 @@ jobs:
2831
- name: Restore vcpkg cache
2932
uses: actions/cache@v4
3033
with:
31-
path: ${{ github.workspace }}/extern/vcpkg/packages
34+
path: |
35+
${{ env.VCPKG_DEFAULT_BINARY_CACHE }}
36+
vcpkg_installed/
3237
key: vcpkg-${{ runner.os }}-${{ hashFiles('**/vcpkg.json', '**/vcpkg-configuration.json') }}
3338
restore-keys: |
3439
vcpkg-${{ runner.os }}-
3540
36-
- name: Setup VS environment
37-
uses: ilammy/msvc-dev-cmd@v1
38-
with:
39-
arch: x64
41+
- name: Create vcpkg cache directory
42+
shell: pwsh
43+
run: New-Item -Path "${{ env.VCPKG_DEFAULT_BINARY_CACHE }}" -ItemType Directory -Force
4044

4145
- name: Build ${{ matrix.config }}
4246
run: |
@@ -52,8 +56,11 @@ jobs:
5256

5357
create_release:
5458
name: Create Release with MSI
55-
runs-on: windows-latest
59+
runs-on: windows-2022
5660
if: startsWith(github.ref, 'refs/tags/v')
61+
env:
62+
VCPKG_DEFAULT_BINARY_CACHE: ${{ github.workspace }}\vcpkg_cache
63+
5764
needs: validate_build
5865

5966
permissions:
@@ -73,15 +80,16 @@ jobs:
7380
- name: Restore vcpkg cache
7481
uses: actions/cache@v4
7582
with:
76-
path: ${{ github.workspace }}/extern/vcpkg/packages
83+
path: |
84+
${{ env.VCPKG_DEFAULT_BINARY_CACHE }}
85+
vcpkg_installed/
7786
key: vcpkg-${{ runner.os }}-${{ hashFiles('**/vcpkg.json', '**/vcpkg-configuration.json') }}
7887
restore-keys: |
7988
vcpkg-${{ runner.os }}-
8089
81-
- name: Setup VS environment
82-
uses: ilammy/msvc-dev-cmd@v1
83-
with:
84-
arch: x64
90+
- name: Create vcpkg cache directory
91+
shell: pwsh
92+
run: New-Item -Path "${{ env.VCPKG_DEFAULT_BINARY_CACHE }}" -ItemType Directory -Force
8593

8694
- name: Install WiX v6 Toolset from MSI
8795
shell: pwsh

0 commit comments

Comments
 (0)