-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use GitHub Actions Cache support in
vcpkg
- Loading branch information
1 parent
7b26ea9
commit ed03fe1
Showing
1 changed file
with
6 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,35 +15,20 @@ jobs: | |
PLATFORM: ${{ matrix.platform }} | ||
BUILD_CONFIGURATION: Release | ||
SOLUTION_FILE_PATH: . | ||
VCPKG_BINARY_SOURCES: 'clear;nuget,GitHub,readwrite' | ||
VCPKG_BINARY_SOURCES: 'clear;x-gha,readwrite' | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Add MSBuild to PATH | ||
uses: microsoft/[email protected] | ||
|
||
- name: Setup NuGet credentials | ||
shell: bash | ||
run: | | ||
$(vcpkg fetch nuget | tail -n1) \ | ||
sources add \ | ||
-source "https://nuget.pkg.github.com/lairworks/index.json" \ | ||
-storepasswordincleartext \ | ||
-name "GitHub" \ | ||
-username "lairworks" \ | ||
-password "${{ secrets.GITHUB_TOKEN }}" | ||
$(vcpkg fetch nuget | tail -n1) \ | ||
setApiKey "${{ secrets.GITHUB_TOKEN }}" \ | ||
-source "https://nuget.pkg.github.com/lairworks/index.json" | ||
- name: Restore vcpkg dependency cache | ||
uses: actions/cache@v4 | ||
id: cache | ||
- name: Export GitHub Actions cache environment variables | ||
uses: actions/github-script@v7 | ||
with: | ||
path: vcpkg_installed | ||
key: ${{ runner.os }}-${{ matrix.platform }}-${{ hashFiles('vcpkg.json') }} | ||
script: | | ||
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || ''); | ||
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || ''); | ||
- name: Restore incremental build cache | ||
uses: actions/cache/restore@v4 | ||
|