1
0
mirror of https://github.com/OpenTTD/OpenTTD synced 2025-12-10 06:52:05 +01:00

Codechange: [Actions] Setup vcpkg via a composite action

This commit is contained in:
glx22
2025-07-09 17:21:16 +02:00
committed by Loïc Guilloux
parent c9fc7c0caa
commit 0f2d1dc39c
8 changed files with 48 additions and 84 deletions

25
.github/actions/setup-vcpkg/action.yaml vendored Normal file
View File

@@ -0,0 +1,25 @@
name: 'Setup vcpkg'
description: 'Installs vcpkg and initialises binary caching via NuGet'
inputs:
vcpkg-location:
description: 'Where to install vcpkg'
required: true
runs:
using: "composite"
steps:
- name: Install vcpkg
shell: bash
run: |
git clone https://github.com/microsoft/vcpkg "${{ inputs.vcpkg-location }}"
cd "${{ inputs.vcpkg-location }}"
./bootstrap-vcpkg.$(if [ "${{ runner.os }}" = "Windows" ]; then echo "bat"; else echo "sh"; fi) -disableMetrics
- name: Setup vcpkg caching
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 || '');
core.exportVariable('VCPKG_BINARY_SOURCES', 'clear;x-gha,readwrite')