feat: optimize package naming for CI builds
Some checks failed
Comprehensive CI/CD Pipeline / Security Audit (push) Waiting to run
Comprehensive CI/CD Pipeline / Package Validation (push) Waiting to run
Comprehensive CI/CD Pipeline / Status Report (push) Blocked by required conditions
Comprehensive CI/CD Pipeline / Build and Test (push) Has been cancelled

- 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 6de675810a
commit be6db709ae

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() {
@ -175,6 +175,13 @@ jobs:
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
echo "✅ Found Cargo.toml and debian directory" echo "✅ Found Cargo.toml and debian directory"