mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-09-04 11:03:14 +02:00
add cache
This commit is contained in:
parent
c248775e7d
commit
4c926115ad
1 changed files with 31 additions and 32 deletions
63
.github/workflows/flatpak-build.yml
vendored
63
.github/workflows/flatpak-build.yml
vendored
|
@ -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 '/<releases>/a \
|
||||
<release version="${{ env.APP_VERSION }}" date="'"$CURRENT_DATE"'">\
|
||||
<description>\
|
||||
<p>Автоматическая сборка Flatpak. Синхронизировано с upstream-тегом ${{ env.LATEST_TAG }}.</p>\
|
||||
</description>\
|
||||
</release>' "$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: |
|
||||
|
|
Loading…
Add table
Reference in a new issue