Add Windows Qt 6 build to GitHub actions

This commit is contained in:
Ilya Fedin
2025-12-25 04:28:48 +04:00
committed by John Preston
parent e5683489bb
commit 83668b3b93
+25 -4
View File
@@ -49,6 +49,7 @@ jobs:
strategy:
matrix:
arch: [x64_x86, x64]
qt: ["", qt6]
generator: ["", "Ninja Multi-Config"]
env:
@@ -66,6 +67,7 @@ jobs:
mkdir %userprofile%\TBuild\Libraries
mklink /d %GITHUB_WORKSPACE%\TBuild %userprofile%\TBuild
echo TBUILD=%GITHUB_WORKSPACE%\TBuild>>%GITHUB_ENV%
echo LibrariesPath=%GITHUB_WORKSPACE%\TBuild\Libraries${{ matrix.arch == 'x64' && '\win64' || '' }}>>%GITHUB_ENV%
- name: Get repository name.
shell: bash
@@ -118,17 +120,31 @@ jobs:
id: cache-libs
uses: actions/cache@v5
with:
path: ${{ env.TBUILD }}\Libraries
path: |
${{ env.LibrariesPath }}\*
!${{ env.LibrariesPath }}\cache_keys
!${{ env.LibrariesPath }}\[qQ]t[_-]*
${{ env.LibrariesPath }}\cache_keys\*
!${{ env.LibrariesPath }}\cache_keys\[qQ]t[_-]*
key: ${{ runner.OS }}-${{ matrix.arch }}-libs-${{ env.CACHE_KEY }}
restore-keys: ${{ runner.OS }}-${{ matrix.arch }}-libs-
- name: Qt cache.
id: cache-qt
uses: actions/cache@v5
with:
path: |
${{ env.LibrariesPath }}\[qQ]t[_-]*
${{ env.LibrariesPath }}\cache_keys\[qQ]t[_-]*
key: ${{ runner.OS }}-${{ matrix.arch }}-${{ matrix.qt || 'qt' }}-${{ env.CACHE_KEY }}
restore-keys: ${{ runner.OS }}-${{ matrix.arch }}-${{ matrix.qt || 'qt' }}-
- name: Libraries.
env:
GYP_MSVS_OVERRIDE_PATH: 'C:\Program Files\Microsoft Visual Studio\2022\Enterprise\'
GYP_MSVS_VERSION: 2022
run: |
cd %TBUILD%
%REPO_NAME%\Telegram\build\prepare\win.bat skip-release silent
%TBUILD%\%REPO_NAME%\Telegram\build\prepare\win.bat skip-release silent ${{ matrix.qt }}
- name: Read configuration matrix.
shell: bash
@@ -145,6 +161,10 @@ jobs:
ARTIFACT_NAME="${ARTIFACT_NAME} ${{ matrix.arch }}"
fi
if [ -n "${{ matrix.qt }}" ]; then
ARTIFACT_NAME="${ARTIFACT_NAME} ${{ matrix.qt }}"
fi
GENERATOR=""
if [ -n "${{ matrix.generator }}" ]; then
GENERATOR="-G \"${{ matrix.generator }}\""
@@ -175,7 +195,7 @@ jobs:
- name: Free up some disk space.
shell: bash
run: find TBuild/Libraries '(' '(' ! '(' -name '*.lib' -o -name '*.a' -o -name '*.exe' -o -name '*.h' -o -name '*.hpp' -o -name '*.inc' -o -name '*.cmake' -o -path '*/include/*' -o -path '*/objects-*' -o -path '*/cache_keys/*' -o -path '*/patches/*' ')' -type f ')' -o -empty ')' -delete
run: find $LibrariesPath '(' '(' ! '(' -name '*.lib' -o -name '*.a' -o -name '*.exe' -o -name '*.h' -o -name '*.hpp' -o -name '*.inc' -o -name '*.cmake' -o -path '*/include/*' -o -path '*/objects-*' -o -path '*/cache_keys/*' -o -path '*/patches/*' ')' -type f ')' -o -empty ')' -delete
- name: Telegram Desktop build.
if: env.ONLY_CACHE == 'false'
@@ -185,6 +205,7 @@ jobs:
call configure.bat ^
%TDESKTOP_BUILD_GENERATOR% ^
%TDESKTOP_BUILD_ARCH% ^
${{ matrix.qt }} ^
%TDESKTOP_BUILD_API% ^
-D CMAKE_CONFIGURATION_TYPES=Debug ^
-D CMAKE_COMPILE_WARNING_AS_ERROR=ON ^