Skip to content

Commit def2338

Browse files
committed
Update CI workflow to build and upload artifacts for both x86_64 and arm64 architectures. Rename x86_64 job and adjust installation commands. Add new arm64 build job and release step to handle multiple artifacts.
1 parent 2210f10 commit def2338

File tree

1 file changed

+53
-7
lines changed

1 file changed

+53
-7
lines changed

.github/workflows/CI.yml

Lines changed: 53 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
- "aiotdlib_*"
88

99
jobs:
10-
build_ubuntu:
10+
build_ubuntu_x86_64:
1111
name: Build Linux x86_64
1212
runs-on: ubuntu-24.04
1313
steps:
@@ -16,20 +16,66 @@ jobs:
1616
with:
1717
path: tdlib
1818

19-
- name: Build TDLib
19+
- name: Build TDLib x86_64
2020
env:
2121
CXXFLAGS: "-stdlib=libc++"
2222
CC: "/usr/bin/clang-18"
2323
CXX: "/usr/bin/clang++-18"
2424
run: |
25-
sudo apt-get install make zlib1g-dev libssl-dev gperf php-cli cmake clang-14 libc++-dev libc++abi-dev
25+
sudo apt-get update && sudo apt-get install -y --no-install-recommends make zlib1g-dev libssl-dev gperf php-cli cmake clang-18 libc++-18-dev libc++abi-18-dev
2626
mkdir build
27-
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX:PATH=../tdlib -DTD_ENABLE_LTO=ON -DCMAKE_AR=/usr/bin/llvm-ar-18 -DCMAKE_NM=/usr/bin/llvm-nm-18 -DCMAKE_OBJDUMP=/usr/bin/llvm-objdump-18 -DCMAKE_RANLIB=/usr/bin/llvm-ranlib-18 -S ./tdlib -B ./build
28-
cmake --build ./build --target tdjson --parallel 2
27+
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX:PATH=../tdlib_install_x86_64 -DTD_ENABLE_LTO=ON -DCMAKE_AR=/usr/bin/llvm-ar-18 -DCMAKE_NM=/usr/bin/llvm-nm-18 -DCMAKE_OBJDUMP=/usr/bin/llvm-objdump-18 -DCMAKE_RANLIB=/usr/bin/llvm-ranlib-18 -S ./tdlib -B ./build
28+
cmake --build ./build --target tdjson --parallel $(nproc)
2929
strip --strip-all ./build/libtdjson.so.*
3030
mv -v ./build/libtdjson.so.* ./build/libtdjson_linux_amd64.so
3131
32+
- name: Upload x86_64 artifact
33+
uses: actions/upload-artifact@v4
34+
with:
35+
name: tdjson-x86_64
36+
path: build/libtdjson_linux_amd64.so
37+
38+
build_ubuntu_arm64:
39+
name: Build Linux arm64
40+
runs-on: ubuntu-latest-arm64
41+
steps:
42+
- name: Check out repository
43+
uses: actions/checkout@v4
44+
with:
45+
path: tdlib
46+
47+
- name: Build TDLib arm64
48+
env:
49+
CXXFLAGS: "-stdlib=libc++"
50+
CC: "/usr/bin/clang-18"
51+
CXX: "/usr/bin/clang++-18"
52+
run: |
53+
sudo apt-get update && sudo apt-get install -y --no-install-recommends make zlib1g-dev libssl-dev gperf php-cli cmake clang-18 libc++-18-dev libc++abi-18-dev
54+
mkdir build
55+
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX:PATH=../tdlib_install_arm64 -DTD_ENABLE_LTO=ON -DCMAKE_AR=/usr/bin/llvm-ar-18 -DCMAKE_NM=/usr/bin/llvm-nm-18 -DCMAKE_OBJDUMP=/usr/bin/llvm-objdump-18 -DCMAKE_RANLIB=/usr/bin/llvm-ranlib-18 -S ./tdlib -B ./build
56+
cmake --build ./build --target tdjson --parallel $(nproc)
57+
strip --strip-all ./build/libtdjson.so.*
58+
mv -v ./build/libtdjson.so.* ./build/libtdjson_linux_arm64.so
59+
60+
- name: Upload arm64 artifact
61+
uses: actions/upload-artifact@v4
62+
with:
63+
name: tdjson-arm64
64+
path: build/libtdjson_linux_arm64.so
65+
66+
release:
67+
name: Release artifacts
68+
needs: [build_ubuntu_x86_64, build_ubuntu_arm64]
69+
runs-on: ubuntu-latest
70+
steps:
71+
- name: Download all artifacts
72+
uses: actions/download-artifact@v4
73+
with:
74+
path: artifacts
75+
3276
- name: Release artifacts to packages
33-
uses: softprops/action-gh-release@v1
77+
uses: softprops/action-gh-release@v2
3478
with:
35-
files: build/libtdjson_linux_amd64.so
79+
files: |
80+
artifacts/tdjson-x86_64/libtdjson_linux_amd64.so
81+
artifacts/tdjson-arm64/libtdjson_linux_arm64.so

0 commit comments

Comments
 (0)