fix(ci): redirect script messages to stderr and support version format X.Y.Z-suffix

Fixed workflow failure by ensuring only data goes to stdout, not informational messages. Also added support for version format X.Y.Z-suffix in addition to X.Y.Z+build.
This commit is contained in:
Achintha Isuru
2026-03-05 14:10:05 -05:00
parent bdacedbced
commit be43030058
6 changed files with 52 additions and 52 deletions

View File

@@ -28,8 +28,8 @@ VERSION="$4"
ENV="$5"
if [ -z "$TAG_NAME" ] || [ -z "$APP" ] || [ -z "$APP_NAME" ] || [ -z "$VERSION" ] || [ -z "$ENV" ]; then
echo "❌ Error: Missing required arguments"
echo "Usage: $0 <tag_name> <app> <app_name> <version> <environment>"
echo "❌ Error: Missing required arguments" >&2
echo "Usage: $0 <tag_name> <app> <app_name> <version> <environment>" >&2
exit 1
fi
@@ -37,8 +37,8 @@ fi
APK_PATH="apps/mobile/apps/${APP_NAME}/build/app/outputs/flutter-apk/app-release.apk"
if [ ! -f "$APK_PATH" ]; then
echo "❌ Error: APK not found at $APK_PATH"
echo "Searching for APK files..."
echo "❌ Error: APK not found at $APK_PATH" >&2
echo "Searching for APK files..." >&2
find apps/mobile/apps/${APP_NAME} -name "*.apk"
exit 1
fi
@@ -54,7 +54,7 @@ fi
cp "$APK_PATH" "/tmp/$APK_NAME"
# Upload to GitHub Release
echo "📤 Uploading $APK_NAME to release $TAG_NAME..."
echo "📤 Uploading $APK_NAME to release $TAG_NAME..." >&2
gh release upload "$TAG_NAME" "/tmp/$APK_NAME" --clobber
echo "✅ APK attached to release: $APK_NAME"
echo "✅ APK attached to release: $APK_NAME" >&2