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

@@ -11,8 +11,8 @@ TAG_NAME=$4
OUTPUT_FILE=$5
if [ -z "$APP" ] || [ -z "$VERSION" ] || [ -z "$ENV" ] || [ -z "$TAG_NAME" ] || [ -z "$OUTPUT_FILE" ]; then
echo "❌ Error: Missing required parameters"
echo "Usage: ./extract-release-notes.sh <app> <version> <environment> <tag_name> <output_file>"
echo "❌ Error: Missing required parameters" >&2
echo "Usage: ./extract-release-notes.sh <app> <version> <environment> <tag_name> <output_file>" >&2
exit 1
fi
@@ -27,39 +27,45 @@ fi
# Try to extract release notes for this version
if [ -f "$CHANGELOG_PATH" ]; then
echo "📝 Found CHANGELOG at $CHANGELOG_PATH"
echo "📝 Found CHANGELOG at $CHANGELOG_PATH" >&2
# Extract section for this version
# Look for ## [VERSION] and collect until next ## [ or end of file
NOTES=$(awk "/## \[${VERSION}\]/,/^## \[/" "$CHANGELOG_PATH" | sed '1d;$d' | sed '/^$/d')
# Look for ## [vVERSION] or ## [VERSION] and collect content until next ## [ header
# Try with 'v' prefix first (common format), then without
CHANGELOG_CONTENT=$(awk "/^## \[v${VERSION}\]/{flag=1; next} /^## \[/{flag=0} flag" "$CHANGELOG_PATH")
if [ -z "$NOTES" ]; then
echo "⚠️ Warning: No CHANGELOG entry found for version $VERSION"
NOTES="Release $VERSION for $APP_NAME
# If still empty, try without 'v' prefix
if [ -z "$CHANGELOG_CONTENT" ]; then
CHANGELOG_CONTENT=$(awk "/^## \[${VERSION}\]/{flag=1; next} /^## \[/{flag=0} flag" "$CHANGELOG_PATH")
fi
if [ -z "$CHANGELOG_CONTENT" ]; then
echo "⚠️ Warning: No CHANGELOG entry found for version $VERSION" >&2
NOTES="**Environment:** $ENV
**Tag:** $TAG_NAME
⚠️ No CHANGELOG entry found for this version. Please update the CHANGELOG manually.
## What is new in this release
**Environment:** $ENV
**Tag:** $TAG_NAME"
⚠️ No CHANGELOG entry found for this version. Please update the CHANGELOG manually."
else
echo "✅ Extracted release notes for version $VERSION"
NOTES="# $APP_NAME - Release $VERSION
echo "✅ Extracted release notes for version $VERSION" >&2
NOTES="**Environment:** $ENV
**Tag:** $TAG_NAME
$NOTES
## What is new in this release
---
**Environment:** $ENV
**Tag:** $TAG_NAME"
$CHANGELOG_CONTENT"
fi
else
echo "⚠️ Warning: CHANGELOG not found at $CHANGELOG_PATH"
NOTES="Release $VERSION for $APP_NAME
echo "⚠️ Warning: CHANGELOG not found at $CHANGELOG_PATH" >&2
NOTES="**Environment:** $ENV
**Tag:** $TAG_NAME
**Environment:** $ENV
**Tag:** $TAG_NAME"
## What is new in this release
⚠️ CHANGELOG file not found at $CHANGELOG_PATH"
fi
# Save to output file
echo "$NOTES" > "$OUTPUT_FILE"
echo "✅ Release notes saved to $OUTPUT_FILE"
echo "✅ Release notes saved to $OUTPUT_FILE" >&2