diff --git a/.gitea/workflows/bump.yaml b/.gitea/workflows/bump.yaml
index d0a41ab..6288c08 100644
--- a/.gitea/workflows/bump.yaml
+++ b/.gitea/workflows/bump.yaml
@@ -10,21 +10,53 @@ jobs:
container:
image: gentoo/stage3:amd64-openrc
steps:
+ # Cheap gate: compare the newest upstream release against the newest
+ # committed ebuild using only base-image tools (wget). The expensive
+ # toolchain install + bump below is skipped on the common no-op day, so a
+ # daily run that has nothing to do finishes in seconds instead of minutes.
+ # bump-version.sh re-checks this itself and remains the source of truth.
+ - name: Check whether a bump is needed
+ id: check
+ env:
+ BUMP_TOKEN: ${{ secrets.BUMP_TOKEN }}
+ run: |
+ latest=$(wget -qO- https://gitea.com/gitea/runner/releases.rss \
+ | grep -oE '
v[0-9]+\.[0-9]+\.[0-9]+' \
+ | head -1 | sed -E 's#?title>##g; s/^v//')
+ current=$(wget -qO- --header="Authorization: token ${BUMP_TOKEN}" \
+ "${GITHUB_SERVER_URL}/api/v1/repos/${GITHUB_REPOSITORY}/contents/dev-util/gitea-runner" \
+ | grep -oE '"name": *"gitea-runner-[0-9.]+\.ebuild"' \
+ | sed -E 's#.*gitea-runner-([0-9.]+)\.ebuild.*#\1#' | sort -V | tail -1)
+ echo "upstream=${latest} current=${current}"
+ # Only short-circuit when we are CONFIDENT there is nothing to do
+ # (both versions parsed and current is >= upstream). On any doubt
+ # fall through to the full run and let bump-version.sh decide.
+ if [ -n "$latest" ] && [ -n "$current" ] \
+ && [ "$(printf '%s\n%s\n' "$current" "$latest" | sort -V | tail -1)" = "$current" ]; then
+ echo "needed=false" >> "$GITHUB_OUTPUT"
+ echo "nothing to do (upstream ${latest}, have ${current})"
+ else
+ echo "needed=true" >> "$GITHUB_OUTPUT"
+ fi
+
- name: Sync ::gentoo
+ if: steps.check.outputs.needed == 'true'
run: emerge-webrsync
- name: Configure portage + install tooling
+ if: steps.check.outputs.needed == 'true'
run: |
mkdir -p /etc/portage/repos.conf
printf '[DEFAULT]\nmain-repo = gentoo\n\n[gentoo]\nlocation = /var/db/repos/gentoo\n' \
> /etc/portage/repos.conf/gentoo.conf
- sed -i 's/^verify-signature = true/verify-signature = false/' \
- /etc/portage/binrepos.conf/gentoo.conf
+ sed -i '/^verify-signature/d' /etc/portage/binrepos.conf/gentoo.conf
+ printf '\nverify-signature = false\n' >> /etc/portage/binrepos.conf/gentoo.conf
emerge -q --getbinpkg \
dev-vcs/git net-misc/curl app-arch/xz-utils app-misc/jq \
dev-lang/go dev-util/pkgdev
- name: Check for new release and open PR
+ if: steps.check.outputs.needed == 'true'
env:
BUMP_TOKEN: ${{ secrets.BUMP_TOKEN }}
run: |
diff --git a/.gitea/workflows/ci.yaml b/.gitea/workflows/ci.yaml
index ee20c79..9cdf777 100644
--- a/.gitea/workflows/ci.yaml
+++ b/.gitea/workflows/ci.yaml
@@ -22,8 +22,8 @@ jobs:
mkdir -p /etc/portage/repos.conf
printf '[DEFAULT]\nmain-repo = gentoo\n\n[gentoo]\nlocation = /var/db/repos/gentoo\n' \
> /etc/portage/repos.conf/gentoo.conf
- sed -i 's/^verify-signature = true/verify-signature = false/' \
- /etc/portage/binrepos.conf/gentoo.conf
+ sed -i '/^verify-signature/d' /etc/portage/binrepos.conf/gentoo.conf
+ printf '\nverify-signature = false\n' >> /etc/portage/binrepos.conf/gentoo.conf
emerge -q --getbinpkg net-misc/curl dev-util/pkgcheck
# Place this overlay at /var/db/repos/azy5030. actions/checkout is avoided