Skip to content

Commit 990aeb1

Browse files
authored
Merge pull request #1469 from OutpostUniverse/vcpkgGhaCacheBinary
Use `vcpkg` GitHub Actions Cache support
2 parents f872c1c + 0ba638b commit 990aeb1

File tree

2 files changed

+9
-17
lines changed

2 files changed

+9
-17
lines changed

.github/workflows/build.yml

+8-16
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
PLATFORM: ${{ matrix.platform }}
1616
BUILD_CONFIGURATION: Release
1717
SOLUTION_FILE_PATH: .
18-
VCPKG_BINARY_SOURCES: 'clear;nuget,GitHub,readwrite'
18+
VCPKG_BINARY_SOURCES: 'clear;x-gha,readwrite'
1919

2020
steps:
2121
- uses: actions/checkout@v4
@@ -26,27 +26,19 @@ jobs:
2626
- name: Add MSBuild to PATH
2727
uses: microsoft/setup-msbuild@v1.3.2
2828

29-
- name: Setup NuGet credentials
30-
shell: bash
31-
run: |
32-
$(vcpkg fetch nuget | tail -n1) \
33-
sources add \
34-
-source "https://nuget.pkg.github.com/OutpostUniverse/index.json" \
35-
-storepasswordincleartext \
36-
-name "GitHub" \
37-
-username "OutpostUniverse" \
38-
-password "${{ secrets.GITHUB_TOKEN }}"
39-
40-
$(vcpkg fetch nuget | tail -n1) \
41-
setApiKey "${{ secrets.GITHUB_TOKEN }}" \
42-
-source "https://nuget.pkg.github.com/OutpostUniverse/index.json"
29+
- name: Export GitHub Actions cache environment variables
30+
uses: actions/github-script@v7
31+
with:
32+
script: |
33+
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
34+
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
4335
4436
- name: Restore vcpkg dependency cache
4537
uses: actions/cache@v4
4638
id: cache
4739
with:
4840
path: vcpkg_installed
49-
key: ${{ runner.os }}-${{ matrix.platform }}-${{ hashFiles('vcpkg.json') }}
41+
key: vcpkgCache-${{ runner.os }}-${{ matrix.platform }}-${{ hashFiles('vcpkg.json') }}
5042

5143
- name: Build
5244
# Add additional options to the MSBuild command line here (like platform or verbosity level).

0 commit comments

Comments
 (0)