mirror of
https://github.com/JoshiCodes/knock.git
synced 2026-12-04 14:59:41 +01:00
CI: match deb paths without a leading ./ and name the failing check
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user