diff --git a/.github/workflows/flatpak-build.yml b/.github/workflows/flatpak-build.yml index daec4e3409..b3bfc0d7a3 100644 --- a/.github/workflows/flatpak-build.yml +++ b/.github/workflows/flatpak-build.yml @@ -51,15 +51,20 @@ jobs: - name: Update metainfo.xml with new release run: | + # Путь к файлу метаданных METAINFO_FILE="docs/assets/flatpak-files/usr/share/metainfo/com.ayugram.desktop.metainfo.xml" + # Получаем текущую дату в нужном формате CURRENT_DATE=$(date +%Y-%m-%d) + echo "Обновление $METAINFO_FILE для версии ${{ env.APP_VERSION }} от $CURRENT_DATE" + sed -i '//a \ \ \

Автоматическая сборка Flatpak. Синхронизировано с upstream-тегом ${{ env.LATEST_TAG }}.

\
\
' "$METAINFO_FILE" + echo "Файл metainfo.xml успешно обновлен." - name: Verify that required secrets are set @@ -73,7 +78,7 @@ jobs: - name: Install dependencies and Flatpak SDK run: | - sudo dnf install -y flatpak flatpak-builder python3-pip cpio + sudo dnf install -y flatpak flatpak-builder python3-pip pip3 install --user poetry echo "$HOME/.local/bin" >> $GITHUB_PATH flatpak remote-add --user --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo @@ -89,45 +94,39 @@ jobs: - name: Prepare libraries run: ./Telegram/build/prepare/linux.sh - - - name: Prepare ccache binary for the container - run: | - mkdir -p ${{ github.workspace }}/ccache-bin - cd ${{ github.workspace }}/ccache-bin - curl -L -o ccache.rpm http://mirror.centos.org/centos/8-stream/AppStream/x86_64/os/Packages/ccache-3.7.7-1.el8.x86_64.rpm - rpm2cpio ccache.rpm | cpio -idmv ./usr/bin/ccache - mv usr/bin/ccache . - rm -rf usr ccache.rpm - echo "ccache binary is ready at ${{ github.workspace }}/ccache-bin/ccache" - - - name: Cache ccache directory + + - name: Cache ccache data uses: actions/cache@v4 + id: cache-ccache with: - path: ${{ github.workspace }}/.ccache - key: ${{ runner.os }}-ccache-ayugram-${{ github.ref }} + path: .ccache + key: ${{ runner.os }}-ccache-${{ github.sha }} restore-keys: | - ${{ runner.os }}-ccache-ayugram- + ${{ runner.os }}-ccache- - name: Build AyuGram binary env: - TDESKTOP_API_ID: ${{ secrets.TDESKTOP_API_ID }} - TDESKTOP_API_HASH: ${{ secrets.TDESKTOP_API_HASH }} + TDESKTOP_API_ID: ${{ secrets.TDESKTOP_API_ID }} + TDESKTOP_API_HASH: ${{ secrets.TDESKTOP_API_HASH }} + CCACHE_DIR: /ccache + CCACHE_MAXSIZE: 3G run: | - mkdir -p ${{ github.workspace }}/.ccache - docker run --rm \ - --cpus="3" \ - -u $(id -u):$(id -g) \ - -v "$PWD:/usr/src/tdesktop" \ - -v "${{ github.workspace }}/ccache-bin:/opt/ccache-bin" \ - -v "${{ github.workspace }}/.ccache:/ccache" \ - -e CCACHE_DIR="/ccache" \ - -e PATH="/opt/ccache-bin:$PATH" \ - ghcr.io/telegramdesktop/tdesktop/centos_env:latest \ + mkdir -p .ccache + docker run --rm \ + --cpus="3" \ + -u $(id -u):$(id -g) \ + -v "$PWD:/usr/src/tdesktop" \ + -v "$PWD/.ccache:/ccache" \ + -e CCACHE_DIR \ + -e CCACHE_MAXSIZE \ + ghcr.io/telegramdesktop/tdesktop/centos_env:latest \ + /bin/bash -c "\ + set -ex && \ /usr/src/tdesktop/Telegram/build/docker/centos_env/build.sh \ - -D TDESKTOP_API_ID=${TDESKTOP_API_ID} \ - -D TDESKTOP_API_HASH=${TDESKTOP_API_HASH} \ - -D CMAKE_CXX_COMPILER_LAUNCHER=ccache \ - -D CMAKE_C_COMPILER_LAUNCHER=ccache + -D TDESKTOP_API_ID=${TDESKTOP_API_ID} \ + -D TDESKTOP_API_HASH=${TDESKTOP_API_HASH} \ + -D USE_CCACHE=ON && \ + ccache -s" # Отображение статистики использования кеша - name: Prepare Flatpak build directory run: |