Automation Tasks
- Increment of build number and version number
- Build and deploy to iOS
- Build and deploy to Android
So, let’s get started!
Make .env
ANDROID_UPLOAD_LINK: https://~~~
Make deploy.sh
#!/bin/bash
iosDeploy() {
echo "🍎 iOS build started 🚀🚀🚀"
flutter build ipa --release --export-options-plist=ExportOptions.plist
echo "🍎 iOS build finished 🎉🎉🎉"
}
androidDeploy() {
echo "🍏 Android build started 🚀🚀🚀"
flutter build appbundle
open -R ./build/app/outputs/bundle/release/app-release.aab
open $ANDROID_UPLOAD_LINK
echo "🍏 Android build finished 🎉🎉🎉"
}
# Increment version
perl -i -pe 's/^(version:\s+\d+\.\d+\.\d+\+)(\d+)$/$1.($2+1)/e' pubspec.yaml
source .env
# Deploy
iosDeploy &
androidDeploy &
wait
echo "Both builds finished 🎉🎉🎉"
Grant executive authority to deploy.sh
chmod +x deploy.sh
Try the command! 🦄
./deploy.sh
SAYONARA
Top comments (0)