[vcpkg-docs] Add note about GitHub hosted agents (#13641)

* [vcpkg_docs] Add note about GitHub hosted agents

* [vcpkg-docs] Add ./ prefixes to GitHub example

Co-authored-by: Robert Schumacher <roschuma@microsoft.com>
This commit is contained in:
ras0219 2020-09-27 17:52:09 -07:00 committed by GitHub
parent 794f4c0a5a
commit c98fd09290
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 2 deletions

View File

@ -14,6 +14,10 @@ If your CI system of choice is not listed, we welcome PRs to add them!
To use vcpkg with GitHub Packages, we recommend using the `NuGet` backend.
>**NOTE 2020-09-21**: GitHub's hosted agents come with an older, pre-installed copy of vcpkg on the path that does not support the latest binary caching. This means that direct calls to `bootstrap-vcpkg` or `vcpkg` without a path prefix may call an unintended vcpkg instance. We recommend taking the following two steps to avoid issues if you want to use your own copy of vcpkg:
> 1. Run the equivalent of `rm -rf "$VCPKG_INSTALLATION_ROOT"` using `shell: 'bash'`
> 2. Always call `vcpkg` and `bootstrap-vcpkg` with a path prefix, such as `./vcpkg`, `vcpkg/vcpkg`, `.\bootstrap-vcpkg.bat`, etc
```yaml
# actions.yaml
#
@ -38,7 +42,7 @@ steps:
shell: 'bash'
# Replace <OWNER> with your organization name
run: >
${{ matrix.mono }} `vcpkg/vcpkg fetch nuget | tail -n 1`
${{ matrix.mono }} `./vcpkg/vcpkg fetch nuget | tail -n 1`
sources add
-source "https://nuget.pkg.github.com/<OWNER>/index.json"
-storepasswordincleartext
@ -50,7 +54,7 @@ steps:
- name: 'vcpkg package restore'
shell: 'bash'
run: >
vcpkg/vcpkg install sqlite3 cpprestsdk --triplet ${{ matrix.triplet }}
./vcpkg/vcpkg install sqlite3 cpprestsdk --triplet ${{ matrix.triplet }}
```
If you're using [manifests](../specifications/manifests.md), you can omit the `vcpkg package restore` step: it will be run automatically as part of your build.