Skip to content

Update CMake presets. #2241

Update CMake presets.

Update CMake presets. #2241

Workflow file for this run

name: Build Windows
on: [push, pull_request]
env:
VULKAN_SDK_VERSION: '1.3.268.0'
QT_VERSION: '5.15.2'
jobs:
build_windows:
strategy:
matrix:
build-type: ['Visual Studio 16 2019']
target-platform: ['x64', 'Win32']
include:
- target-platform: 'x64'
arch-type: 'x86_64'
qt-arch: 'win64_msvc2019_64'
installer-script: 'installer64.nsi'
- target-platform: 'Win32'
arch-type: 'x86_32'
qt-arch: 'win32_msvc2019'
installer-script: 'installer32.nsi'
runs-on: windows-2019
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive
fetch-depth: 0
- name: Force Fetch Git Tags
run: git fetch --tags --force
- name: Add msbuild to PATH
uses: microsoft/[email protected]
- name: Cache Vulkan SDK
uses: actions/cache@v3
id: cache-vulkansdk
with:
path: VulkanSDK.exe
key: ${{ runner.os }}-VulkanSDK-${{ env.VULKAN_SDK_VERSION }}
- name: Download Vulkan SDK
if: steps.cache-vulkansdk.outputs.cache-hit != 'true'
run: curl -L --silent --show-error --output VulkanSDK.exe https://sdk.lunarg.com/sdk/download/${{ env.VULKAN_SDK_VERSION }}/windows/VulkanSDK-${{ env.VULKAN_SDK_VERSION }}-Installer.exe?Human=true
- name: Install Vulkan SDK
run: |
cmd.exe /c start /wait .\VulkanSDK.exe in --al --im -c com.lunarg.vulkan.32bit
echo "VULKAN_SDK=C:\VulkanSDK\${{ env.VULKAN_SDK_VERSION }}" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- name: Install OpenAL
uses: crazy-max/ghaction-chocolatey@v3
with:
args: install -y openal openalsdk
- name: Install Qt
uses: jurplel/install-qt-action@v3
with:
version: ${{ env.QT_VERSION }}
arch: ${{ matrix.qt-arch }}
cache: true
cache-key-prefix: ${{ runner.os }}-${{ matrix.qt-arch }}-QtCache
- name: Set SHORT_HASH
run: |
$short_hash = "${{ env.LONG_HASH }}".substring(0, 8)
echo "VALUE=$short_hash" >> $env:GITHUB_OUTPUT
id: short_hash
env:
LONG_HASH: ${{ github.sha }}
- name: Generate CMake Project
run: |
mkdir build
cd build
cmake .. -G"${{ matrix.build-type }}" -A ${{ matrix.target-platform }} -T v141_xp -DUSE_QT=on -DBUILD_LIBRETRO_CORE=yes
- name: Build
run: |
cd build
cmake --build . --config Release
- name: Run Tests
run: |
cd build
ctest -C Release
- name: Prepare states DB
run: |
pip3 install requests
python3 .github/CI_MISC/build_compatibility_db.py
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Prepare Installer Package
run: |
cd build
${{ env.Qt5_DIR }}\bin\windeployqt.exe ./Source/ui_qt/Release --no-system-d3d-compiler --no-quick-import --no-opengl-sw --no-compiler-runtime --no-translations
cd ..
makensis.exe ./installer_win32/${{ matrix.installer-script}}
- name: Upload a Build Artifact Installer
uses: actions/upload-artifact@v3
with:
name: Play_Windows_${{ matrix.target-platform }}_Installer
path: installer_win32\*.exe
- name: Upload a Build Artifact Libretro Core
uses: actions/upload-artifact@v3
with:
name: Play_Windows_${{ matrix.target-platform }}_libretro
path: build\Source\ui_libretro\Release\play_libretro.dll
- name: Upload to S3
if: ${{ env.AWS_ACCESS_KEY_ID != null}}
run: |
aws s3 cp installer_win32/ s3://playbuilds/${{ env.SHORT_HASH }}/ --acl public-read --recursive --exclude "*" --include "*.exe"
aws s3 cp build/Source/ui_libretro/Release/play_libretro.dll s3://playbuilds/${{ env.SHORT_HASH }}/play_libretro_${{ env.ARCH_TYPE }}.dll --acl public-read
env:
ARCH_TYPE: ${{ matrix.arch-type }}
SHORT_HASH: ${{ steps.short_hash.outputs.VALUE }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: 'us-east-2'