From e6913451e67a364fe1b46667cc29fdacb4148f4f Mon Sep 17 00:00:00 2001 From: JoshiCodes <55353244+JoshiCodes@users.noreply.github.com> Date: Fri, 27 Nov 2026 18:03:54 +0100 Subject: [PATCH] CI: match deb paths without a leading ./ and name the failing check --- .gitea/workflows/ci.yml | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index c4bbfad..57599dc 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -91,12 +91,14 @@ jobs: run: | OUT="target/$TARGET/release/bundle" DEB=$(ls $OUT/deb/*.deb) - dpkg-deb --field "$DEB" Architecture | grep -qx amd64 - dpkg-deb -c "$DEB" | grep -q './usr/bin/knock-app$' - dpkg-deb -c "$DEB" | grep -q './usr/bin/knock$' - dpkg-deb -c "$DEB" | grep -q 'applications/.*\.desktop$' - file "target/$TARGET/release/knock-app" | grep -q 'x86-64' - file "target/$TARGET/release/knock" | grep -q 'x86-64' + fail() { echo "check failed: $1"; exit 1; } + CONTENTS=$(dpkg-deb -c "$DEB") + [ "$(dpkg-deb --field "$DEB" Architecture)" = amd64 ] || fail "deb architecture is not amd64" + echo "$CONTENTS" | grep -qE 'usr/bin/knock-app$' || fail "knock-app missing from the deb" + echo "$CONTENTS" | grep -qE 'usr/bin/knock$' || fail "knock CLI missing from the deb" + echo "$CONTENTS" | grep -qE 'usr/share/applications/.+\.desktop$' || fail "desktop entry missing from the deb" + file "target/$TARGET/release/knock-app" | grep -q 'x86-64' || fail "knock-app is not an x86-64 binary" + file "target/$TARGET/release/knock" | grep -q 'x86-64' || fail "knock is not an x86-64 binary" # Nothing newer than Ubuntu 22.04's glibc (2.35) may be required. too_new=$(x86_64-linux-gnu-objdump -T "target/$TARGET/release/knock-app" | grep -oE 'GLIBC_2\.[0-9]+' | sort -u | awk -F. '$2 > 35') if [ -n "$too_new" ]; then echo "needs newer glibc than Ubuntu 22.04: $too_new"; exit 1; fi