-
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.
Merge pull request #1177 from lairworks/vcpkgGitHubActionsCache
Use `vcpkg` GitHub Actions Cache support
- Loading branch information
Showing
1 changed file
with
8 additions
and
16 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,27 @@ 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: Export GitHub Actions cache environment variables | ||
uses: actions/github-script@v7 | ||
with: | ||
script: | | ||
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || ''); | ||
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || ''); | ||
- name: Restore vcpkg dependency cache | ||
uses: actions/cache@v4 | ||
id: cache | ||
with: | ||
path: vcpkg_installed | ||
key: ${{ runner.os }}-${{ matrix.platform }}-${{ hashFiles('vcpkg.json') }} | ||
key: vcpkgCache-${{ runner.os }}-${{ matrix.platform }}-${{ hashFiles('vcpkg.json') }} | ||
|
||
- name: Restore incremental build cache | ||
uses: actions/cache/restore@v4 | ||
|