mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2026-08-01 17:57:51 +00:00
0502acc8a4
# Conflicts: # README.md # Telegram/Resources/winrc/Telegram.rc # Telegram/Resources/winrc/Updater.rc # Telegram/SourceFiles/apiwrap.cpp # Telegram/SourceFiles/core/version.h # Telegram/SourceFiles/data/data_stories.cpp # Telegram/SourceFiles/platform/win/windows_app_user_model_id.cpp # Telegram/lib_ui # snap/snapcraft.yaml
193 lines
5.5 KiB
YAML
193 lines
5.5 KiB
YAML
name: Windows.
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
push:
|
|
paths-ignore:
|
|
- 'docs/**'
|
|
- '**.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'
|
|
- '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: windows-2022
|
|
|
|
strategy:
|
|
matrix:
|
|
arch: [Win32]
|
|
|
|
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%
|
|
|
|
- name: Get repository name.
|
|
shell: bash
|
|
run: echo "REPO_NAME=${GITHUB_REPOSITORY##*/}" >> $GITHUB_ENV
|
|
|
|
- uses: ilammy/msvc-dev-cmd@v1.12.0
|
|
name: Native Tools Command Prompt.
|
|
with:
|
|
arch: ${{ matrix.arch }}
|
|
|
|
- name: Clone.
|
|
uses: actions/checkout@v3.1.0
|
|
with:
|
|
submodules: recursive
|
|
path: ${{ env.TBUILD }}\${{ env.REPO_NAME }}
|
|
|
|
- name: Set up environment paths.
|
|
shell: bash
|
|
run: |
|
|
echo "CACHE_KEY=$(sha256sum $TBUILD/$REPO_NAME/$PREPARE_PATH | 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: 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: Libraries cache.
|
|
id: cache-libs
|
|
uses: actions/cache@v3.0.11
|
|
with:
|
|
path: ${{ env.TBUILD }}\Libraries
|
|
key: ${{ runner.OS }}-${{ matrix.arch }}-libs-${{ env.CACHE_KEY }}
|
|
restore-keys: ${{ runner.OS }}-${{ matrix.arch }}-libs-
|
|
|
|
- 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
|
|
|
|
- name: Read defines.
|
|
shell: bash
|
|
run: |
|
|
DEFINE=""
|
|
if [ -n "${{ matrix.defines }}" ]; then
|
|
DEFINE="-D ${{ matrix.defines }}=ON"
|
|
echo "Define from matrix: $DEFINE"
|
|
echo "ARTIFACT_NAME=Telegram_${{ matrix.arch }}_${{ matrix.defines }}" >> $GITHUB_ENV
|
|
else
|
|
echo "ARTIFACT_NAME=Telegram_${{ matrix.arch }}" >> $GITHUB_ENV
|
|
fi
|
|
echo "TDESKTOP_BUILD_DEFINE=$DEFINE" >> $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.
|
|
run: |
|
|
cd %TBUILD%
|
|
del /S Libraries\*.pdb
|
|
del /S Libraries\*.pch
|
|
del /S Libraries\*.obj
|
|
|
|
- name: Telegram Desktop build.
|
|
if: env.ONLY_CACHE == 'false'
|
|
run: |
|
|
cd %TBUILD%\%REPO_NAME%\Telegram
|
|
|
|
call configure.bat ^
|
|
${{ matrix.arch }} ^
|
|
%TDESKTOP_BUILD_API% ^
|
|
-D DESKTOP_APP_DISABLE_CRASH_REPORTS=OFF ^
|
|
-D DESKTOP_APP_NO_PDB=ON ^
|
|
%TDESKTOP_BUILD_DEFINE% ^
|
|
-DCMAKE_SYSTEM_VERSION=%SDK%
|
|
|
|
cd ..\out
|
|
msbuild -m Telegram.sln /p:Configuration=Debug,Platform=${{ matrix.arch }},DebugSymbols=false,DebugType=none
|
|
|
|
- name: Move artifact.
|
|
if: (env.UPLOAD_ARTIFACT == 'true') || ${{ github.ref == 'refs/heads/nightly' }}
|
|
run: |
|
|
mkdir artifact
|
|
move %TBUILD%\%REPO_NAME%\out\Debug\AyuGram.exe artifact/
|
|
- uses: actions/upload-artifact@master
|
|
name: Upload artifact.
|
|
if: (env.UPLOAD_ARTIFACT == 'true') || ${{ github.ref == 'refs/heads/nightly' }}
|
|
with:
|
|
name: ${{ env.ARTIFACT_NAME }}
|
|
path: artifact\
|
|
|
|
release:
|
|
name: Release
|
|
needs: [windows]
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
fail-fast: true
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Merge Releases
|
|
uses: actions/download-artifact@v2
|
|
with:
|
|
name: Telegram_Win32
|
|
path: artifact
|
|
|
|
- name: Upload release
|
|
uses: Hs1r1us/Release-AIO@v1.0
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
with:
|
|
# The name of the tag
|
|
tag_name: prelease-${{ github.run_number }}
|
|
prerelease: true
|
|
release_name: Ayugram CI
|
|
asset_files: './artifact'
|