Skip to content
This repository was archived by the owner on Feb 15, 2026. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 19 additions & 10 deletions run
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down