This repository has been archived by the owner on Sep 8, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathrelease.sh
81 lines (68 loc) · 1.86 KB
/
release.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
75
76
77
78
79
80
81
#!/bin/bash
help="release.sh \
-p <platform>"
while getopts ":p:h:" opt
do
case $opt in
p)
platform=$OPTARG
;;
h)
echo "$help"
exit 1;;
?)
echo "$help"
exit 1;;
esac
done
if [ -z "$platform" ]; then
echo "$help"
exit 1
fi
if [ ! -d "outputs" ]; then
mkdir outputs
else
rm -rf outputs
mkdir outputs
fi
current=$(date "+%Y-%m-%d_%H:%M:%S")
watchman watch-del-all
rm -rf node_modules
yarn install
rm -rf /tmp/metro-*
cd example || exit 1
watchman watch-del-all
rm -rf node_modules
yarn install
rm -rf /tmp/metro-*
if [ "$platform" == "android" ]; then
cd android || exit 1
chmod +x ./gradlew
./gradlew clean
./gradlew assembleRelease
mv ./app/build/outputs/apk/release/app-release.apk ../../outputs/"rn-im-example-$current".apk || exit 1
elif [ "$platform" == "ios" ]; then
cd ios || exit 1
pod update
pod install
xcodebuild clean \
-workspace "./ReactNativeImlibExample.xcworkspace" \
-scheme "ReactNativeImlibExample" \
-configuration "Release" \
-quiet
xcodebuild archive \
-workspace "./ReactNativeImlibExample.xcworkspace" \
-scheme "ReactNativeImlibExample" \
-archivePath "./build/ReactNativeImlibExample.xcarchive" \
-configuration "Release" \
-sdk iphoneos \
APP_PROFILE="" \
SHARE_PROFILE="" \
-allowProvisioningUpdates
xcodebuild -exportArchive \
-archivePath "./build/ReactNativeImlibExample.xcarchive" \
-exportOptionsPlist "archive.plist" \
-exportPath "./build" \
-allowProvisioningUpdates
mv ./build/ReactNativeImlibExample.ipa ../../outputs/"rn-im-example-$current".ipa || exit 1
fi