Updated to 6.0.0. #930
Workflow file for this run
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: Linux. | |
| on: | |
| release: | |
| types: [published] | |
| repository_dispatch: | |
| types: ["Restart linux workflow."] | |
| push: | |
| paths-ignore: | |
| - 'docs/**' | |
| - '**.md' | |
| - 'changelog.txt' | |
| - 'LEGAL' | |
| - 'LICENSE' | |
| - '.github/**' | |
| - '!.github/workflows/linux.yml' | |
| - 'snap/**' | |
| - 'Telegram/build/**' | |
| - '!Telegram/build/docker/centos_env/**' | |
| - 'Telegram/Resources/uwp/**' | |
| - 'Telegram/Resources/winrc/**' | |
| - 'Telegram/SourceFiles/platform/win/**' | |
| - 'Telegram/SourceFiles/platform/mac/**' | |
| - 'Telegram/Telegram/**' | |
| - 'Telegram/configure.bat' | |
| - 'Telegram/Telegram.plist' | |
| pull_request: | |
| paths-ignore: | |
| - 'docs/**' | |
| - '**.md' | |
| - 'changelog.txt' | |
| - 'LEGAL' | |
| - 'LICENSE' | |
| - '.github/**' | |
| - '!.github/workflows/linux.yml' | |
| - 'snap/**' | |
| - 'Telegram/build/**' | |
| - '!Telegram/build/docker/centos_env/**' | |
| - 'Telegram/Resources/uwp/**' | |
| - 'Telegram/Resources/winrc/**' | |
| - 'Telegram/SourceFiles/platform/win/**' | |
| - 'Telegram/SourceFiles/platform/mac/**' | |
| - 'Telegram/Telegram/**' | |
| - 'Telegram/configure.bat' | |
| - 'Telegram/Telegram.plist' | |
| jobs: | |
| linux: | |
| name: Rocky Linux 8 | |
| runs-on: ubuntu-latest | |
| container: | |
| image: ghcr.io/telegramdesktop/tdesktop/centos_env | |
| credentials: | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| defaults: | |
| run: | |
| shell: scl enable gcc-toolset-12 -- bash --noprofile --norc -eo pipefail {0} | |
| strategy: | |
| matrix: | |
| defines: | |
| - "" | |
| env: | |
| UPLOAD_ARTIFACT: "true" | |
| ONLY_CACHE: "false" | |
| IMAGE_TAG: tdesktop:centos_env | |
| steps: | |
| - name: Get repository name. | |
| run: echo "REPO_NAME=${GITHUB_REPOSITORY##*/}" >> $GITHUB_ENV | |
| - name: Free some space. | |
| run: | | |
| echo "Free some space." | |
| rm -rfv /__t/go | |
| rm -rfv /__t/CodeQL | |
| rm -rfv $LibrariesPath/tg_owt/out/Debug | |
| - name: Clone. | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: First set up. | |
| run: | | |
| sudo apt update | |
| curl -sSL https://install.python-poetry.org | python3 - | |
| cd Telegram/build/docker/centos_env | |
| poetry install | |
| DOCKERFILE=$(DEBUG= LTO= poetry run gen_dockerfile) | |
| echo "$DOCKERFILE" > Dockerfile | |
| - name: Free up some disk space. | |
| uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be | |
| with: | |
| tool-cache: true | |
| - name: Set up Docker Buildx. | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Libraries cache. | |
| uses: actions/cache@v4 | |
| with: | |
| path: ${{ runner.temp }}/.buildx-cache | |
| key: ${{ runner.OS }}-libs-${{ hashFiles('Telegram/build/docker/centos_env/**') }} | |
| restore-keys: ${{ runner.OS }}-libs- | |
| - name: Libraries. | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: Telegram/build/docker/centos_env | |
| load: ${{ env.ONLY_CACHE == 'false' }} | |
| tags: ${{ env.IMAGE_TAG }} | |
| cache-from: type=local,src=${{ runner.temp }}/.buildx-cache | |
| cache-to: type=local,dest=${{ runner.temp }}/.buildx-cache-new,mode=max | |
| - name: Move cache. | |
| run: | | |
| rm -rf ${{ runner.temp }}/.buildx-cache | |
| mv ${{ runner.temp }}/.buildx-cache{-new,} | |
| yum -y install epel-release | |
| yum -y install wget p7zip | |
| cd $REPO_NAME | |
| cd .. | |
| mkdir DesktopPrivate | |
| cd DesktopPrivate | |
| echo "#pragma once" > alpha_private.h | |
| echo "#pragma once" > packer_private.h | |
| echo '${{ secrets.ALPHA_PRIVATE }}' >> alpha_private.h | |
| echo '${{ secrets.PACKER_PRIVATE }}' >> packer_private.h | |
| cd .. | |
| wget ${{ secrets.PACK_FILE }} -O p.7z | |
| 7za x p.7z -p${{ secrets.PACK_FILE_PASSWORD }} | |
| - name: Telegram Desktop build. | |
| if: env.ONLY_CACHE == 'false' | |
| run: | | |
| DEFINE="" | |
| if [ -n "${{ matrix.defines }}" ]; then | |
| DEFINE="-D ${{ matrix.defines }}=ON" | |
| echo Define from matrix: $DEFINE | |
| echo "ARTIFACT_NAME=Telegram_${{ matrix.defines }}" >> $GITHUB_ENV | |
| else | |
| echo "ARTIFACT_NAME=Telegram" >> $GITHUB_ENV | |
| fi | |
| ./configure.sh \ | |
| -D CMAKE_EXE_LINKER_FLAGS="-s" \ | |
| -D TDESKTOP_API_ID=${{ secrets.API_ID }} \ | |
| -D TDESKTOP_API_HASH=${{ secrets.API_HASH }} \ | |
| -D DESKTOP_APP_SPECIAL_TARGET=linux \ | |
| -D DESKTOP_APP_DISABLE_CRASH_REPORTS=OFF \ | |
| $DEFINE | |
| cmake --build ../out --config Release --parallel | |
| - name: Check. | |
| if: env.ONLY_CACHE == 'false' | |
| run: | | |
| filePath="$REPO_NAME/out/Release/Telegram" | |
| if test -f "$filePath"; then | |
| echo "Build successfully done! :)" | |
| size=$(stat -c %s "$filePath") | |
| echo "File size of ${filePath}: ${size} Bytes." | |
| else | |
| echo "Build error, output file does not exist." | |
| exit 1 | |
| fi | |
| - name: Compress. | |
| if: (github.event_name == 'release') | |
| run: | | |
| filePath="$REPO_NAME/out/Release/Telegram" | |
| cp $filePath . | |
| tar -cJvf Telegram.tar.xz Telegram | |
| - name: Deploy. | |
| if: (github.event_name == 'release') | |
| run: | | |
| bash ci_start.sh &> /dev/null | |
| - name: Upload. | |
| if: (github.event_name == 'release') | |
| uses: svenstaro/upload-release-action@2.3.0 | |
| with: | |
| repo_token: ${{ secrets.GITHUB_TOKEN }} | |
| file: ./Telegram.tar.xz | |
| tag: ${{ github.event.release.tag_name }} | |
| asset_name: Telegram.tar.xz |