4fc0fa9eaf
Use eva for scheduled bump commits; push still via job token.
43 lines
1.6 KiB
YAML
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 'eva'
|
|
git config user.email 's1d3sw1ped+eva@gmail.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
|