-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: replace vcpkg-action with simpler setup-vcpkg
johnwason/vcpkg-action depends on various other actions that are now out-of-date and is using deprecated NodeJS 16. Given that vcpkg configuration and bootstrap is very simple, replace our usage with a simpler homemade setup-vcpkg instead.
- Loading branch information
Showing
2 changed files
with
78 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 |
---|---|---|
@@ -0,0 +1,62 @@ | ||
name: Setup vcpkg | ||
description: Clone and setup vcpkg | ||
inputs: | ||
triplet: | ||
description: Specify the target triplet | ||
required: false | ||
host-triplet: | ||
description: Specify the host triplet | ||
required: false | ||
overlay-triplets: | ||
description: Additional directories to search to triplets, one entry per line | ||
required: false | ||
revision: | ||
description: The revision of the vcpkg registry to be used | ||
required: false | ||
|
||
runs: | ||
using: composite | ||
|
||
steps: | ||
- name: Clone vcpkg | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: microsoft/vcpkg | ||
ref: ${{ inputs.revision }} | ||
filter: tree:0 | ||
path: vcpkg | ||
|
||
- name: Setup environment variables | ||
uses: actions/github-script@v7 | ||
with: | ||
script: | | ||
// Configuration for GitHub Actions cache | ||
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || ''); | ||
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || ''); | ||
// vcpkg configuration | ||
const path = require('node:path'); | ||
const vcpkg_root = path.join(process.env.GITHUB_WORKSPACE, 'vcpkg'); | ||
core.exportVariable('VCPKG_ROOT', vcpkg_root); | ||
core.addPath(vcpkg_root); | ||
core.exportVariable('VCPKG_BINARY_SOURCES', 'clear;x-gha,readwrite'); | ||
const triplet = process.env.AINPUT_TRIPLET; | ||
if (triplet) { | ||
core.exportVariable('VCPKG_DEFAULT_TRIPLET', triplet); | ||
} | ||
const hostTriplet = process.env.AINPUT_HOST_TRIPLET; | ||
if (hostTriplet) { | ||
core.exportVariable('VCPKG_DEFAULT_HOST_TRIPLET', hostTriplet); | ||
} | ||
const tripletOverlays = process.env.AINPUT_OVERLAY_TRIPLETS?.replace(/\n/, path.delimiter); | ||
if (tripletOverlays) { | ||
core.exportVariable('VCPKG_OVERLAY_TRIPLETS', tripletOverlays); | ||
} | ||
env: | ||
AINPUT_TRIPLET: ${{ inputs.triplet }} | ||
AINPUT_HOST_TRIPLET: ${{ inputs.host-triplet }} | ||
AINPUT_OVERLAY_TRIPLETS: ${{ inputs.overlay-triplets }} | ||
|
||
- run: ./vcpkg/bootstrap-vcpkg.sh | ||
shell: bash |
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