Skip to content

Commit eb12b5d

Browse files
authored
Merge pull request #77 from fleetbase/patch/profile-release
do not autoincrement build number
2 parents 2afd0da + 3872389 commit eb12b5d

File tree

1 file changed

+16
-11
lines changed

1 file changed

+16
-11
lines changed

.github/workflows/profile-release.yml

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ jobs:
213213
test -f ./profile-config/.env || { echo "❌ Missing ./profile-config/.env"; exit 1; }
214214
echo "✅ Profile config ready"
215215
216-
- name: Resolve cross-platform versions (no race)
216+
- name: Resolve cross-platform versions
217217
id: resolve
218218
run: |
219219
echo "🔧 Resolving versions with parity (iOS/Android)"
@@ -233,7 +233,7 @@ jobs:
233233
fi
234234
# manual override already reflected in detect-release.outputs.version
235235
236-
# ---- STEP 2: BUILD_NUMBER (strict int) ----
236+
# ---- STEP 2: BUILD_NUMBER (strict int, NO AUTOINCREMENT) ----
237237
if [ -n "${{ needs.detect-release.outputs.build_number }}" ] && [ "${{ needs.detect-release.outputs.build_number }}" != "" ]; then
238238
BUILD_NUMBER="${{ needs.detect-release.outputs.build_number }}"
239239
echo "✅ Build number override (manual): $BUILD_NUMBER"
@@ -243,20 +243,25 @@ jobs:
243243
BUILD_FROM_TAG=$(echo "$TAG_MSG" | grep -o '\[Build\( No\)\? [0-9]\+\]' | grep -o '[0-9]\+' || echo "")
244244
if [ -n "$BUILD_FROM_TAG" ]; then
245245
BUILD_NUMBER="$BUILD_FROM_TAG"
246-
echo "✅ Build number from tag message: $BUILD_NUMBER"
246+
echo "✅ Build number from tag message: $BUILD_FROM_TAG"
247247
else
248-
CUR=$(grep -E '^ANDROID_VERSION_CODE=' ./profile-config/.env | cut -d'=' -f2 2>/dev/null || echo "0")
249-
[[ "$CUR" =~ ^[0-9]+$ ]] || { echo "⚠️ ANDROID_VERSION_CODE in .env not int: '$CUR' → using 0"; CUR=0; }
250-
BUILD_NUMBER=$((CUR + 1))
251-
echo "✅ Build number incremented from .env: $CUR + 1 = $BUILD_NUMBER"
248+
# Use value from profile .env without increment
249+
CUR=$(grep -E '^ANDROID_VERSION_CODE=' ./profile-config/.env | cut -d'=' -f2 2>/dev/null || echo "")
250+
if [[ "$CUR" =~ ^[0-9]+$ ]]; then
251+
BUILD_NUMBER="$CUR"
252+
echo "ℹ️ Using build number from ANDROID_VERSION_CODE in .env: $BUILD_NUMBER"
253+
else
254+
BUILD_NUMBER="${FALLBACK_BUILD_NUMBER:-1}"
255+
echo "⚠️ No valid build number from inputs, tag, or .env; falling back to global: $BUILD_NUMBER"
256+
fi
252257
fi
253258
fi
254-
# If still empty or non-integer, use global fallback (validate)
259+
260+
# Final validation
255261
if ! [[ "$BUILD_NUMBER" =~ ^[0-9]+$ ]]; then
256-
BUILD_NUMBER="${FALLBACK_BUILD_NUMBER}"
257-
echo "⚠️ Build number fell back to global env: $BUILD_NUMBER"
262+
echo "❌ ERROR: BUILD_NUMBER not integer: '$BUILD_NUMBER'"
263+
exit 1
258264
fi
259-
[[ "$BUILD_NUMBER" =~ ^[0-9]+$ ]] || { echo "❌ ERROR: BUILD_NUMBER not integer: '$BUILD_NUMBER'"; exit 1; }
260265
261266
echo "🎯 Final parity:"
262267
echo " iOS_VERSION / ANDROID_VERSION_NAME = $VERSION_NAME"

0 commit comments

Comments
 (0)