refactor(ci): enhance mobile release workflow with emojis and extracted scripts
✨ Enhanced mobile-release.yml workflow: - 📱 Added emojis to all steps for better visual feedback - 🔧 Version now automatically extracted from pubspec.yaml - No manual version input required - Reads from apps/mobile/apps/staff/pubspec.yaml for worker - Reads from apps/mobile/apps/client/pubspec.yaml for client - 📝 Removed manual version input field from workflow 🔨 Created reusable shell scripts in .github/scripts/: 1. extract-version.sh - Extract version from pubspec.yaml 2. generate-tag-name.sh - Generate tag names consistently 3. extract-release-notes.sh - Extract CHANGELOG sections 4. create-release-summary.sh - Generate GitHub Step Summary with emojis Benefits: ✅ Simpler workflow - just select app and environment ✅ Single source of truth for versions (pubspec.yaml) ✅ Reusable scripts can be used in other workflows ✅ Better error messages and validation ✅ Enhanced visual feedback with emojis ✅ Cleaner workflow file (moved logic to scripts)
This commit is contained in:
73
.github/scripts/create-release-summary.sh
vendored
Executable file
73
.github/scripts/create-release-summary.sh
vendored
Executable file
@@ -0,0 +1,73 @@
|
||||
#!/bin/bash
|
||||
# Generate release summary for GitHub Actions
|
||||
# Usage: ./create-release-summary.sh <app> <environment> <version> <tag_name>
|
||||
|
||||
set -e
|
||||
|
||||
APP=$1
|
||||
ENV=$2
|
||||
VERSION=$3
|
||||
TAG_NAME=$4
|
||||
|
||||
if [ -z "$APP" ] || [ -z "$ENV" ] || [ -z "$VERSION" ] || [ -z "$TAG_NAME" ]; then
|
||||
echo "❌ Error: Missing required parameters"
|
||||
echo "Usage: ./create-release-summary.sh <app> <environment> <version> <tag_name>"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Determine display names
|
||||
if [ "$APP" = "worker" ]; then
|
||||
APP_DISPLAY="Worker Mobile"
|
||||
APP_EMOJI="👷"
|
||||
else
|
||||
APP_DISPLAY="Client Mobile"
|
||||
APP_EMOJI="💼"
|
||||
fi
|
||||
|
||||
ENV_UPPER=$(echo "$ENV" | tr '[:lower:]' '[:upper:]')
|
||||
RELEASE_NAME="Krow With Us - ${APP_DISPLAY} - ${ENV_UPPER} - v${VERSION}"
|
||||
|
||||
# Environment emoji
|
||||
case "$ENV" in
|
||||
dev)
|
||||
ENV_EMOJI="🔧"
|
||||
;;
|
||||
stage)
|
||||
ENV_EMOJI="🎭"
|
||||
;;
|
||||
prod)
|
||||
ENV_EMOJI="🚀"
|
||||
;;
|
||||
*)
|
||||
ENV_EMOJI="📦"
|
||||
;;
|
||||
esac
|
||||
|
||||
# Generate summary
|
||||
cat << EOF >> $GITHUB_STEP_SUMMARY
|
||||
## 🎉 Release Created Successfully
|
||||
|
||||
### ${APP_EMOJI} Application Details
|
||||
- **App:** ${APP_DISPLAY}
|
||||
- **Environment:** ${ENV_EMOJI} ${ENV_UPPER}
|
||||
- **Version:** \`${VERSION}\`
|
||||
- **Tag:** \`${TAG_NAME}\`
|
||||
|
||||
### 📦 Release Information
|
||||
**Release Name:** ${RELEASE_NAME}
|
||||
|
||||
### ✅ Next Steps
|
||||
|
||||
1. 🔍 **Verify** the tag and release on GitHub
|
||||
2. 🏗️ **Trigger** CodeMagic build (if configured)
|
||||
3. 📱 **Monitor** app store deployment
|
||||
4. 📚 **Update** project documentation if needed
|
||||
5. 🎯 **Communicate** release to stakeholders
|
||||
|
||||
### 🔗 Quick Links
|
||||
- [View Tag](../../releases/tag/${TAG_NAME})
|
||||
- [Release Documentation](../../docs/release/MOBILE_RELEASE_PLAN.md)
|
||||
- [CHANGELOG](../../apps/mobile/apps/${APP}/CHANGELOG.md)
|
||||
EOF
|
||||
|
||||
echo "✅ Summary generated successfully"
|
||||
Reference in New Issue
Block a user