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:
parent
bf2b5104f1
commit
4b24e97960
1 changed files with 9 additions and 2 deletions
|
|
@ -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
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue