Skip to content

Commit e15382d

Browse files
committed
build(scripts): Add bash script to automate build step
1 parent 06df025 commit e15382d

File tree

4 files changed

+65
-1
lines changed

4 files changed

+65
-1
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,4 +49,5 @@ app.*.map.json
4949
android/app/google-services.json
5050
ios/Runner/GoogleService-Info.plist
5151
ios/firebase_app_id_file.json
52-
lib/firebase_options.dart
52+
lib/firebase_options.dart
53+
scripts/*.plist

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,10 @@ The Silent Shard mobile app is an MPC-based Threshold Signer app as a usable, se
1515
- Navigate to the project directory
1616
- Install dependencies: `flutter pub get`
1717
- Run the app: `flutter run`
18+
19+
### Build
20+
- Build the app:
21+
- Android: `./build_android.sh [stg|prod]`
22+
- iOS: `./build_ios.sh [stg|prod]`
23+
24+
- Before building the app using the scripts, make sure to update the version in `pubspec.yaml` and copy `GoogleService-Info_<environment>.plist` into `scripts` (iOS only), you could find the file in the [Firebase console](https://console.firebase.google.com/u/0/project/mobile-wallet-mm-snap-staging/settings/general/ios:com.silencelaboratories.silentshard).

scripts/build_android.sh

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/bin/sh
2+
set -e
3+
DIR=$(dirname $0)
4+
5+
if [ -z "$1" ] || [ "$1" = "--help" ]; then
6+
echo "Usage: ./build_android.sh [stg|prod]"
7+
exit 1
8+
fi
9+
10+
if [ "$1" = "stg" ]; then
11+
echo "Building for staging"
12+
13+
flutter build apk --release
14+
elif [ "$1" = "prod" ]; then
15+
echo "Building for prod"
16+
17+
flutter build appbundle
18+
else
19+
echo "Invalid argument. Please use 'stg' or 'prod'"
20+
exit 1
21+
fi

scripts/build_ios.sh

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#!/bin/sh
2+
set -e
3+
DIR=$(dirname $0)
4+
5+
if [ -z "$1" ] || [ "$1" = "--help" ]; then
6+
echo "Usage: ./build_ios.sh [stg|prod]"
7+
exit 1
8+
fi
9+
10+
if [ "$1" = "stg" ]; then
11+
echo "Building for staging"
12+
13+
if [ ! -f "$DIR/GoogleService-Info_stg.plist" ]; then
14+
echo "GoogleService-Info_stg.plist not found! Please add it to the scripts folder"
15+
exit 1
16+
fi
17+
18+
cp $DIR/GoogleService-Info_stg.plist ios/Runner/GoogleService-Info.plist
19+
20+
flutter build ipa
21+
elif [ "$1" = "prod" ]; then
22+
echo "Building for prod"
23+
24+
if [ ! -f "$DIR/GoogleService-Info_prod.plist" ]; then
25+
echo "GoogleService-Info-prod.plist not found! Please add it to the scripts folder"
26+
exit 1
27+
fi
28+
29+
cp $DIR/GoogleService-Info_prod.plist ios/Runner/GoogleService-Info.plist
30+
31+
flutter build ipa
32+
else
33+
echo "Invalid argument. Please use 'stg' or 'prod'"
34+
exit 1
35+
fi

0 commit comments

Comments
 (0)