diff --git a/.forgejo/workflows/ci.yml b/.forgejo/workflows/ci.yml index 2eef2ae3..d8a1d795 100644 --- a/.forgejo/workflows/ci.yml +++ b/.forgejo/workflows/ci.yml @@ -123,6 +123,14 @@ jobs: if [ -f "debian/rules" ]; then echo "✅ Using enhanced debian/rules for build" + # Update debian/changelog with build version + echo "apt-ostree ($BUILD_VERSION) unstable; urgency=medium" > debian/changelog + echo "" >> debian/changelog + echo " * CI Build #$BUILD_NUMBER from commit $COMMIT_HASH" >> debian/changelog + echo " * Automated build with enhanced Debian packaging" >> debian/changelog + echo "" >> debian/changelog + echo " -- CI Bot $(date -R)" >> debian/changelog + # Set environment variables for enhanced build export DH_VERBOSE=1 export DEB_BUILD_OPTIONS="parallel=$(nproc)" @@ -154,9 +162,28 @@ jobs: if ls ../*.deb >/dev/null 2>&1; then echo "✅ Debian package created successfully" ls -la ../*.deb - # Copy packages to current directory for CI workflow - cp ../*.deb . - echo "✅ Packages copied to current directory" + + # Rename packages with build version to ensure uniqueness + echo "Renaming packages with build version..." + for pkg in ../*.deb; do + pkg_name=$(basename "$pkg") + pkg_ext="${pkg_name##*.}" + pkg_base="${pkg_name%.*}" + + # Extract current version and replace with build version + if [[ "$pkg_name" =~ ^apt-ostree_([^-]+)_([^.]+)\.deb$ ]]; then + current_version="${BASH_REMATCH[1]}" + arch="${BASH_REMATCH[2]}" + new_name="apt-ostree_${BUILD_VERSION}_${arch}.deb" + echo "Renaming: $pkg_name -> $new_name" + cp "$pkg" "$new_name" + else + # Fallback: just copy with original name + cp "$pkg" . + fi + done + + echo "✅ Packages renamed and copied to current directory" ls -la *.deb else echo "❌ No Debian package found"