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
This commit is contained in:
robojerk 2025-08-19 11:49:14 -07:00
parent bf2b5104f1
commit 4b24e97960

View file

@ -127,8 +127,8 @@ jobs:
BUILD_NUMBER="${GITEA_RUN_NUMBER:-$(date +%Y%m%d%H%M%S)}" BUILD_NUMBER="${GITEA_RUN_NUMBER:-$(date +%Y%m%d%H%M%S)}"
COMMIT_HASH=$(git rev-parse HEAD 2>/dev/null || echo "unknown") COMMIT_HASH=$(git rev-parse HEAD 2>/dev/null || echo "unknown")
# Truncate commit hash to first 16 characters for better uniqueness # Truncate commit hash to first 10 characters for better readability
SHORT_COMMIT=$(echo "$COMMIT_HASH" | cut -c1-16) SHORT_COMMIT=$(echo "$COMMIT_HASH" | cut -c1-10)
# Dynamically get the project version with portable regex alternatives # Dynamically get the project version with portable regex alternatives
extract_version() { extract_version() {
@ -174,6 +174,13 @@ jobs:
echo "Project Version: $PROJECT_VERSION" echo "Project Version: $PROJECT_VERSION"
echo "Build Number: $BUILD_NUMBER" echo "Build Number: $BUILD_NUMBER"
echo "Commit Hash: $SHORT_COMMIT" 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 # Check if we have the necessary files
if [ -f "Cargo.toml" ] && [ -d "debian" ]; then if [ -f "Cargo.toml" ] && [ -d "debian" ]; then