Improve release scripts and make workflows manual

Redirect script informational/warning output to stderr and improve robustness of release tooling. Changes include:

- Redirect many echo messages to stderr so scripts can emit machine-readable output on stdout.
- Extract-release-notes: better parsing of CHANGELOG entries (tries v-prefixed and non-prefixed headings, cleaner note formatting) and improved fallbacks when changelog is missing.
- Extract-version: accept versions with +build or -suffix, add diagnostic output when pubspec is missing, and tighten validation.
- Setup/verify APK signing: more consistent stderr logging and clearer warnings; ensure keystore decoding/logging is visible.
- Minor script usage message fixes (generate-tag-name, attach-apk-to-release).
- CI/workflows: change backend-foundation, mobile-ci, and web-quality triggers to workflow_dispatch (manual runs); update product-release (make scripts step label emoji, remove node cache lines, bump Flutter to 3.38.x).

These changes improve CI reliability, make scripts friendlier for automated consumers, and fix release note/version parsing edge cases.
This commit is contained in:
Achintha Isuru
2026-03-05 15:30:27 -05:00
parent 11bbd8c87a
commit 83c05ad99e
10 changed files with 85 additions and 100 deletions

View File

@@ -8,7 +8,7 @@ set -e
APP=$1
if [ -z "$APP" ]; then
echo "❌ Error: App parameter required (worker-mobile-app or client-mobile-app)"
echo "❌ Error: App parameter required (worker-mobile-app or client-mobile-app)" >&2
exit 1
fi
@@ -23,26 +23,30 @@ fi
# Check if pubspec exists
if [ ! -f "$PUBSPEC_PATH" ]; then
echo "❌ Error: pubspec.yaml not found at $PUBSPEC_PATH"
echo "❌ Error: pubspec.yaml not found at $PUBSPEC_PATH" >&2
echo "📁 Current directory: $(pwd)" >&2
echo "📂 Directory contents:" >&2
ls -la apps/mobile/apps/ 2>&1 | head -20 >&2
exit 1
fi
# Extract version (format: X.Y.Z+buildNumber)
# Extract version (format: X.Y.Z+buildNumber or X.Y.Z-suffix)
VERSION_LINE=$(grep "^version:" "$PUBSPEC_PATH")
if [ -z "$VERSION_LINE" ]; then
echo "❌ Error: Could not find version in $PUBSPEC_PATH"
echo "❌ Error: Could not find version in $PUBSPEC_PATH" >&2
exit 1
fi
# Extract just the semantic version (before the +)
VERSION=$(echo "$VERSION_LINE" | sed 's/version: *//' | sed 's/+.*//' | tr -d ' ')
# Extract full version including suffix/build number
VERSION=$(echo "$VERSION_LINE" | sed 's/version: *//' | tr -d ' ')
# Validate version format
if ! [[ "$VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "❌ Error: Invalid version format in pubspec.yaml: $VERSION"
echo "Expected format: X.Y.Z (e.g., 0.1.0)"
# Validate version format (X.Y.Z with optional +build or -suffix)
# Use grep for better portability across different bash versions
if ! echo "$VERSION" | grep -Eq '^[0-9]+\.[0-9]+\.[0-9]+(\+[a-zA-Z0-9]+|-[a-zA-Z0-9]+)?$'; then
echo "❌ Error: Invalid version format in pubspec.yaml: $VERSION" >&2
echo "Expected format: X.Y.Z, X.Y.Z+build, or X.Y.Z-suffix (e.g., 0.1.0, 0.1.0+12, 0.1.0-m3)" >&2
exit 1
fi
echo "✅ Extracted version from $PUBSPEC_PATH: $VERSION"
echo "✅ Extracted version from $PUBSPEC_PATH: $VERSION" >&2
echo "$VERSION"