From 21f77b0af38a0a463dd3251a20bd397e4a798a30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Csaba=20K=20Moln=C3=A1r?= <13969648+mocsa@users.noreply.github.com> Date: Tue, 27 Aug 2024 16:16:46 +0200 Subject: [PATCH] Update msbuild.yml --- .github/workflows/msbuild.yml | 30 ++++++++++++++++++++++++++---- 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/.github/workflows/msbuild.yml b/.github/workflows/msbuild.yml index da5cf23..c647286 100644 --- a/.github/workflows/msbuild.yml +++ b/.github/workflows/msbuild.yml @@ -21,6 +21,8 @@ env: BUILD_CONFIGURATION: Release MSFS_SDK: MSFS_SDK\MSFS SDK + MSFS_SDK_PATH: 0.24.3 + MSFS_SDK_VERSION: 0.24.3.0 permissions: contents: read @@ -34,6 +36,16 @@ jobs: with: submodules: 'recursive' # Checkout vcpkg submodule + - name: Cache vcpkg + uses: actions/cache@v2 + with: + path: | + vcpkg/installed + vcpkg/downloads + key: ${{ runner.os }}-vcpkg-${{ hashFiles('vcpkg.json') }} + restore-keys: | + ${{ runner.os }}-vcpkg- + - name: Setup vcpkg run: | cd vcpkg @@ -46,9 +58,18 @@ jobs: - name: Add MSBuild to PATH uses: microsoft/setup-msbuild@v1.0.2 - - name: Download MSFS SDK file + - name: Cache MSFS SDK + id: cache-msfs-sdk + uses: actions/cache@v2 + with: + path: | + $env:MSFS_SDK + key: msfs-sdk-$env:MSFS_SDK_VERSION + + - if: ${{ steps.cache-msfs-sdk.outputs.cache-hit != 'true' }} + name: Download MSFS SDK file run: | - curl -L -o MSFS_SDK_Core_Installer_0.24.3.0.msi https://sdk.flightsimulator.com/files/installers/0.24.3/MSFS_SDK_Core_Installer_0.24.3.0.msi + curl -L -o MSFS_SDK_Core_Installer_$env:MSFS_SDK_VERSION.msi https://sdk.flightsimulator.com/files/installers/$env:MSFS_SDK_PATH/MSFS_SDK_Core_Installer_$env:MSFS_SDK_VERSION.msi - name: Print Folder Tree uses: jaywcjlove/github-action-folder-tree@main with: @@ -57,9 +78,10 @@ jobs: # Piping to Out-Null waits for completion # Current path = Workspace. See https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/accessing-contextual-information-about-workflow-runs#github-context - - name: Extract msi + - if: ${{ steps.cache-msfs-sdk.outputs.cache-hit != 'true' }} + name: Extract msi run: | - msiexec /a MSFS_SDK_Core_Installer_0.24.3.0.msi /qb TARGETDIR=$env:GITHUB_WORKSPACE\MSFS_SDK | Out-Null + msiexec /a MSFS_SDK_Core_Installer_$env:MSFS_SDK_VERSION.msi /qb TARGETDIR=$env:GITHUB_WORKSPACE\MSFS_SDK | Out-Null # https://stackoverflow.com/questions/70036493/ # $file = "MSFS_SDK_Core_Installer_0.24.3.0.msi" # $log = "install.log"