Skip to content

Commit 1d274b2

Browse files
authored
chore(ci): gate tag-triggered AUR validation on release artifacts (#119)
* chore(ci): gate tag-triggered AUR validation on release artifacts A tag push fires aur.yml together with the release builds that produce the artifacts its PKGBUILDs download (path filters are not evaluated on tag pushes), so the honkhonk-bin leg raced deb.yml to the release .deb and 404ed on 0.1.0. On tag-triggered runs, poll each remote source URL from makepkg --printsrcinfo until it exists (up to 20 min) before building — the same wait-for-dependency pattern the appimage/deb/ flatpak workflows use to wait for the release. PR and branch runs skip the gate and keep failing fast. * chore(ci): fail closed when the artifact gate extracts no URLs A broken grep pattern or failed makepkg would leave the URL list empty and silently skip the gate, reintroducing the race this step exists to prevent. Keep the || true (under bash -e a no-match grep would abort the assignment before any diagnostic prints) and add an explicit empty-check that exits with a clear error. CodeRabbit finding on #119.
1 parent fa283f7 commit 1d274b2

1 file changed

Lines changed: 36 additions & 0 deletions

File tree

.github/workflows/aur.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,42 @@ jobs:
5858
sudo -u builder makepkg --printsrcinfo > /tmp/.SRCINFO.fresh
5959
diff -u .SRCINFO /tmp/.SRCINFO.fresh
6060
61+
- name: Wait for release artifacts (tag push only)
62+
if: startsWith(github.ref, 'refs/tags/')
63+
working-directory: packaging/aur/${{ matrix.pkg }}
64+
# A tag push fires this workflow alongside the release builds that
65+
# produce the very artifacts the PKGBUILDs download (deb.yml uploads
66+
# the -bin .deb minutes after the tag lands; the source tarball
67+
# appears when GitHub processes the tag). Poll each remote source URL
68+
# until it exists so validation runs AFTER its dependencies instead
69+
# of racing them to a 404. PR/branch runs skip this gate and fail
70+
# fast — there, a PKGBUILD pointing at a not-yet-published release is
71+
# a legitimate failure.
72+
run: |
73+
# `|| true` keeps a no-match grep from killing the step under
74+
# `bash -e` before the explicit fail-closed check below can print
75+
# a usable error.
76+
urls=$(sudo -u builder makepkg --printsrcinfo \
77+
| grep -oP 'source = (?:[^:]+::)?\Khttps://\S+' || true)
78+
if [ -z "$urls" ]; then
79+
echo "ERROR: no remote source URLs extracted from the PKGBUILD;" \
80+
"refusing to silently bypass the artifact gate"
81+
exit 1
82+
fi
83+
for url in $urls; do
84+
echo "Waiting for: $url"
85+
for i in $(seq 1 40); do
86+
if curl -sfLI -o /dev/null "$url"; then
87+
echo "OK: $url"
88+
continue 2
89+
fi
90+
echo " not there yet (attempt $i/40), sleeping 30s"
91+
sleep 30
92+
done
93+
echo "ERROR: $url still missing after 20 minutes"
94+
exit 1
95+
done
96+
6197
- name: Build + install
6298
working-directory: packaging/aur/${{ matrix.pkg }}
6399
# Disable LTO and cap codegen parallelism for the CI compile only — the

0 commit comments

Comments
 (0)