Skip to content

Commit

Permalink
Update external project to use gha vcpkg cache
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonbeverage committed Oct 28, 2024
1 parent 0520629 commit 18c1435
Showing 1 changed file with 9 additions and 17 deletions.
26 changes: 9 additions & 17 deletions .github/workflows/external.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: windows-external-project
on: [push, workflow_dispatch]

env:
VCPKG_BINARY_SOURCES : 'clear;nuget,GitHub,readwrite'
VCPKG_BINARY_SOURCES : "clear;x-gha,readwrite"
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Release
VCPKG_VERSION: 'master'
Expand All @@ -27,29 +27,21 @@ jobs:
with:
submodules: recursive

- 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: Cloning vcpkg main branch (windows)
shell: 'bash'
run: |
cmake -E make_directory ${{ matrix.VCPKG_WORKSPACE }}
cd ${{ matrix.VCPKG_WORKSPACE }}
git clone https://github.com/microsoft/vcpkg
./vcpkg/bootstrap-vcpkg.bat -disableMetrics
${{ matrix.VCPKG_WORKSPACE }}/vcpkg/vcpkg version
- name: 'Setup NuGet Credentials'
working-directory: ${{ matrix.VCPKG_WORKSPACE }}
shell: 'bash'
run: |
${{ matrix.mono }} `./vcpkg/vcpkg fetch nuget | tail -n 1` \
sources add \
-source "https://nuget.pkg.github.com/${{ github.actor }}/index.json" \
-storepasswordincleartext \
-name "GitHub" \
-username "${{ github.actor }}" \
-password "${{ secrets.GITHUB_TOKEN }}"
${{ matrix.mono }} `./vcpkg/vcpkg fetch nuget | tail -n 1` \
setapikey "${{ secrets.GITHUB_TOKEN }}" \
-source "https://nuget.pkg.github.com/${{ github.actor }}/index.json"
${{ matrix.VCPKG_WORKSPACE }}/vcpkg/vcpkg version
- name: Create Build Environment
run: |
Expand Down

0 comments on commit 18c1435

Please sign in to comment.