Windows Qt6 builds based on vcpkg #14
Workflow file for this run
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: 🪟 Windows Qt6 | |
on: | |
push: | |
branches: | |
- master | |
- release-** | |
pull_request: | |
release: | |
types: ['published'] | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
permissions: | |
packages: write | |
jobs: | |
build: | |
name: build (windows) | |
runs-on: windows-2022 | |
steps: | |
- name: 🐣 Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 2 | |
- name: 🐩 Install CMake and Ninja | |
uses: lukka/get-cmake@latest | |
with: | |
cmakeVersion: 3.29.2 | |
- name: 🧽 Developer Command Prompt for Microsoft Visual C++ | |
uses: ilammy/msvc-dev-cmd@v1 | |
with: | |
# See https://github.com/actions/runner-images/issues/9398 | |
toolset: 14.39 | |
- name: 🎡 Setup vcpkg | |
uses: ./.github/actions/setup-vcpkg | |
- name: 🦬 Setup flex/bison | |
uses: robinraju/release-downloader@v1.10 | |
with: | |
repository: 'lexxmark/winflexbison' | |
fileName: '*.zip' | |
tag: 'v2.5.24' | |
extract: true | |
- name: 🛍️ Setup ccache | |
uses: hendrikmuhs/ccache-action@v1.2 | |
with: | |
max-size: 1G | |
- name: 🌱 Install dependencies and generate project files | |
shell: bash | |
run: | | |
BUILD_DIR=$( cygpath "${{ github.workspace }}/build" ) | |
SOURCE_DIR=$( cygpath "${{ github.workspace }}" ) | |
cmake -S "${SOURCE_DIR}" \ | |
-B "${BUILD_DIR}" \ | |
-G Ninja \ | |
-D CMAKE_BUILD_TYPE=Release \ | |
-D WITH_VCPKG=ON \ | |
-D CREATE_ZIP=ON \ | |
-D VCPKG_TARGET_TRIPLET=x64-windows-release \ | |
-D VCPKG_HOST_TRIPLET=x64-windows-release \ | |
-D WITH_DESKTOP=ON \ | |
-D WITH_3D=ON \ | |
-D WITH_BINDINGS=ON \ | |
-D ENABLE_TESTS=OFF \ | |
-D BUILD_WITH_QT6=ON \ | |
-D USE_CCACHE=ON \ | |
-D FLEX_EXECUTABLE="${SOURCE_DIR}/win_flex.exe" \ | |
-D BISON_EXECUTABLE="${SOURCE_DIR}/win_bison.exe" \ | |
-D SIP_BUILD_EXECUTABLE="${BUILD_DIR}\vcpkg_installed\x64-windows-release\tools\python3\Scripts\sip-build.exe" \ | |
-D PYUIC_PROGRAM="${BUILD_DIR}\vcpkg_installed\x64-windows-release\tools\python3\pyuic5.bat" \ | |
-D PYRCC_PROGRAM="${BUILD_DIR}\vcpkg_installed\x64-windows-release\tools\python3\pyrcc5.bat" \ | |
-D CMAKE_C_COMPILER_LAUNCHER=ccache \ | |
-D CMAKE_CXX_COMPILER_LAUNCHER=ccache \ | |
-D WITH_QTWEBKIT=OFF \ | |
-D VCPKG_INSTALL_OPTIONS="--x-buildtrees-root=C:/src" \ | |
-D NUGET_USERNAME=${{ github.actor }} \ | |
-D NUGET_TOKEN=${{ secrets.GITHUB_TOKEN }} | |
- name: 🌋 Build | |
shell: bash | |
run: | | |
cmake --build "${{ github.workspace }}/build" --config Release | |
- name: 📦 Package | |
shell: bash | |
run: | | |
cmake --build "${{ github.workspace }}/build" --target bundle --config Release | |
- name: 📦 Create SDK | |
# if: github.event_name == 'workflow_dispatch' || github.event_name == 'release' | |
run: | | |
vcpkg.exe export --zip --output-dir=./sdk --x-install-root=$( cygpath "${{ github.workspace }}/build" )/vcpkg_installed --x-manifest-dir=vcpkg | |
- name: 📤 Upload sdk | |
# if: github.event_name == 'workflow_dispatch' || github.event_name == 'release' | |
uses: actions/upload-artifact@v4 | |
with: | |
name: qgis-sdk-x64-windows | |
path: | | |
sdk/vcpkg-export-*.zip | |
- name: 📑 Upload dep build logs | |
uses: actions/upload-artifact@v4 | |
if: failure() | |
with: | |
name: build-logs-x64-windows | |
path: | | |
C:/src/**/*.log | |
- name: Save PR number to zips | |
run: | | |
echo ${{ github.event.number }} | tee pr_number | |
powershell Compress-Archive -update pr_number *-win64.zip | |
echo ${{ github.event.pull_request.head.sha }} | tee git_commit | |
powershell Compress-Archive -update git_commit *-win64.zip | |
- name: 📤 Upload bundle | |
uses: actions/upload-artifact@v4 | |
with: | |
name: qgis-windows-qt6 | |
path: | | |
build/*-win64.zip |