Wait for GitHub release asset before generating AUR PKGBUILD

This commit is contained in:
Sebastian Palencsar
2026-02-23 13:08:54 +01:00
parent 29ab78799c
commit 97b0e0bf1e

View File

@@ -25,6 +25,19 @@ trap 'rm -rf "${tmp_dir}"' EXIT
asset_path="${tmp_dir}/deskify-linux-x86_64" asset_path="${tmp_dir}/deskify-linux-x86_64"
license_path="${tmp_dir}/LICENSE" license_path="${tmp_dir}/LICENSE"
wait_seconds="${WAIT_FOR_ASSET_SECONDS:-300}"
interval_seconds="${WAIT_FOR_ASSET_INTERVAL_SECONDS:-5}"
deadline=$((SECONDS + wait_seconds))
while ! curl -fsI "${ASSET_URL}" >/dev/null 2>&1; do
if (( SECONDS >= deadline )); then
echo "Error: release asset not available yet: ${ASSET_URL}" >&2
echo "Tip: the GitHub Release workflow may still be building. Re-run the AUR workflow once the asset exists." >&2
exit 1
fi
sleep "${interval_seconds}"
done
curl -fL -o "${asset_path}" "${ASSET_URL}" curl -fL -o "${asset_path}" "${ASSET_URL}"
curl -fL -o "${license_path}" "${LICENSE_URL}" curl -fL -o "${license_path}" "${LICENSE_URL}"