Skip to content

Commit 77b1320

Browse files
committed
ci: consume prebuilt libteleproto3 from teleproto3 release lib-v0.8.0 (stop building it from source)
Policy: never build teleproto3 from source in a consumer repo; download the published per-platform artifact from a pinned release/tag. Dockerfile now curls libteleproto3-linux-<arch>.tar.gz from the release (layout lib/{libteleproto3.a, include/}); CI pins TELEPROTO3_REF=lib-v0.8.0 (was the 'main' branch).
1 parent cdc2457 commit 77b1320

2 files changed

Lines changed: 15 additions & 10 deletions

File tree

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,6 @@ jobs:
7272
cache-from: type=gha
7373
cache-to: type=gha,mode=max
7474
build-args: |
75-
TELEPROTO3_REF=main
75+
TELEPROTO3_REF=lib-v0.8.0
7676
TDLIB_REF=teleproto3-support
7777
BOT_API_REF=master

Dockerfile

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,25 +3,30 @@
33
# Image: ghcr.io/ankuper/telegram-bot-api
44
#
55
# Build args let CI pin exact refs.
6-
ARG TELEPROTO3_REF=main
6+
# TELEPROTO3_REF = a teleproto3 RELEASE/TAG (policy: consume the prebuilt artifact,
7+
# never build teleproto3 from source). Pin to a tag, not a branch.
8+
ARG TELEPROTO3_REF=lib-v0.8.0
79
ARG TDLIB_REF=teleproto3-support
810
ARG BOT_API_REF=master
911

1012
# ─── Build stage ──────────────────────────────────────────────────────────────
1113
FROM ubuntu:24.04 AS builder
1214
ENV DEBIAN_FRONTEND=noninteractive
1315
RUN apt-get update && apt-get install -y --no-install-recommends \
14-
cmake g++ make git zlib1g-dev libssl-dev gperf ca-certificates \
16+
cmake g++ make git zlib1g-dev libssl-dev gperf ca-certificates curl \
1517
&& rm -rf /var/lib/apt/lists/*
1618

17-
# 1) libteleproto3 (Type3 client lib) — Option B: build from source, no release artifacts yet.
19+
# 1) libteleproto3 (Type3 client lib) — PREBUILT from the teleproto3 release/tag.
20+
# Policy (docs/release-and-branch-policy.md): never build teleproto3 from source;
21+
# consume the published per-platform artifact. Linux server → libteleproto3-linux-<arch>.tar.gz
22+
# (archive layout: lib/{libteleproto3.a,include/}).
1823
ARG TELEPROTO3_REF
19-
RUN git clone --depth 1 --branch "${TELEPROTO3_REF}" \
20-
https://github.com/ankuper/teleproto3.git /teleproto3 \
21-
&& cmake -S /teleproto3/lib -B /teleproto3/lib/build -DCMAKE_BUILD_TYPE=Release \
22-
&& cmake --build /teleproto3/lib/build -j"$(nproc)" \
23-
&& cp /teleproto3/lib/build/libteleproto3.a /usr/local/lib/libteleproto3.a \
24-
&& cp /teleproto3/lib/include/t3.h /usr/local/include/t3.h
24+
RUN ARCH="$(uname -m)" \
25+
&& curl -fsSL "https://github.com/ankuper/teleproto3/releases/download/${TELEPROTO3_REF}/libteleproto3-linux-${ARCH}.tar.gz" \
26+
-o /tmp/libteleproto3.tar.gz \
27+
&& mkdir -p /teleproto3 && tar xzf /tmp/libteleproto3.tar.gz -C /teleproto3 \
28+
&& cp /teleproto3/lib/libteleproto3.a /usr/local/lib/libteleproto3.a \
29+
&& cp -r /teleproto3/lib/include/. /usr/local/include/
2530

2631
# 2) telegram-bot-api with our Type3-patched TDLib swapped in for the td/ submodule.
2732
ARG BOT_API_REF

0 commit comments

Comments
 (0)