2019-09-06 05:24:37 +00:00
|
|
|
name: Windows.
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
paths-ignore:
|
|
|
|
- 'docs/**'
|
2020-04-12 05:17:44 +00:00
|
|
|
- '**.md'
|
2020-04-30 14:57:01 +00:00
|
|
|
- 'changelog.txt'
|
|
|
|
- 'LEGAL'
|
|
|
|
- 'LICENSE'
|
|
|
|
- '.github/**'
|
|
|
|
- '!.github/workflows/win.yml'
|
|
|
|
- 'lib/xdg/**'
|
|
|
|
- 'snap/**'
|
2022-04-16 10:27:40 +00:00
|
|
|
- 'Telegram/build/docker/**'
|
2020-04-30 14:57:01 +00:00
|
|
|
- 'Telegram/Resources/uwp/**'
|
|
|
|
- 'Telegram/SourceFiles/platform/linux/**'
|
|
|
|
- 'Telegram/SourceFiles/platform/mac/**'
|
|
|
|
- 'Telegram/Telegram/**'
|
|
|
|
- 'Telegram/configure.sh'
|
|
|
|
- 'Telegram/Telegram.plist'
|
2019-09-06 05:24:37 +00:00
|
|
|
pull_request:
|
|
|
|
paths-ignore:
|
|
|
|
- 'docs/**'
|
2020-04-12 05:17:44 +00:00
|
|
|
- '**.md'
|
2020-04-30 14:57:01 +00:00
|
|
|
- 'changelog.txt'
|
|
|
|
- 'LEGAL'
|
|
|
|
- 'LICENSE'
|
|
|
|
- '.github/**'
|
|
|
|
- '!.github/workflows/win.yml'
|
|
|
|
- 'lib/xdg/**'
|
|
|
|
- 'snap/**'
|
2022-04-16 10:27:40 +00:00
|
|
|
- 'Telegram/build/docker/**'
|
2020-04-30 14:57:01 +00:00
|
|
|
- 'Telegram/Resources/uwp/**'
|
|
|
|
- 'Telegram/SourceFiles/platform/linux/**'
|
|
|
|
- 'Telegram/SourceFiles/platform/mac/**'
|
|
|
|
- 'Telegram/Telegram/**'
|
|
|
|
- 'Telegram/configure.sh'
|
|
|
|
- 'Telegram/Telegram.plist'
|
2019-09-06 05:24:37 +00:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
|
|
|
|
windows:
|
|
|
|
name: Windows
|
2022-01-02 05:22:36 +00:00
|
|
|
runs-on: windows-2022
|
2019-09-06 05:24:37 +00:00
|
|
|
|
|
|
|
strategy:
|
|
|
|
matrix:
|
2022-01-02 05:22:36 +00:00
|
|
|
arch: [Win32, x64]
|
|
|
|
|
2019-09-06 05:24:37 +00:00
|
|
|
env:
|
|
|
|
UPLOAD_ARTIFACT: "false"
|
2020-01-24 13:17:35 +00:00
|
|
|
ONLY_CACHE: "false"
|
2021-09-10 13:19:07 +00:00
|
|
|
PREPARE_PATH: "Telegram/build/prepare/prepare.py"
|
2020-02-24 13:51:53 +00:00
|
|
|
|
2020-10-25 01:46:27 +00:00
|
|
|
defaults:
|
|
|
|
run:
|
|
|
|
shell: cmd
|
|
|
|
|
2019-09-06 05:24:37 +00:00
|
|
|
steps:
|
2022-01-02 05:22:36 +00:00
|
|
|
- name: Prepare directories.
|
|
|
|
run: |
|
2022-11-07 12:32:59 +00:00
|
|
|
mkdir %userprofile%\TBuild
|
|
|
|
mklink /d %GITHUB_WORKSPACE%\TBuild %userprofile%\TBuild
|
|
|
|
echo TBUILD=%GITHUB_WORKSPACE%\TBuild>>%GITHUB_ENV%
|
|
|
|
|
2022-04-16 11:53:06 +00:00
|
|
|
mkdir %userprofile%\TBuild Libraries
|
|
|
|
mklink /d %userprofile%\TBuild\Libraries %GITHUB_WORKSPACE%\Libraries
|
2022-01-02 05:22:36 +00:00
|
|
|
|
2019-09-06 05:24:37 +00:00
|
|
|
- name: Get repository name.
|
|
|
|
shell: bash
|
2020-10-25 01:46:27 +00:00
|
|
|
run: echo "REPO_NAME=${GITHUB_REPOSITORY##*/}" >> $GITHUB_ENV
|
2019-09-06 05:24:37 +00:00
|
|
|
|
2022-11-07 12:32:59 +00:00
|
|
|
- uses: ilammy/msvc-dev-cmd@v1.12.0
|
2022-01-02 05:22:36 +00:00
|
|
|
name: Native Tools Command Prompt.
|
2021-08-11 02:52:44 +00:00
|
|
|
with:
|
2022-01-02 05:22:36 +00:00
|
|
|
arch: ${{ matrix.arch }}
|
2019-09-06 05:24:37 +00:00
|
|
|
|
2020-10-25 01:46:27 +00:00
|
|
|
- name: Clone.
|
2022-11-07 12:32:59 +00:00
|
|
|
uses: actions/checkout@v3.1.0
|
2020-10-25 01:46:27 +00:00
|
|
|
with:
|
|
|
|
submodules: recursive
|
2022-01-02 05:22:36 +00:00
|
|
|
path: ${{ env.TBUILD }}\${{ env.REPO_NAME }}
|
2019-09-06 05:24:37 +00:00
|
|
|
|
2022-01-02 05:22:36 +00:00
|
|
|
- name: Set up environment paths.
|
2019-09-06 05:24:37 +00:00
|
|
|
shell: bash
|
|
|
|
run: |
|
2022-04-15 07:21:06 +00:00
|
|
|
echo "CACHE_KEY=$(sha256sum $TBUILD/$REPO_NAME/$PREPARE_PATH | awk '{ print $1 }')" >> $GITHUB_ENV
|
|
|
|
|
2022-01-02 05:22:36 +00:00
|
|
|
echo "Configurate git for cherry-picks."
|
|
|
|
git config --global user.email "you@example.com"
|
|
|
|
git config --global user.name "Sample"
|
2019-09-06 05:24:37 +00:00
|
|
|
|
2022-01-02 05:22:36 +00:00
|
|
|
- name: NuGet sources.
|
2020-10-07 02:21:20 +00:00
|
|
|
run: |
|
2022-01-02 05:22:36 +00:00
|
|
|
nuget sources Disable -Name "Microsoft Visual Studio Offline Packages"
|
|
|
|
nuget sources Add -Source https://api.nuget.org/v3/index.json & exit 0
|
2020-10-07 02:21:20 +00:00
|
|
|
|
2022-01-02 05:22:36 +00:00
|
|
|
- name: Libraries cache.
|
|
|
|
id: cache-libs
|
2022-11-07 12:32:59 +00:00
|
|
|
uses: actions/cache@v3.0.11
|
2019-09-06 05:24:37 +00:00
|
|
|
with:
|
2022-04-16 11:53:06 +00:00
|
|
|
path: Libraries
|
2022-04-16 11:49:29 +00:00
|
|
|
key: ${{ runner.OS }}-${{ matrix.arch }}-libs-${{ env.CACHE_KEY }}
|
|
|
|
restore-keys: ${{ runner.OS }}-${{ matrix.arch }}-libs-
|
2019-09-06 05:24:37 +00:00
|
|
|
|
2022-01-02 05:22:36 +00:00
|
|
|
- name: Libraries.
|
2019-09-06 05:24:37 +00:00
|
|
|
env:
|
2022-01-02 05:22:36 +00:00
|
|
|
GYP_MSVS_OVERRIDE_PATH: 'C:\Program Files\Microsoft Visual Studio\2022\Enterprise\'
|
|
|
|
GYP_MSVS_VERSION: 2022
|
2022-04-16 11:53:06 +00:00
|
|
|
run: '%TBUILD%\%REPO_NAME%\Telegram\build\prepare\win.bat skip-release silent'
|
2020-08-14 06:45:41 +00:00
|
|
|
|
2019-09-06 05:24:37 +00:00
|
|
|
- name: Read defines.
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
DEFINE=""
|
|
|
|
if [ -n "${{ matrix.defines }}" ]; then
|
|
|
|
DEFINE="-D ${{ matrix.defines }}=ON"
|
2022-12-08 17:35:17 +00:00
|
|
|
echo "Define from matrix: $DEFINE"
|
2022-05-25 20:40:44 +00:00
|
|
|
echo "ARTIFACT_NAME=Telegram_${{ matrix.arch }}_${{ matrix.defines }}" >> $GITHUB_ENV
|
2020-04-12 19:04:47 +00:00
|
|
|
else
|
2022-05-25 20:40:44 +00:00
|
|
|
echo "ARTIFACT_NAME=Telegram_${{ matrix.arch }}" >> $GITHUB_ENV
|
2019-09-06 05:24:37 +00:00
|
|
|
fi
|
2020-10-25 01:46:27 +00:00
|
|
|
echo "TDESKTOP_BUILD_DEFINE=$DEFINE" >> $GITHUB_ENV
|
2019-09-06 05:24:37 +00:00
|
|
|
|
2022-12-08 17:35:17 +00:00
|
|
|
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
|
|
|
|
|
2021-06-01 17:22:10 +00:00
|
|
|
- name: Free up some disk space.
|
2022-01-02 05:22:36 +00:00
|
|
|
run: |
|
|
|
|
del /S Libraries\*.pdb
|
|
|
|
del /S Libraries\*.pch
|
|
|
|
del /S Libraries\*.obj
|
2021-06-01 17:22:10 +00:00
|
|
|
|
2020-01-24 13:17:35 +00:00
|
|
|
- name: Telegram Desktop build.
|
|
|
|
if: env.ONLY_CACHE == 'false'
|
2019-09-06 05:24:37 +00:00
|
|
|
run: |
|
2022-01-02 05:22:36 +00:00
|
|
|
cd %TBUILD%\%REPO_NAME%\Telegram
|
2019-09-06 05:24:37 +00:00
|
|
|
|
|
|
|
call configure.bat ^
|
2022-01-02 05:22:36 +00:00
|
|
|
${{ matrix.arch }} ^
|
2022-12-08 17:35:17 +00:00
|
|
|
%TDESKTOP_BUILD_API% ^
|
2020-08-10 14:10:42 +00:00
|
|
|
-D DESKTOP_APP_DISABLE_CRASH_REPORTS=OFF ^
|
2021-03-17 09:45:19 +00:00
|
|
|
-D DESKTOP_APP_NO_PDB=ON ^
|
2019-09-06 05:24:37 +00:00
|
|
|
%TDESKTOP_BUILD_DEFINE% ^
|
|
|
|
-DCMAKE_SYSTEM_VERSION=%SDK%
|
|
|
|
|
|
|
|
cd ..\out
|
2022-01-02 05:22:36 +00:00
|
|
|
msbuild -m Telegram.sln /p:Configuration=Debug,Platform=${{ matrix.arch }},DebugSymbols=false,DebugType=none
|
2019-09-06 05:24:37 +00:00
|
|
|
|
|
|
|
- name: Move artifact.
|
2022-12-08 17:35:17 +00:00
|
|
|
if: (env.UPLOAD_ARTIFACT == 'true') || ${{ github.ref == 'refs/heads/nightly' }}
|
2019-09-06 05:24:37 +00:00
|
|
|
run: |
|
|
|
|
mkdir artifact
|
2022-01-02 05:22:36 +00:00
|
|
|
move %TBUILD%\%REPO_NAME%\out\Debug\Telegram.exe artifact/
|
2019-09-06 05:24:37 +00:00
|
|
|
- uses: actions/upload-artifact@master
|
|
|
|
name: Upload artifact.
|
2022-12-08 17:35:17 +00:00
|
|
|
if: (env.UPLOAD_ARTIFACT == 'true') || ${{ github.ref == 'refs/heads/nightly' }}
|
2019-09-06 05:24:37 +00:00
|
|
|
with:
|
2020-04-12 19:04:47 +00:00
|
|
|
name: ${{ env.ARTIFACT_NAME }}
|
2022-01-02 05:22:36 +00:00
|
|
|
path: artifact\
|