Removed 1 unused style entries. #8639
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. | |
| on: | |
| push: | |
| # Pushes to the canary branches run only canary.yml, see there. | |
| branches-ignore: | |
| - public-canary | |
| - private-canary | |
| paths-ignore: | |
| - 'docs/**' | |
| - '**.md' | |
| - '!docs/building-win*.md' | |
| - 'changelog.txt' | |
| - 'LEGAL' | |
| - 'LICENSE' | |
| - '.github/**' | |
| - '!.github/workflows/win.yml' | |
| - 'lib/xdg/**' | |
| - 'snap/**' | |
| - 'Telegram/build/docker/**' | |
| - 'Telegram/Resources/uwp/**' | |
| - 'Telegram/SourceFiles/platform/linux/**' | |
| - 'Telegram/SourceFiles/platform/mac/**' | |
| - 'Telegram/Telegram/**' | |
| - 'Telegram/configure.sh' | |
| - 'Telegram/Telegram.plist' | |
| pull_request: | |
| paths-ignore: | |
| - 'docs/**' | |
| - '**.md' | |
| - '!docs/building-win*.md' | |
| - 'changelog.txt' | |
| - 'LEGAL' | |
| - 'LICENSE' | |
| - '.github/**' | |
| - '!.github/workflows/win.yml' | |
| - 'lib/xdg/**' | |
| - 'snap/**' | |
| - 'Telegram/build/docker/**' | |
| - 'Telegram/Resources/uwp/**' | |
| - 'Telegram/SourceFiles/platform/linux/**' | |
| - 'Telegram/SourceFiles/platform/mac/**' | |
| - 'Telegram/Telegram/**' | |
| - 'Telegram/configure.sh' | |
| - 'Telegram/Telegram.plist' | |
| jobs: | |
| windows: | |
| name: Windows | |
| runs-on: ${{ matrix.arch == 'arm64' && 'windows-11-arm' || ((github.event_name == 'pull_request' || startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/nightly') && 'depot-windows-latest-16' || 'windows-latest') }} | |
| strategy: | |
| matrix: | |
| arch: [x64_x86, x64, arm64] | |
| qt: ["", qt6] | |
| generator: ["", "Ninja Multi-Config"] | |
| exclude: | |
| - arch: arm64 | |
| qt: "" | |
| - arch: x64_x86 | |
| qt: qt6 | |
| env: | |
| UPLOAD_ARTIFACT: "true" | |
| ONLY_CACHE: "false" | |
| PREPARE_PATH: "Telegram/build/prepare/prepare.py" | |
| defaults: | |
| run: | |
| shell: cmd | |
| steps: | |
| - name: Prepare directories. | |
| run: | | |
| 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 | |
| run: echo "REPO_NAME=${GITHUB_REPOSITORY##*/}" >> $GITHUB_ENV | |
| - name: Clone. | |
| uses: actions/checkout@v7 | |
| with: | |
| submodules: recursive | |
| path: ${{ env.TBUILD }}\${{ env.REPO_NAME }} | |
| - name: First set up. | |
| shell: bash | |
| run: | | |
| DOCPATH=$TBUILD/$REPO_NAME/docs/building-win.md | |
| SDK="$(grep "SDK version" $DOCPATH | sed -r 's/.*\*\*(.*)\*\* SDK version.*/\1/')" | |
| echo "SDK=$SDK" >> $GITHUB_ENV | |
| sed -i '/CMAKE_${lang}_FLAGS_DEBUG_INIT/s/${_Zi}//' "$PROGRAMFILES"/CMake/share/cmake*/Modules/Platform/Windows-MSVC.cmake | |
| echo "$(sha256sum $TBUILD/$REPO_NAME/$PREPARE_PATH | awk '{ print $1 }')" >> CACHE_KEY.txt | |
| echo "$SDK" >> CACHE_KEY.txt | |
| echo "CACHE_KEY=$(sha256sum CACHE_KEY.txt | awk '{ print $1 }')" >> $GITHUB_ENV | |
| echo "Configurate git for cherry-picks." | |
| git config --global user.email "you@example.com" | |
| git config --global user.name "Sample" | |
| - name: Install VS 2026 Build Tools. | |
| if: matrix.arch == 'arm64' | |
| shell: pwsh | |
| run: | | |
| $exe = Join-Path $env:RUNNER_TEMP 'vs_buildtools.exe' | |
| Invoke-WebRequest -Uri https://aka.ms/vs/18/stable/vs_buildtools.exe -OutFile $exe | |
| $p = Start-Process -FilePath $exe -Wait -PassThru -ArgumentList ` | |
| '--quiet','--wait','--norestart','--nocache', ` | |
| '--add','Microsoft.VisualStudio.Workload.VCTools', ` | |
| '--add','Microsoft.VisualStudio.Component.VC.Tools.ARM64', ` | |
| '--add','Microsoft.VisualStudio.Component.VC.ATL.ARM64' | |
| Remove-Item $exe -Force -ErrorAction SilentlyContinue | |
| if ($p.ExitCode -ne 0 -and $p.ExitCode -ne 3010) { exit $p.ExitCode } | |
| - uses: Eden-CI/msvc-dev-cmd@master | |
| name: Native Tools Command Prompt. | |
| with: | |
| arch: ${{ matrix.arch }} | |
| sdk: ${{ env.SDK }} | |
| toolset: ${{ case(matrix.arch == 'arm64', '', '14.44') }} | |
| - name: NuGet sources. | |
| run: | | |
| nuget sources Disable -Name "Microsoft Visual Studio Offline Packages" | |
| nuget sources Add -Source https://api.nuget.org/v3/index.json & exit 0 | |
| - name: ThirdParty cache. | |
| id: cache-third-party | |
| uses: actions/cache@v6 | |
| with: | |
| path: ${{ env.TBUILD }}\ThirdParty | |
| key: ${{ runner.OS }}-${{ runner.arch }}-third-party-${{ env.CACHE_KEY }} | |
| restore-keys: ${{ runner.OS }}-${{ runner.arch }}-third-party- | |
| - name: Libraries cache. | |
| id: cache-libs | |
| uses: actions/cache@v6 | |
| with: | |
| 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-v2-${{ env.CACHE_KEY }} | |
| restore-keys: ${{ runner.OS }}-${{ matrix.arch }}-libs-v2- | |
| - name: Qt cache. | |
| id: cache-qt | |
| uses: actions/cache@v6 | |
| 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. | |
| run: | | |
| %TBUILD%\%REPO_NAME%\Telegram\build\prepare\win.bat skip-release silent ${{ matrix.qt }} | |
| - name: Read configuration matrix. | |
| shell: bash | |
| run: | | |
| ARTIFACT_NAME="Telegram" | |
| ARCH="" | |
| if [ -n "${{ matrix.arch }}" ]; then | |
| case "${{ matrix.arch }}" in | |
| x64_x86) ARCH="x86";; | |
| arm64) ARCH="arm";; | |
| *) ARCH="${{ matrix.arch }}";; | |
| esac | |
| echo "Architecture from matrix: $ARCH" | |
| 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 }}\"" | |
| echo "Generator from matrix: $GENERATOR" | |
| ARTIFACT_NAME="${ARTIFACT_NAME} ${{ matrix.generator }}" | |
| fi | |
| echo "TDESKTOP_BUILD_GENERATOR=$GENERATOR" >> $GITHUB_ENV | |
| [ -n "$GENERATOR" ] && ARCH="" | |
| echo "TDESKTOP_BUILD_ARCH=$ARCH" >> $GITHUB_ENV | |
| DEFINE="" | |
| if [ -n "${{ matrix.defines }}" ]; then | |
| DEFINE="-D ${{ matrix.defines }}=ON" | |
| echo "Define from matrix: $DEFINE" | |
| ARTIFACT_NAME="${ARTIFACT_NAME} ${{ matrix.defines }}" | |
| fi | |
| echo "TDESKTOP_BUILD_DEFINE=$DEFINE" >> $GITHUB_ENV | |
| echo "ARTIFACT_NAME=$ARTIFACT_NAME" >> $GITHUB_ENV | |
| API="-D TDESKTOP_API_TEST=ON" | |
| if [ $GITHUB_REF == 'refs/heads/nightly' ]; then | |
| echo "Use the open credentials." | |
| API="-D TDESKTOP_API_ID=611335 -D TDESKTOP_API_HASH=d524b414d21f4d37f08684c1df41ac9c" | |
| fi | |
| echo "TDESKTOP_BUILD_API=$API" >> $GITHUB_ENV | |
| - name: Free up some disk space. | |
| shell: bash | |
| run: find $LibrariesPath '(' '(' ! '(' -name '*.lib' -o -name '*.a' -o -name '*.exe' -o -name '*.h' -o -name '*.hpp' -o -name '*.inc' -o -name '*.cmake' -o -name '*.pc' -o -path '*/include/*' -o -path '*/objects-*' -o -path '*/cache_keys/*' -o -path '*/patches/*' -o -path '*/nv-codec-headers/*' ')' -type f ')' -o -empty ')' -delete | |
| - name: Telegram Desktop build. | |
| if: env.ONLY_CACHE == 'false' | |
| run: | | |
| cd %TBUILD%\%REPO_NAME%\Telegram | |
| 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 ^ | |
| -D CMAKE_MSVC_DEBUG_INFORMATION_FORMAT= ^ | |
| -D DESKTOP_APP_DISABLE_AUTOUPDATE=OFF ^ | |
| -D DESKTOP_APP_DISABLE_CRASH_REPORTS=OFF ^ | |
| %TDESKTOP_BUILD_DEFINE% | |
| cmake --build ..\out --config Debug --parallel | |
| - name: Move artifact. | |
| if: (env.UPLOAD_ARTIFACT == 'true') || (github.ref == 'refs/heads/nightly') | |
| run: | | |
| set OUT=%TBUILD%\%REPO_NAME%\out\Debug | |
| mkdir artifact | |
| move %OUT%\Telegram.exe artifact/ | |
| move %OUT%\Updater.exe artifact/ | |
| - uses: actions/upload-artifact@v7 | |
| name: Upload artifact. | |
| if: (env.UPLOAD_ARTIFACT == 'true') || (github.ref == 'refs/heads/nightly') | |
| with: | |
| name: ${{ env.ARTIFACT_NAME }} | |
| path: artifact\ | |
| retention-days: 1 |