From be6db709aec963b4b6ddba5f2ca13df99cd7055a Mon Sep 17 00:00:00 2001 From: robojerk Date: Tue, 19 Aug 2025 11:49:14 -0700 Subject: [PATCH] feat: optimize package naming for CI builds - Truncate commit hash to 10 characters for better readability - Add debug output to show when CI build number vs timestamp is used - Prioritize GITEA_RUN_NUMBER for cleaner build identifiers - Expected result: apt-ostree_0.1.0-2+build109.6de675810a_amd64.deb --- .forgejo/workflows/ci.yml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/.forgejo/workflows/ci.yml b/.forgejo/workflows/ci.yml index 5ff1009b..d1e0bbcd 100644 --- a/.forgejo/workflows/ci.yml +++ b/.forgejo/workflows/ci.yml @@ -127,8 +127,8 @@ jobs: BUILD_NUMBER="${GITEA_RUN_NUMBER:-$(date +%Y%m%d%H%M%S)}" COMMIT_HASH=$(git rev-parse HEAD 2>/dev/null || echo "unknown") - # Truncate commit hash to first 16 characters for better uniqueness - SHORT_COMMIT=$(echo "$COMMIT_HASH" | cut -c1-16) + # Truncate commit hash to first 10 characters for better readability + SHORT_COMMIT=$(echo "$COMMIT_HASH" | cut -c1-10) # Dynamically get the project version with portable regex alternatives extract_version() { @@ -174,6 +174,13 @@ jobs: echo "Project Version: $PROJECT_VERSION" echo "Build Number: $BUILD_NUMBER" echo "Commit Hash: $SHORT_COMMIT" + + # Debug information about build number source + if [ -n "$GITEA_RUN_NUMBER" ]; then + echo "✅ Using CI build number: $GITEA_RUN_NUMBER" + else + echo "⚠️ GITEA_RUN_NUMBER not set, using timestamp fallback: $(date +%Y%m%d%H%M%S)" + fi # Check if we have the necessary files if [ -f "Cargo.toml" ] && [ -d "debian" ]; then