Add package installation testing to Gitea workflow and fix package metadata
Build, Test and Publish Debian Packages / Build Packages (push) Failing after 21s
Build, Test and Publish Debian Packages / Test Package Installation (push) Skipped
Build, Test and Publish Debian Packages / Publish to eendoe repository (push) Skipped

This commit is contained in:
bart
2026-10-20 22:01:16 +02:00
parent ed27a09ef9
commit 496920fddb
13 changed files with 188 additions and 10373 deletions
+31 -21
View File
@@ -1,31 +1,41 @@
#!/bin/sh
set -e
CONTROL_FILE=$(ls -1 *.control 2>/dev/null | head -n 1)
if [ -z "$CONTROL_FILE" ]; then
echo "Fout: Geen .control bestand gevonden in $(pwd)" >&2
exit 1
fi
PACKAGE_NAME=$(awk '/^Package: /{print $NF}' "$CONTROL_FILE")
DETECTED_VERSION=$(awk '/^Version: /{print $NF}' "$CONTROL_FILE")
# Version resolution: CLI arg > ENV var > .control version > default 0.1.0
if [ -n "$1" ]; then
VERSION="$1"
elif [ -n "$PACKAGE_VERSION" ]; then
VERSION="$PACKAGE_VERSION"
elif [ -n "$VERSION" ]; then
VERSION="$VERSION"
elif [ "$DETECTED_VERSION" != "{VERSION}" ] && [ -n "$DETECTED_VERSION" ]; then
VERSION="$DETECTED_VERSION"
else
VERSION="0.1.0"
fi
mkdir -p "packaging/$PACKAGE_NAME/DEBIAN"
sed "s/{VERSION}/${VERSION}/" "$CONTROL_FILE" > "packaging/$PACKAGE_NAME/DEBIAN/control"
CONTROL_FILE=$(ls -1 *.control)
ARCH=$(awk '/^Architecture: /{print $NF}' "packaging/$PACKAGE_NAME/DEBIAN/control")
ARCH="${ARCH:-all}"
DEB_FILENAME="${PACKAGE_NAME}-${VERSION}_${ARCH}.deb"
echo "Using control file $CONTROL_FILE"
PACKAGE_NAME=$(awk '/^Package: /{print $NF}' $CONTROL_FILE)
VERSION=$(awk '/^Version: /{print $NF}' $CONTROL_FILE)
echo "Building package: $PACKAGE_NAME ($VERSION) [$ARCH] -> $DEB_FILENAME"
# Build debian binary package
dpkg-deb --build "packaging/$PACKAGE_NAME" "$DEB_FILENAME"
# tag git repo
# git tag -f release-${VERSION}
echo "Building package $PACKAGE_NAME ($VERSION): $PACKAGE_NAME-${VERSION}_all.deb"
# VERSION
sed "s/{VERSION}/${VERSION}/" $PACKAGE_NAME.control > packaging/$PACKAGE_NAME/DEBIAN/control
#create debian package
dpkg --build packaging/$PACKAGE_NAME $PACKAGE_NAME-${VERSION}_all.deb
# dpkg-sig -k 14AF7F05 --sign builder icosi-${VERSION}_all.deb
echo "clean up"
rm packaging/$PACKAGE_NAME/DEBIAN/control
# Cleanup temporary control file
rm -f "packaging/$PACKAGE_NAME/DEBIAN/control"
echo "Succesvol gebouwd: $DEB_FILENAME"