Skip to content

Commit c063de3

Browse files
committed
Give vcpkg github as a binary source
1 parent 0c17e06 commit c063de3

File tree

1 file changed

+14
-7
lines changed

1 file changed

+14
-7
lines changed

.github/workflows/steamkit2-build.yaml

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,9 @@ jobs:
103103
nethook2:
104104
name: NetHook2 - ${{ matrix.platform }} - ${{ matrix.configuration }}
105105

106+
permissions:
107+
contents: write
108+
106109
strategy:
107110
matrix:
108111
configuration: [ Debug, Release ]
@@ -111,21 +114,25 @@ jobs:
111114

112115
runs-on: windows-2022
113116

117+
# https://learn.microsoft.com/en-us/vcpkg/consume/binary-caching-github-actions-cache
118+
env:
119+
VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite"
120+
114121
steps:
115122
- uses: actions/checkout@v4
116123
with:
117124
submodules: recursive
118125

126+
- name: Add cache environment variables
127+
uses: actions/github-script@v6
128+
with:
129+
script: |
130+
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
131+
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
132+
119133
- name: Add MSBuild to PATH
120134
uses: microsoft/setup-msbuild@v2
121135

122-
- name: Cache vcpkg
123-
id: cache-dependencies
124-
uses: actions/cache@v4
125-
with:
126-
path: Resources/NetHook2/NetHook2/vcpkg_installed
127-
key: vcpkg-${{ matrix.platform }}-${{ matrix.configuration }}-${{ hashFiles('Resources/NetHook2/NetHook2/vcpkg.json') }}
128-
129136
- name: Configure Dependencies
130137
run: pwsh -File Resources/NetHook2/SetupDependencies.ps1
131138

0 commit comments

Comments
 (0)