Make TDLib workflow handle arbitrary refs
This commit is contained in:
@@ -59,6 +59,7 @@ jobs:
|
|||||||
|
|
||||||
version="$ref"
|
version="$ref"
|
||||||
version="${version#v}"
|
version="${version#v}"
|
||||||
|
version="${version//\//-}"
|
||||||
archive="tdlib-${version}-linux-x86_64.tar.gz"
|
archive="tdlib-${version}-linux-x86_64.tar.gz"
|
||||||
|
|
||||||
{
|
{
|
||||||
@@ -75,7 +76,22 @@ jobs:
|
|||||||
archive="${{ steps.tdlib.outputs.archive }}"
|
archive="${{ steps.tdlib.outputs.archive }}"
|
||||||
|
|
||||||
rm -rf tdlib-src tdlib-build dist
|
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 \
|
cmake -S tdlib-src -B tdlib-build \
|
||||||
-DCMAKE_BUILD_TYPE=Release \
|
-DCMAKE_BUILD_TYPE=Release \
|
||||||
|
|||||||
Reference in New Issue
Block a user