From be9bc5819cdd128e38e928f5e171f7a9cf3bb531 Mon Sep 17 00:00:00 2001 From: Matti Airas Date: Sat, 22 Nov 2025 01:07:42 +0200 Subject: [PATCH] fix(ci): fix build-deb function for shared-workflows compatibility MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The build-deb function was calling non-existent release-version function. Changes: - Check if debian/changelog was recently generated (within 5 minutes) - If recent (CI generated): skip changelog regeneration, just run dpkg-buildpackage - For local builds: use VERSION file instead of missing release-version 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- run | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/run b/run index 61a2239..6d0f010 100755 --- a/run +++ b/run @@ -92,16 +92,25 @@ function build-deb { # Set up environment dev-env - export DEBEMAIL="info@hatlabs.fi" - export DEBFULLNAME="Hat Labs CI" - export PACKAGE_VERSION=$(release-version) - DEB_VERSION=$(echo "$PACKAGE_VERSION" | sed 's/-\([a-zA-Z]\)/~\1/g') - - # Create a new changelog entry - dch --newversion "$DEB_VERSION" \ - --distribution stable \ - --force-distribution \ - "Automated release $PACKAGE_VERSION. See GitHub for details." + # Check if changelog was already generated by CI (shared-workflows) + # If debian/changelog exists and was modified in the last 5 minutes, skip regeneration + if [ -f "debian/changelog" ]; then + CHANGELOG_AGE=$(($(date +%s) - $(stat -c %Y debian/changelog 2>/dev/null || stat -f %m debian/changelog))) + if [ "$CHANGELOG_AGE" -lt 300 ]; then + echo "📋 Using existing debian/changelog (generated by CI)" + else + # Generate changelog for local builds + export DEBEMAIL="info@hatlabs.fi" + export DEBFULLNAME="Hat Labs CI" + export PACKAGE_VERSION=$(cat VERSION) + DEB_VERSION=$(echo "$PACKAGE_VERSION" | sed 's/-\([a-zA-Z]\)/~\1/g') + + dch --newversion "$DEB_VERSION" \ + --distribution stable \ + --force-distribution \ + "Automated release $PACKAGE_VERSION. See GitHub for details." + fi + fi dpkg-buildpackage -us -uc -b