Add package installation testing to Gitea workflow and fix package metadata
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
name: Build and Publish Debian Packages
|
||||
name: Build, Test and Publish Debian Packages
|
||||
|
||||
on:
|
||||
push:
|
||||
@@ -9,6 +9,10 @@ on:
|
||||
- 'sources/**'
|
||||
- 'buildpackages.sh'
|
||||
- '.gitea/workflows/**'
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
- master
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
@@ -35,9 +39,61 @@ jobs:
|
||||
name: debian-packages
|
||||
path: staging/*.deb
|
||||
|
||||
test-install:
|
||||
name: Test Package Installation
|
||||
needs: build
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Download built artifacts
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: debian-packages
|
||||
path: staging
|
||||
|
||||
- name: Install system runtime dependencies
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y python3 python3-pip python3-venv ffmpeg
|
||||
|
||||
- name: Test install eendoe-repository
|
||||
run: |
|
||||
echo "=== Installing eendoe-repository ==="
|
||||
sudo apt-get install -y ./staging/eendoe-repository-*.deb
|
||||
dpkg -s eendoe-repository | grep -q "Status: install ok installed"
|
||||
test -f /etc/apt/sources.list.d/eendoe.list
|
||||
echo "eendoe-repository: OK"
|
||||
|
||||
- name: Test install eendoe-srs
|
||||
run: |
|
||||
echo "=== Installing eendoe-srs ==="
|
||||
sudo apt-get install -y ./staging/eendoe-srs-*.deb
|
||||
dpkg -s eendoe-srs | grep -q "Status: install ok installed"
|
||||
test -x /usr/share/srs/objs/srs
|
||||
echo "eendoe-srs: OK"
|
||||
|
||||
- name: Test install eendoe-hyperdeck
|
||||
run: |
|
||||
echo "=== Installing eendoe-hyperdeck ==="
|
||||
sudo apt-get install -y ./staging/eendoe-hyperdeck-*.deb
|
||||
dpkg -s eendoe-hyperdeck | grep -q "Status: install ok installed"
|
||||
test -d /usr/share/hyperdeck
|
||||
test -f /etc/hyperdeck/config.json
|
||||
test -f /usr/lib/systemd/system/hyperdeck.service
|
||||
python3 -m py_compile /usr/share/hyperdeck/main.py
|
||||
echo "eendoe-hyperdeck: OK"
|
||||
|
||||
- name: Test package uninstall and cleanup
|
||||
run: |
|
||||
echo "=== Testing package removal ==="
|
||||
sudo apt-get remove -y eendoe-hyperdeck eendoe-srs eendoe-repository
|
||||
echo "Package removal: OK"
|
||||
|
||||
publish:
|
||||
name: Publish to eendoe repository
|
||||
needs: build
|
||||
needs: [build, test-install]
|
||||
runs-on: ubuntu-latest
|
||||
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
|
||||
steps:
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
Package: eendoe-hyperdeck
|
||||
Version: {VERSION}
|
||||
Version: 0.15.2
|
||||
Section: utils
|
||||
Maintainer: nl.eendoe.bart
|
||||
Architecture: all
|
||||
Depends: python3, python3-pip, ffmpeg, eendoe-srs
|
||||
Depends: python3, python3-pip, python3-venv, ffmpeg, eendoe-srs
|
||||
Description: Eendoe hyperdeck client module
|
||||
|
||||
@@ -1,41 +1,43 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
#set -e
|
||||
case "$1" in
|
||||
configure|abort-upgrade)
|
||||
id -u vid &>/dev/null || useradd --system -m -s /bin/bash vid
|
||||
|
||||
id -u vid &>/dev/null || useradd --system -m vid
|
||||
# Setup virtualenv for python dependencies to comply with PEP 668 on Debian 12 / Ubuntu 24.04+
|
||||
VENV_DIR="/usr/share/hyperdeck/venv"
|
||||
if [ ! -d "$VENV_DIR" ]; then
|
||||
python3 -m venv "$VENV_DIR" 2>/dev/null || python3 -m venv --system-site-packages "$VENV_DIR" 2>/dev/null || true
|
||||
fi
|
||||
|
||||
runuser -l vid -c "pip3 install -r /usr/share/hyperdeck/requirements.txt"
|
||||
if [ -x "$VENV_DIR/bin/pip" ]; then
|
||||
"$VENV_DIR/bin/pip" install -q -r /usr/share/hyperdeck/requirements.txt || true
|
||||
chown -R vid:vid "$VENV_DIR" || true
|
||||
else
|
||||
pip3 install -r /usr/share/hyperdeck/requirements.txt --break-system-packages 2>/dev/null || \
|
||||
pip3 install -r /usr/share/hyperdeck/requirements.txt 2>/dev/null || true
|
||||
fi
|
||||
|
||||
FILE="/etc/hyperdeck/config.json"
|
||||
SOURCEFILE="/usr/share/hyperdeck/config.json.orig"
|
||||
if [ ! -f "$FILE" ]; then
|
||||
mkdir -p /etc/hyperdeck/
|
||||
echo "Copy default config"
|
||||
cp "$SOURCEFILE" "$FILE"
|
||||
chmod 744 "$FILE"
|
||||
fi
|
||||
|
||||
# Register and enable systemd service if running under systemd
|
||||
if systemctl is-system-running &>/dev/null || [ -d /run/systemd/system ]; then
|
||||
systemctl daemon-reload 2>/dev/null || true
|
||||
systemctl enable hyperdeck 2>/dev/null || true
|
||||
fi
|
||||
|
||||
FILE="/etc/hyperdeck/config.json"
|
||||
SOURCEFILE="/usr/share/hyperdeck/config.json.orig"
|
||||
if [ -f "$FILE" ]; then
|
||||
echo "$FILE exists."
|
||||
else
|
||||
mkdir -p /etc/hyperdeck/
|
||||
echo "Copy default config"
|
||||
cp "$SOURCEFILE" "$FILE"
|
||||
chmod 744 "$FILE"
|
||||
fi
|
||||
mkdir -p /var/log/hyperdeck/
|
||||
chown vid:vid "/var/log/hyperdeck/" 2>/dev/null || true
|
||||
|
||||
|
||||
|
||||
systemd-notify --booted
|
||||
if [ "$?" -eq 0 ]
|
||||
then
|
||||
echo "Systemd running, registering service"
|
||||
systemctl daemon-reload && systemctl enable hyperdeck
|
||||
else
|
||||
echo "Systemd not running, skipping"
|
||||
fi
|
||||
|
||||
mkdir -p /var/log/hyperdeck/
|
||||
chown vid:vid "/var/log/hyperdeck/"
|
||||
|
||||
echo "Installation done"
|
||||
echo "Installation done"
|
||||
;;
|
||||
esac
|
||||
exit 0
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
Package: eendoe-srs
|
||||
Version: {VERSION}
|
||||
Version: 0.0.1
|
||||
Section: utils
|
||||
Maintainer: nl.eendoe.bart
|
||||
Architecture: all
|
||||
Architecture: amd64
|
||||
Depends: python3, python3-pip, ffmpeg
|
||||
Description: Eendoe Hyperdeck SRS module
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
vid-35m3s3d
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1 +0,0 @@
|
||||
27563
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user