47 lines
1.1 KiB
Bash
Executable File
47 lines
1.1 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
version="${1:?version required}"
|
|
tag="${2:?release tag required}"
|
|
|
|
echo "==> Resolving exact tdlib commit from ${tag}"
|
|
td_commit="$(./scripts/get-tdlib-commit.sh "$tag")"
|
|
echo "tdlib commit: ${td_commit}"
|
|
|
|
./scripts/update-pkgbuild.sh "$version" "$td_commit"
|
|
|
|
rm -rf src pkg build
|
|
|
|
echo "==> Building ${version} with makepkg"
|
|
|
|
# AyuGram is a very large C++ project. Limit parallelism to avoid OOM on
|
|
# smaller runners. Override with AYUGRAM_JOBS if your runner has more RAM.
|
|
jobs="${AYUGRAM_JOBS:-$(nproc)}"
|
|
export CMAKE_BUILD_PARALLEL_LEVEL="$jobs"
|
|
|
|
# makepkg must not be run as root.
|
|
if [[ "$(id -u)" -eq 0 ]]; then
|
|
echo "ERROR: makepkg must run as an unprivileged user." >&2
|
|
exit 1
|
|
fi
|
|
|
|
makepkg \
|
|
--syncdeps \
|
|
--cleanbuild \
|
|
--clean \
|
|
--noconfirm \
|
|
--skippgpcheck
|
|
|
|
pkg="$(find . -maxdepth 1 -type f -name '*.pkg.tar.zst' -print -quit)"
|
|
|
|
[[ -n "$pkg" ]] || {
|
|
echo "ERROR: no package produced" >&2
|
|
exit 1
|
|
}
|
|
|
|
echo "PACKAGE=$pkg" >> "$GITHUB_OUTPUT"
|
|
echo "VERSION=$version" >> "$GITHUB_OUTPUT"
|
|
echo "TD_COMMIT=$td_commit" >> "$GITHUB_OUTPUT"
|
|
|
|
echo "==> Package: $pkg"
|