Use NuGet package caching with vcpkg #15
This file contains hidden or 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
| name: CMake | |
| on: | |
| push: | |
| branches: [ "master" ] | |
| pull_request: | |
| branches: [ "master" ] | |
| jobs: | |
| build: | |
| strategy: | |
| matrix: | |
| os: [ ubuntu-latest, windows-latest, macos-latest ] | |
| include: | |
| - os: macos-latest | |
| nuget: mono `./vcpkg/vcpkg fetch nuget | tail -n 1` | |
| - os: ubuntu-latest | |
| nuget: mono `./vcpkg/vcpkg fetch nuget | tail -n 1` | |
| - os: windows-latest | |
| nuget: nuget | |
| runs-on: ${{matrix.os}} | |
| env: | |
| FEED_URL: https://nuget.pkg.github.com/${{github.repository_owner}}/index.json | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| with: | |
| submodules: true | |
| - name: Install Prerequisites Linux | |
| if: ${{matrix.os != 'windows-latest'}} | |
| shell: bash | |
| run: | | |
| ${{github.workspace}}/vcpkg/bootstrap-vcpkg.sh | |
| sudo apt install mono-complete | |
| - name: Add NuGet sources | |
| shell: bash | |
| run: | | |
| ${{matrix.nuget}} \ | |
| sources add \ | |
| -Source "${{env.FEED_URL}}" \ | |
| -StorePasswordInClearText \ | |
| -Name GitHubPackages \ | |
| -UserName "${{github.repository_owner}}" \ | |
| -Password "${{secrets.GH_PACKAGES_TOKEN}}" | |
| ${{matrix.nuget}} \ | |
| setapikey "${{secrets.GH_PACKAGES_TOKEN}}" \ | |
| -Source "${{env.FEED_URL}}" | |
| - name: Setup CMake | |
| uses: jwlawson/actions-setup-cmake@802fa1a2c4e212495c05bf94dba2704a92a472be # v2.0.2 | |
| with: | |
| cmake-version: '3.31' | |
| - name: Run Workflow | |
| env: | |
| VCPKG_BINARY_SOURCES: "clear;nuget,${{env.FEED_URL}},readwrite" | |
| run: | | |
| cmake --version | |
| cmake --workflow --preset default |