Skip to content

chore: Bump TDLib version #227

chore: Bump TDLib version

chore: Bump TDLib version #227

Workflow file for this run

name: Build
on: [push, workflow_dispatch]
jobs:
build:
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
compiler: [gcc, types]
steps:
- name: Checkout
uses: actions/checkout@v2
with:
submodules: recursive
- name: Install dependency
run: |
sudo apt-get install -y gperf libssl-dev zlib1g-dev doxygen libc++-dev libc++abi-dev
- name: Set up Clang
uses: egor-tensin/setup-clang@v1
if: matrix.compiler == 'clang'
with:
version: 14
platform: x64
- name: Build TDLib
if: matrix.compiler != 'types'
run: |
mkdir build
cd build
mkdir -p ../out
if [ "$MATRIX_COMPILER" == "clang" ]; then
export CXX=clang++-14
export CC=clang-14
export CXXFLAGS="-stdlib=libc++"
which llvm-ar-14
which llvm-nm-14
cmake -DCMAKE_BUILD_TYPE=Release -DTD_ENABLE_LTO=ON \
-DCMAKE_AR=llvm-ar-14 -DCMAKE_NM=llvm-nm-14 \
-DCMAKE_OBJDUMP=llvm-objdump-14 -DCMAKE_RANLIB=llvm-ranlib-14 \
..
cmake --build . --target tdlib_json_cli -- -j2
else
cmake -DCMAKE_BUILD_TYPE=Release -DTD_ENABLE_LTO=ON ..
cmake --build . --target tdlib_json_cli -- -j2
fi
mv ./bin/tdlib_json_cli ../out/tdlib_json_cli-linux-$MATRIX_COMPILER
env:
MATRIX_COMPILER: ${{ matrix.compiler }}
- name: Build Types
if: matrix.compiler == 'types'
run: |
cd td
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
cmake --build . --target prepare_cross_compiling -- -j2
cd ..
echo "start doxygen ..."
time doxygen
cd ..
cd types-generator
npm i
cd ..
node ./types-generator/index.js
mkdir -p out
mv types.json out/types.json
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: out-${{ matrix.compiler }}
path: out
release:
name: Release
runs-on: ubuntu-latest
needs: [build]
if: startsWith(github.ref, 'refs/tags/')
steps:
- name: Download artifacts
uses: actions/download-artifact@v1
with:
name: out-clang
- name: Download artifacts
uses: actions/download-artifact@v1
with:
name: out-gcc
- name: Download artifacts
uses: actions/download-artifact@v1
with:
name: out-types
- name: Move binaries
run: |
mkdir -p out
mv out-*/* out/
- name: Release
uses: fnkr/github-action-ghr@v1
env:
GHR_PATH: out/
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}