mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-09-06 20:13:12 +02:00
add build ccache
This commit is contained in:
parent
875436ce96
commit
71248c7d95
1 changed files with 56 additions and 58 deletions
102
.github/workflows/flatpak-build.yml
vendored
102
.github/workflows/flatpak-build.yml
vendored
|
@ -85,79 +85,77 @@ jobs:
|
||||||
flatpak install --user -y --noninteractive org.gnome.Sdk//48
|
flatpak install --user -y --noninteractive org.gnome.Sdk//48
|
||||||
flatpak install --user -y --noninteractive org.gnome.Platform//48
|
flatpak install --user -y --noninteractive org.gnome.Platform//48
|
||||||
|
|
||||||
- name: Build static ccache if not cached
|
- name: Build static ccache if not cached
|
||||||
id: static-ccache
|
id: static-ccache
|
||||||
uses: actions/cache@v4
|
uses: actions/cache@v4
|
||||||
with:
|
with:
|
||||||
path: ${{ github.workspace }}/ccache-static/ccache
|
path: ${{ github.workspace }}/ccache-static/ccache
|
||||||
key: ${{ runner.os }}-static-ccache-v1
|
key: ${{ runner.os }}-static-ccache-v2
|
||||||
|
|
||||||
- name: Build static ccache
|
- name: Build static ccache
|
||||||
if: steps.static-ccache.outputs.cache-hit != 'true'
|
if: steps.static-ccache.outputs.cache-hit != 'true'
|
||||||
run: |
|
run: |
|
||||||
echo "Статический ccache не найден в кэше, собираем его..."
|
sudo dnf install -y gcc-c++ cmake git zlib-devel libzstd-devel fmt-devel
|
||||||
sudo dnf install -y gcc-c++ cmake git zlib-devel libzstd-devel fmt-devel
|
git clone --depth=1 --branch v4.10 https://github.com/ccache/ccache.git ccache-source
|
||||||
|
cd ccache-source
|
||||||
git clone --depth=1 --branch v4.10 https://github.com/ccache/ccache.git ccache-source
|
mkdir build && cd build
|
||||||
cd ccache-source
|
cmake .. \
|
||||||
|
-DCMAKE_BUILD_TYPE=Release \
|
||||||
mkdir build && cd build
|
-DBUILD_SHARED_LIBS=OFF \
|
||||||
|
-DENABLE_TESTING=OFF \
|
||||||
cmake .. \
|
-DHIREDIS_FROM_INTERNET=ON \
|
||||||
-DCMAKE_BUILD_TYPE=Release \
|
-DCMAKE_EXE_LINKER_FLAGS="-static -static-libgcc -static-libstdc++" \
|
||||||
-DBUILD_SHARED_LIBS=OFF \
|
-DCMAKE_FIND_ROOT_PATH_MODE_PACKAGE=ONLY
|
||||||
-DSTATIC_LINKING=ON \
|
cmake --build . -j$(nproc)
|
||||||
-DENABLE_TESTING=OFF
|
mkdir -p ${{ github.workspace }}/ccache-static
|
||||||
|
cp ./ccache ${{ github.workspace }}/ccache-static/ccache
|
||||||
cmake --build . -j$(nproc)
|
|
||||||
|
|
||||||
mkdir -p ${{ github.workspace }}/ccache-static
|
|
||||||
cp ./ccache ${{ github.workspace }}/ccache-static/ccache
|
|
||||||
echo "Статический ccache успешно собран."
|
|
||||||
|
|
||||||
- name: Cache TDesktop Dependencies
|
- name: Cache TDesktop Dependencies
|
||||||
id: cache-tdesktop-deps
|
id: cache-tdesktop-deps
|
||||||
uses: actions/cache@v4
|
uses: actions/cache@v4
|
||||||
with:
|
with:
|
||||||
path: Telegram/ThirdParty
|
path: Telegram/ThirdParty
|
||||||
key: ${{ runner.os }}-tdeps-${{ hashFiles('Telegram/build/prepare/dependencies.txt') }}
|
key: ${{ runner.os }}-tdeps-${{ hashFiles('Telegram/build/prepare/dependencies.txt') }}
|
||||||
|
|
||||||
- name: Install ccache on runner
|
|
||||||
run: |
|
|
||||||
sudo dnf install -y ccache
|
|
||||||
|
|
||||||
- name: Cache ccache directory
|
- name: Cache ccache directory
|
||||||
uses: actions/cache@v4
|
uses: actions/cache@v4
|
||||||
with:
|
with:
|
||||||
path: ${{ github.workspace }}/.ccache
|
path: ${{ github.workspace }}/.ccache
|
||||||
key: ${{ runner.os }}-ccache-${{ github.sha }}
|
key: ${{ runner.os }}-ccache-${{ github.sha }}
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
${{ runner.os }}-ccache-
|
${{ runner.os }}-ccache-
|
||||||
|
|
||||||
- name: Prepare libraries
|
- name: Prepare libraries
|
||||||
run: ./Telegram/build/prepare/linux.sh
|
run: ./Telegram/build/prepare/linux.sh
|
||||||
|
|
||||||
|
- name: Zero ccache statistics before build
|
||||||
|
run: |
|
||||||
|
${{ github.workspace }}/ccache-static/ccache -z --config-path=${{ github.workspace }}/.ccache/ccache.conf
|
||||||
|
|
||||||
- name: Build AyuGram binary
|
- name: Build AyuGram binary
|
||||||
env:
|
env:
|
||||||
TDESKTOP_API_ID: ${{ secrets.TDESKTOP_API_ID }}
|
TDESKTOP_API_ID: ${{ secrets.TDESKTOP_API_ID }}
|
||||||
TDESKTOP_API_HASH: ${{ secrets.TDESKTOP_API_HASH }}
|
TDESKTOP_API_HASH: ${{ secrets.TDESKTOP_API_HASH }}
|
||||||
run: |
|
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-static/ccache:/usr/local/bin/ccache:ro" \
|
||||||
|
-v "${{ github.workspace }}/.ccache:/home/user/.ccache" \
|
||||||
|
-e "CCACHE_DIR=/home/user/.ccache" \
|
||||||
|
ghcr.io/telegramdesktop/tdesktop/centos_env:latest \
|
||||||
|
/usr/src/tdesktop/Telegram/build/docker/centos_env/build.sh \
|
||||||
|
-D CMAKE_C_COMPILER_LAUNCHER=/usr/local/bin/ccache \
|
||||||
|
-D CMAKE_CXX_COMPILER_LAUNCHER=/usr/local/bin/ccache \
|
||||||
|
-D TDESKTOP_API_ID=${TDESKTOP_API_ID} \
|
||||||
|
-D TDESKTOP_API_HASH=${TDESKTOP_API_HASH}
|
||||||
|
|
||||||
mkdir -p ${{ github.workspace }}/.ccache
|
- name: Show ccache statistics and cache size
|
||||||
|
run: |
|
||||||
docker run --rm \
|
${{ github.workspace }}/ccache-static/ccache -s --config-path=${{ github.workspace }}/.ccache/ccache.conf
|
||||||
--cpus="3" \
|
du -sh ${{ github.workspace }}/.ccache
|
||||||
-u $(id -u):$(id -g) \
|
|
||||||
-v "$PWD:/usr/src/tdesktop" \
|
|
||||||
-v "/usr/bin/ccache:/usr/local/bin/ccache:ro" \
|
|
||||||
-v "${{ github.workspace }}/.ccache:/home/user/.ccache" \
|
|
||||||
-e "CCACHE_DIR=/home/user/.ccache" \
|
|
||||||
ghcr.io/telegramdesktop/tdesktop/centos_env:latest \
|
|
||||||
/usr/src/tdesktop/Telegram/build/docker/centos_env/build.sh \
|
|
||||||
-D CMAKE_C_COMPILER_LAUNCHER=/usr/local/bin/ccache \
|
|
||||||
-D CMAKE_CXX_COMPILER_LAUNCHER=/usr/local/bin/ccache \
|
|
||||||
-D TDESKTOP_API_ID=${TDESKTOP_API_ID} \
|
|
||||||
-D TDESKTOP_API_HASH=${TDESKTOP_API_HASH}
|
|
||||||
|
|
||||||
- name: Prepare Flatpak build directory
|
- name: Prepare Flatpak build directory
|
||||||
run: |
|
run: |
|
||||||
|
|
Loading…
Add table
Reference in a new issue