Files
Krow-workspace/.github/scripts/extract-release-notes.sh
Achintha Isuru 3e31002d1e refactor(ci): replace mobile-specific terms with generic product terminology
🔄 Updated workflows and scripts to use product-agnostic naming:

Workflow Changes:
- 📱 Mobile Release → 📦 Product Release
- 🚨 Mobile Hotfix → 🚨 Product Hotfix
- Mobile App → Product (in descriptions)
- "mobile app" → "product" (in messages and tags)
- "pubspec.yaml" → "version file" (in user-facing text)

Display Names:
- Worker Mobile → Worker Product
- Client Mobile → Client Product
- Staff Mobile App → Staff Product (Worker)
- Client Mobile App → Client Product

Benefits:
 Makes workflows extensible for other product types
 Consistent terminology across all automation
 Easier to add web, backend, or other products later
 Keeps implementation details (paths, scripts) unchanged
 Maintains backward compatibility with existing tags

Note: File paths remain unchanged (apps/mobile/...) as they are implementation-specific
2026-03-05 11:58:28 -05:00

66 lines
1.7 KiB
Bash
Executable File

#!/bin/bash
# Extract release notes from CHANGELOG for a specific version
# Usage: ./extract-release-notes.sh <app> <version> <environment> <tag_name> <output_file>
set -e
APP=$1
VERSION=$2
ENV=$3
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>"
exit 1
fi
# Determine CHANGELOG path and app name
if [ "$APP" = "worker" ]; then
CHANGELOG_PATH="apps/mobile/apps/staff/CHANGELOG.md"
APP_NAME="Staff Product (Worker)"
else
CHANGELOG_PATH="apps/mobile/apps/client/CHANGELOG.md"
APP_NAME="Client Product"
fi
# Try to extract release notes for this version
if [ -f "$CHANGELOG_PATH" ]; then
echo "📝 Found CHANGELOG at $CHANGELOG_PATH"
# 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')
if [ -z "$NOTES" ]; then
echo "⚠️ Warning: No CHANGELOG entry found for version $VERSION"
NOTES="Release $VERSION for $APP_NAME
⚠️ No CHANGELOG entry found for this version. Please update the CHANGELOG manually.
**Environment:** $ENV
**Tag:** $TAG_NAME"
else
echo "✅ Extracted release notes for version $VERSION"
NOTES="# $APP_NAME - Release $VERSION
$NOTES
---
**Environment:** $ENV
**Tag:** $TAG_NAME"
fi
else
echo "⚠️ Warning: CHANGELOG not found at $CHANGELOG_PATH"
NOTES="Release $VERSION for $APP_NAME
**Environment:** $ENV
**Tag:** $TAG_NAME"
fi
# Save to output file
echo "$NOTES" > "$OUTPUT_FILE"
echo "✅ Release notes saved to $OUTPUT_FILE"