Skip to content

Commit

Permalink
Use GitHub Actions Cache support in vcpkg
Browse files Browse the repository at this point in the history
  • Loading branch information
DanRStevens committed Nov 27, 2024
1 parent 7b26ea9 commit ed03fe1
Showing 1 changed file with 6 additions and 21 deletions.
27 changes: 6 additions & 21 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit ed03fe1

Please sign in to comment.