ci(bump): gate toolchain install behind a cheap version check; fix binpkg verify #4

Merged
azy5030 merged 5 commits from ci/gate-bump-and-fix-binpkg-verify into master 2026-06-19 21:03:07 -05:00
2 changed files with 36 additions and 4 deletions
Showing only changes of commit f08859eaea - Show all commits
+34 -2
View File
@@ -10,21 +10,53 @@ jobs:
container: container:
image: gentoo/stage3:amd64-openrc image: gentoo/stage3:amd64-openrc
steps: 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 '<title>v[0-9]+\.[0-9]+\.[0-9]+</title>' \
| 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 - name: Sync ::gentoo
if: steps.check.outputs.needed == 'true'
run: emerge-webrsync run: emerge-webrsync
- name: Configure portage + install tooling - name: Configure portage + install tooling
if: steps.check.outputs.needed == 'true'
run: | run: |
mkdir -p /etc/portage/repos.conf mkdir -p /etc/portage/repos.conf
printf '[DEFAULT]\nmain-repo = gentoo\n\n[gentoo]\nlocation = /var/db/repos/gentoo\n' \ printf '[DEFAULT]\nmain-repo = gentoo\n\n[gentoo]\nlocation = /var/db/repos/gentoo\n' \
> /etc/portage/repos.conf/gentoo.conf > /etc/portage/repos.conf/gentoo.conf
sed -i 's/^verify-signature = true/verify-signature = false/' \ sed -i '/^verify-signature/d' /etc/portage/binrepos.conf/gentoo.conf
/etc/portage/binrepos.conf/gentoo.conf printf '\nverify-signature = false\n' >> /etc/portage/binrepos.conf/gentoo.conf
emerge -q --getbinpkg \ emerge -q --getbinpkg \
dev-vcs/git net-misc/curl app-arch/xz-utils app-misc/jq \ dev-vcs/git net-misc/curl app-arch/xz-utils app-misc/jq \
dev-lang/go dev-util/pkgdev dev-lang/go dev-util/pkgdev
- name: Check for new release and open PR - name: Check for new release and open PR
if: steps.check.outputs.needed == 'true'
env: env:
BUMP_TOKEN: ${{ secrets.BUMP_TOKEN }} BUMP_TOKEN: ${{ secrets.BUMP_TOKEN }}
run: | run: |
+2 -2
View File
@@ -22,8 +22,8 @@ jobs:
mkdir -p /etc/portage/repos.conf mkdir -p /etc/portage/repos.conf
printf '[DEFAULT]\nmain-repo = gentoo\n\n[gentoo]\nlocation = /var/db/repos/gentoo\n' \ printf '[DEFAULT]\nmain-repo = gentoo\n\n[gentoo]\nlocation = /var/db/repos/gentoo\n' \
> /etc/portage/repos.conf/gentoo.conf > /etc/portage/repos.conf/gentoo.conf
sed -i 's/^verify-signature = true/verify-signature = false/' \ sed -i '/^verify-signature/d' /etc/portage/binrepos.conf/gentoo.conf
/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 emerge -q --getbinpkg net-misc/curl dev-util/pkgcheck
# Place this overlay at /var/db/repos/azy5030. actions/checkout is avoided # Place this overlay at /var/db/repos/azy5030. actions/checkout is avoided