CI: match deb paths without a leading ./ and name the failing check

This commit is contained in:
2026-11-27 18:03:54 +01:00
parent c3b8849693
commit e6913451e6
+8 -6
View File
@@ -91,12 +91,14 @@ jobs:
run: | run: |
OUT="target/$TARGET/release/bundle" OUT="target/$TARGET/release/bundle"
DEB=$(ls $OUT/deb/*.deb) DEB=$(ls $OUT/deb/*.deb)
dpkg-deb --field "$DEB" Architecture | grep -qx amd64 fail() { echo "check failed: $1"; exit 1; }
dpkg-deb -c "$DEB" | grep -q './usr/bin/knock-app$' CONTENTS=$(dpkg-deb -c "$DEB")
dpkg-deb -c "$DEB" | grep -q './usr/bin/knock$' [ "$(dpkg-deb --field "$DEB" Architecture)" = amd64 ] || fail "deb architecture is not amd64"
dpkg-deb -c "$DEB" | grep -q 'applications/.*\.desktop$' echo "$CONTENTS" | grep -qE 'usr/bin/knock-app$' || fail "knock-app missing from the deb"
file "target/$TARGET/release/knock-app" | grep -q 'x86-64' echo "$CONTENTS" | grep -qE 'usr/bin/knock$' || fail "knock CLI missing from the deb"
file "target/$TARGET/release/knock" | grep -q 'x86-64' 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. # 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') 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 if [ -n "$too_new" ]; then echo "needs newer glibc than Ubuntu 22.04: $too_new"; exit 1; fi