1
0
Fork 0

Codechange: [Actions] Use NuGet for vcpkg binary caching

pull/14426/head
glx22 2025-07-09 21:49:30 +02:00
parent 7fc047392c
commit 5df8accbbd
6 changed files with 33 additions and 3 deletions

View File

@ -4,6 +4,9 @@ inputs:
vcpkg-location:
description: 'Where to install vcpkg'
required: true
mono-install-command:
description: 'Command to run to install mono'
required: false
runs:
using: "composite"
@ -15,11 +18,33 @@ runs:
cd "${{ inputs.vcpkg-location }}"
./bootstrap-vcpkg.$(if [ "${{ runner.os }}" = "Windows" ]; then echo "bat"; else echo "sh"; fi) -disableMetrics
- name: Install mono
if: inputs.mono-install-command
shell: bash
run: |
${{ inputs.mono-install-command }}
echo "MONO=mono" >> "$GITHUB_ENV"
- name: Setup NuGet Credentials
shell: bash
env:
FEED_URL: 'https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json'
run: |
cd "${{ inputs.vcpkg-location }}"
${{ env.MONO }} $(./vcpkg fetch nuget | tail -n 1) \
sources add \
-source "${{ env.FEED_URL }}" \
-storepasswordincleartext \
-name "GitHub" \
-username "${{ github.repository_owner }}" \
-password "${{ github.token }}"
${{ env.MONO }} $(./vcpkg fetch nuget | tail -n 1) \
setapikey "${{ github.token }}" \
-source "${{ env.FEED_URL }}"
- 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')
core.exportVariable('VCPKG_BINARY_SOURCES', 'clear;nuget,GitHub,readwrite')

View File

@ -36,6 +36,7 @@ jobs:
uses: ./.github/actions/setup-vcpkg
with:
vcpkg-location: ${{ runner.temp }}/vcpkg
mono-install-command: 'sudo apt-get install -y --no-install-recommends mono-complete'
- name: Install dependencies
run: |

View File

@ -38,6 +38,7 @@ jobs:
uses: ./.github/actions/setup-vcpkg
with:
vcpkg-location: ${{ runner.temp }}/vcpkg
mono-install-command: 'brew install mono'
- name: Install OpenGFX
run: |

View File

@ -30,6 +30,7 @@ jobs:
uses: ./.github/actions/setup-vcpkg
with:
vcpkg-location: ${{ runner.temp }}/vcpkg
mono-install-command: 'sudo apt-get install -y --no-install-recommends mono-complete'
- name: Install dependencies
run: |

View File

@ -113,6 +113,7 @@ jobs:
uses: ./.github/actions/setup-vcpkg
with:
vcpkg-location: /vcpkg
mono-install-command: 'yum install -y mono-complete'
- name: Install GCC problem matcher
uses: ammaraskar/gcc-problem-matcher@master

View File

@ -41,6 +41,7 @@ jobs:
uses: ./.github/actions/setup-vcpkg
with:
vcpkg-location: ${{ runner.temp }}/vcpkg
mono-install-command: 'brew install mono'
- name: Install dependencies
env: