Build with VCPKG #26
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
name: Build with VCPKG | |
# Controls when the workflow will run | |
on: | |
# Allows you to run this workflow manually target the Actions tab | |
workflow_dispatch: | |
jobs: | |
build: | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- { os: windows-latest, env: Windows x86_64, triplet: x64-windows-static, binary: Release/retrotime.exe, vcpkgCommitId: 'a2938d0e28fdb82285ec1be1ab03f962cca3e6a3' } | |
- { os: macos-1015, env: Mac Os x64, triplet: x64-osx, binary: Release/retrotime, vcpkgCommitId: 'a2938d0e28fdb82285ec1be1ab03f962cca3e6a3' } | |
- { os: macos-latest, env: Mac Os arm64, triplet: arm64-osx, binary: Release/retrotime, vcpkgCommitId: 'a2938d0e28fdb82285ec1be1ab03f962cca3e6a3' } | |
- { os: ubuntu-20.04, env: Ubuntu x86_64, triplet: x64-linux, binary: Release/retrotime, vcpkgCommitId: 'a2938d0e28fdb82285ec1be1ab03f962cca3e6a3' } | |
runs-on: ${{ matrix.os }} | |
env: | |
VCPKG_DEFAULT_TRIPLET: ${{ matrix.triplet }} | |
steps: | |
- name: 'Cleanup build folder' | |
if: runner.os != 'Windows' | |
run: | | |
ls -la ./ | |
rm -rf ./* || true | |
rm -rf ./.??* || true | |
ls -la ./ | |
- name: Checkout sources | |
uses: actions/checkout@v4 | |
- uses: lukka/get-cmake@latest | |
- name: Dump the content of $RUNNER_TEMP | |
run: find $RUNNER_TEMP | |
shell: bash | |
- name: Setup vcpkg | |
uses: lukka/run-vcpkg@v11 | |
id: runvcpkg | |
with: | |
# This specifies the location of vcpkg, where it is going to be restored from cache, or create from scratch. | |
vcpkgDirectory: '${{ runner.workspace }}/vcpkg' | |
# The Git commit id of vcpkg to be checked out. This is only needed because we are not using a submodule. | |
vcpkgGitCommitId: '${{ matrix.vcpkgCommitId}}' | |
# The vcpkg.json file, which will be part of cache key computation. | |
vcpkgJsonGlob: '**/vcpkg.json' | |
- name: Prints output of run-vcpkg's action | |
run: echo "root='${{ steps.runvcpkg.outputs.RUNVCPKG_VCPKG_ROOT_OUT }}', triplet='${{ steps.runvcpkg.outputs.RUNVCPKG_VCPKG_DEFAULT_TRIPLET_OUT }}'" | |
- name: Run CMake with vcpkg.json manifest | |
uses: lukka/run-cmake@v10 | |
with: | |
cmakeListsTxtPath: '${{ github.workspace }}/CMakeLists.txt' | |
configurePreset: ninja-multi-vcpkg | |
buildPreset: ninja-multi-vcpkg | |
buildPresetAdditionalArgs: "['--config Release']" | |
- name: Copy Game And Assets | |
run: | | |
mkdir ./Release | |
mkdir ./Release/RetroTime | |
cp builds/ninja-multi-vcpkg/${{ matrix.binary }} ./Release/RetroTime/ | |
cp -R ./retrotimefs ./Release/RetroTime/ | |
cp ./README.md ./Release/RetroTime/ | |
cp ./LICENSE ./Release/RetroTime/ | |
- name: Tar Gzip everything | |
if: runner.os != 'Windows' | |
run : | | |
cd Release | |
tar -czvf "../RetroTime ${{ matrix.env }}.tar.gz" RetroTime | |
- name: Store build | |
uses: actions/upload-artifact@v4 | |
if: runner.os != 'Windows' | |
with: | |
name: RetroTime ${{ matrix.env }} | |
path: ./RetroTime ${{ matrix.env }}.tar.gz | |
- name: Store build | |
uses: actions/upload-artifact@v4 | |
if: runner.os == 'Windows' | |
with: | |
name: RetroTime ${{ matrix.env }} | |
path: ./Release/ |