-
Notifications
You must be signed in to change notification settings - Fork 74
/
release-apps.sh
74 lines (48 loc) · 1.14 KB
/
release-apps.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#!/bin/sh
#alias rel='sh -x release-apps.sh'
set -e
set -x
perform_pub_actions() {
cd packages/hmssdk_flutter
echo "🌳🍀 git branch: $(git rev-parse --abbrev-ref HEAD)"
git pull --verbose
flutter pub get
cd ./example
}
release_android() {
cd ./android
bundle install --verbose
bundle exec fastlane release_on_firebase
}
release_iOS() {
cd ./ios
pod install --verbose
bundle install --verbose
bundle exec fastlane distribute_app
}
perform_git_actions() {
cd ..
while read line; do
if [[ $line =~ ^versionCode.[0-9]+$ ]]; then
buildNumber=$(echo $line | grep -o -E '[0-9]+')
elif [[ $line =~ ^versionName.*$ ]]; then
versionCode=$(echo $line | grep -o -E '[0-9].[0-9].[0-9]+')
fi
done <example/android/app/build.gradle
git add example/android/app/build.gradle
git add example/ios/Podfile.lock
git add example/ios/Runner/Info.plist
git add example/ios/Runner.xcodeproj/project.pbxproj
git commit -m "released sample app version $versionCode ($buildNumber) 🍀"
git push --verbose
}
perform_pub_actions
P1=$!
wait $P1
release_android &
P2=$!
release_iOS &
P3=$!
wait $P2 $P3
perform_git_actions
say done