Update windows-build.yml #25
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: Windows Build | |
on: | |
push: | |
branches: | |
- experimental | |
pull_request: | |
branches: | |
- experimental | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: windows-latest | |
steps: | |
- name: Set VCPKG env | |
run: | | |
echo "VCPKG_ROOT=C:\vcpkg" >> $env:GITHUB_ENV | |
echo "VCPKG_DEFAULT_TRIPLET=x64-windows" >> $env:GITHUB_ENV | |
- name: Export GitHub Actions cache environment variables | |
uses: actions/github-script@v7 | |
with: | |
script: | | |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || ''); | |
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || ''); | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Cache Qt | |
uses: actions/cache@v4 | |
with: | |
path: '${{ env.TEMP }}\qt' | |
key: windows-qt-${{ hashFiles('**/CMakeLists.txt') }} | |
restore-keys: | | |
windows-qt- | |
- name: Install Qt 6.8.3 | |
uses: jurplel/install-qt-action@v4 | |
with: | |
version: '6.8.3' | |
target: 'desktop' | |
dir: '${{ env.TEMP }}\qt' | |
arch: 'win64_msvc2022_64' | |
- name: Cache CMake dependencies | |
uses: actions/cache@v4 | |
with: | |
path: build/.cmake | |
key: windows-cmake-${{ hashFiles('**/CMakeLists.txt') }} | |
restore-keys: | | |
windows-cmake- | |
- name: Update VCPKG Baseline | |
run: | | |
& "C:\vcpkg\vcpkg.exe" x-update-baseline | |
- name: Build with CMake | |
env: | |
VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite" | |
run: | | |
mkdir build | |
cd build | |
cmake .. -DCMAKE_TOOLCHAIN_FILE="C:\vcpkg\scripts\buildsystems\vcpkg.cmake" -DCMAKE_BUILD_TYPE=Release | |
cmake --build . --config Release | |
cd .. | |
- name: Run windeployqt | |
run: | | |
&"D:\qt\Qt\6.8.3\msvc2022_64\bin\windeployqt.exe" --qmldir src\ui --no-translations --release --force-openssl build\Release\appKhinsiderQT.exe | |
- name: Download INNO SETUP | |
run: | | |
choco install innosetup | |
- name: Create Installer | |
run: | | |
cd scripts\windows | |
.\createInstaller.bat | |
cd ..\.. | |
- name: Pack Release | |
run: | | |
Compress-Archive -Path build\Release\* -DestinationPath build\Release.zip | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: Release-Zip | |
path: build/Release.zip | |
- name: Upload Installer | |
uses: actions/upload-artifact@v4 | |
with: | |
name: Installer-EXE | |
path: build/Installer/KhinsiderInstaller.exe |