Make TDLib workflow handle arbitrary refs

This commit is contained in:
2026-04-24 14:04:39 +03:00
parent dd905ea248
commit b09c0eb90b

View File

@@ -59,6 +59,7 @@ jobs:
version="$ref"
version="${version#v}"
version="${version//\//-}"
archive="tdlib-${version}-linux-x86_64.tar.gz"
{
@@ -75,7 +76,22 @@ jobs:
archive="${{ steps.tdlib.outputs.archive }}"
rm -rf tdlib-src tdlib-build dist
git clone --depth 1 --branch "$ref" "$TDLIB_REPO" tdlib-src
git init tdlib-src
cd tdlib-src
git remote add origin "$TDLIB_REPO"
git fetch --depth 1 origin \
"refs/tags/${ref}:refs/tags/${ref}" \
"refs/heads/${ref}:refs/remotes/origin/${ref}" || true
if git rev-parse --verify --quiet "refs/tags/${ref}" >/dev/null; then
git checkout --detach "refs/tags/${ref}"
elif git rev-parse --verify --quiet "refs/remotes/origin/${ref}" >/dev/null; then
git checkout --detach "refs/remotes/origin/${ref}"
else
git fetch --depth 1 origin "$ref"
git checkout --detach FETCH_HEAD
fi
cd ..
cmake -S tdlib-src -B tdlib-build \
-DCMAKE_BUILD_TYPE=Release \