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

@@ -32,12 +32,12 @@ ENV="$2"
TEMP_DIR="$3"
if [ -z "$APP" ] || [ -z "$ENV" ] || [ -z "$TEMP_DIR" ]; then
echo "❌ Error: Missing required arguments"
echo "Usage: $0 <app> <environment> <temp_dir>"
echo "❌ Error: Missing required arguments" >&2
echo "Usage: $0 <app> <environment> <temp_dir>" >&2
exit 1
fi
echo "🔐 Setting up Android signing for $APP in $ENV environment..."
echo "🔐 Setting up Android signing for $APP in $ENV environment..." >&2
# Determine which keystore to use
if [ "$APP" = "worker-mobile-app" ]; then
@@ -68,9 +68,9 @@ KEY_PASSWORD="${!KEY_PASSWORD_VAR}"
# Check if secrets are configured
if [ -z "$KEYSTORE_BASE64" ]; then
echo "⚠️ WARNING: Keystore secret $KEYSTORE_BASE64_VAR is not configured!"
echo "⚠️ APK will be built UNSIGNED for $ENV environment."
echo "⚠️ Please configure GitHub Secrets as documented in docs/RELEASE/APK_SIGNING_SETUP.md"
echo "⚠️ WARNING: Keystore secret $KEYSTORE_BASE64_VAR is not configured!" >&2
echo "⚠️ APK will be built UNSIGNED for $ENV environment." >&2
echo "⚠️ Please configure GitHub Secrets as documented in docs/RELEASE/APK_SIGNING_SETUP.md" >&2
exit 0
fi
@@ -83,12 +83,12 @@ KEYSTORE_PATH="$KEYSTORE_DIR/release.jks"
echo "$KEYSTORE_BASE64" | base64 -d > "$KEYSTORE_PATH"
if [ ! -f "$KEYSTORE_PATH" ]; then
echo "❌ Failed to decode keystore!"
echo "❌ Failed to decode keystore!" >&2
exit 1
fi
echo "✅ Keystore decoded successfully"
echo "📦 Keystore size: $(ls -lh "$KEYSTORE_PATH" | awk '{print $5}')"
echo "✅ Keystore decoded successfully" >&2
echo "📦 Keystore size: $(ls -lh "$KEYSTORE_PATH" | awk '{print $5}')" >&2
# Export environment variables for build.gradle.kts
# Using CodeMagic-compatible variable names
@@ -98,5 +98,5 @@ echo "CM_KEYSTORE_PASSWORD_${APP_NAME}=$KEYSTORE_PASSWORD" >> $GITHUB_ENV
echo "CM_KEY_ALIAS_${APP_NAME}=$KEY_ALIAS" >> $GITHUB_ENV
echo "CM_KEY_PASSWORD_${APP_NAME}=$KEY_PASSWORD" >> $GITHUB_ENV
echo "✅ Signing environment configured for $APP_NAME ($ENV environment)"
echo "🔑 Using key alias: $KEY_ALIAS"
echo "✅ Signing environment configured for $APP_NAME ($ENV environment)" >&2
echo "🔑 Using key alias: $KEY_ALIAS" >&2