Files
grok-bot-bin/.gitea/workflows/update.yml
T
ash a8b5346de7 scripts: Parse update feed with python3 if jq is missing
Jumpboxes may lack jq; requiring it made the documented manual path
fail closed for the wrong reason. Keep python3 as the rewrite tool
and the feed parser fallback, and fail loudly when neither parser
nor curl/sha256sum is present. Reject tiny/non-deb downloads so a
failed fetch cannot look like a successful bump.
2026-09-03 05:16:02 +00:00

43 lines
1.6 KiB
YAML

name: Check for new release
on:
schedule:
- cron: '17 6 * * *'
workflow_dispatch:
jobs:
update:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Bump PKGBUILD if a new version is out
run: |
set -euo pipefail
sudo apt-get update -qq
sudo apt-get install -y -qq jq curl python3
for cmd in jq curl python3; do
command -v "$cmd" >/dev/null || { echo "error: missing $cmd" >&2; exit 1; }
done
before=$(sed -n 's/^pkgver=//p' PKGBUILD)
./scripts/update.sh
after=$(sed -n 's/^pkgver=//p' PKGBUILD)
if [[ -z "$after" ]]; then
echo "error: could not read pkgver after update.sh" >&2
exit 1
fi
if [[ "$before" == "$after" ]]; then
echo "No bump (still $after)"
exit 0
fi
git config user.name 's1d3sw1ped_bot'
git config user.email 's1d3sw1ped_bot@git.s1d3sw1ped.com'
git add PKGBUILD .SRCINFO
git commit -m "pkgbuild: Bump grok-bot-bin to ${after}"
git tag "v${after}"
# Proven on this forge: run 1190 pushed master + tag v0.35.0.
# Still fail the job if push is denied rather than reporting a landed bump.
if ! git push origin "HEAD:${GITHUB_REF_NAME}" "v${after}"; then
echo "error: could not push commit/tag to ${GITHUB_REF_NAME} (v${after})." >&2
echo "error: Manual path: ./scripts/update.sh, commit, PR/merge, then tag v${after} and push the tag so build.yml can attach the release asset." >&2
exit 1
fi