Skip to content

Add vcpkg binary package caching #43

Add vcpkg binary package caching

Add vcpkg binary package caching #43

Workflow file for this run

name: Build
on:
push:
workflow_dispatch:
jobs:
windows:
strategy:
fail-fast: false
matrix:
platform: [x86, x64]
runs-on: windows-latest
env:
PLATFORM: ${{ matrix.platform }}
BUILD_CONFIGURATION: Release
SOLUTION_FILE_PATH: .
VCPKG_BINARY_SOURCES: 'clear;nuget,GitHub,readwrite'
steps:
- uses: actions/checkout@v3
- name: Checkout NAS2D
run: git submodule update --init nas2d-core/
- name: Add MSBuild to PATH
uses: microsoft/[email protected]
- name: Setup NuGet credentials
shell: bash
run: |
$(vcpkg fetch nuget | tail -n1) \
sources add \
-source "https://nuget.pkg.github.com/OutpostUniverse/index.json" \
-storepasswordincleartext \
-name "GitHub" \
-username "OutpostUniverse" \
-password "${{ secrets.GITHUB_TOKEN }}"
$(vcpkg fetch nuget | tail -n1) \
setApiKey "${{ secrets.GITHUB_TOKEN }}" \
-source "https://nuget.pkg.github.com/OutpostUniverse/index.json"
- name: Restore vcpkg dependency cache
uses: actions/cache@v3
id: cache
with:
path: C:\vcpkg\installed\
key: ${{ runner.os }}-${{ matrix.platform }}-${{ hashFiles('nas2d-core\InstallVcpkgDeps.bat') }}
- name: Install vcpkg dependencies
working-directory: ${{env.GITHUB_WORKSPACE}}
run: nas2d-core\InstallVcpkgDeps.bat
- name: Build
working-directory: ${{env.GITHUB_WORKSPACE}}
# Add additional options to the MSBuild command line here (like platform or verbosity level).
# See https://docs.microsoft.com/visualstudio/msbuild/msbuild-command-line-reference
run: |
vcpkg integrate install
msbuild /maxCpuCount /property:Configuration=${{env.BUILD_CONFIGURATION}} ${{env.SOLUTION_FILE_PATH}}
# msbuild /maxCpuCount /warnAsError /property:Configuration=${{env.BUILD_CONFIGURATION}} ${{env.SOLUTION_FILE_PATH}}