update windows #7
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 and Release PlatypusGui | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
build: | |
name: Build and Upload Artifacts | |
runs-on: windows-latest | |
steps: | |
# Get dependencies | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Install dependencies via vcpkg | |
run: vcpkg.exe install --triplet x64-windows | |
- name: Cache vcpkg | |
uses: actions/cache@v3 | |
with: | |
path: | | |
vcpkg | |
vcpkg_installed | |
key: ${{ runner.os }}-vcpkg-${{ hashFiles('vcpkg.json') }} | |
- name: Get Ninja | |
uses: seanmiddleditch/gha-setup-ninja@master | |
- name: Set up CMake | |
uses: jwlawson/actions-setup-cmake@v1 | |
with: | |
cmake-version: '3.16' | |
- name: Set up MSVC environment | |
shell: cmd | |
run: | | |
call "%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -latest -property installationPath > vs_install_dir.txt | |
set /p InstallDir=<vs_install_dir.txt | |
call "%InstallDir%\VC\Auxiliary\Build\vcvarsall.bat" x64 | |
# Configure CMake (Windows) | |
- name: Configure CMake (Windows) | |
shell: cmd | |
run: | | |
cmake -B build -S . -G Ninja -DCMAKE_BUILD_TYPE=Release | |
# 4. Build the project | |
- name: Build PlatypusGui | |
run: cmake --build build --config Release --target PlatypusGui | |
- name: Deploy Qt Dependencies (Windows) | |
shell: cmd | |
run: | | |
set QT_DIR=C:\Qt\5.15.2\msvc2019_64 | |
set PATH=%QT_DIR%\bin;%PATH% | |
windeployqt.exe --compiler-runtime --dir build\deployment build\PlatypusGui.exe | |
# 6. Upload artifacts for release | |
- name: Upload Release Artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: windows-latest-platypus | |
path: build\deployment\PlatypusGui.exe | |