forked from wordpress-clients/hybrid
-
Notifications
You must be signed in to change notification settings - Fork 0
/
release.sh.dist
40 lines (29 loc) · 1.6 KB
/
release.sh.dist
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
#!/bin/sh
set -e
ANDROID_ZIPALIGN="/path/to/Android/sdk/build-tools/21.1.2/zipalign"
ANDROID_KEY_PATH="/path/to/keystore/my-release-key.keystore"
ANDROID_KEY_ALIAS="alias_name"
read -p "Release major, minor or patch? " version
version=${version:-""}
read -p "Which platforms do you want to build? (android ios): " platforms
platforms=${platforms:-"android ios"}
# updgrade version before release
npm run increaseVersion -- -s ${version}
# package the app
npm run dumpprod
if [[ " ${platforms[*]} " == *" android "* ]]; then
npm run buildProdAndroid
jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore ${ANDROID_KEY_PATH} platforms/android/build/outputs/apk/android-x86-release-unsigned.apk ${ANDROID_KEY_ALIAS}
jarsigner -verify -certs platforms/android/build/outputs/apk/android-x86-release-unsigned.apk
${ANDROID_ZIPALIGN} -vf 4 platforms/android/build/outputs/apk/android-x86-release-unsigned.apk ./build/wphc-android-x86.apk
jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore ${ANDROID_KEY_PATH} platforms/android/build/outputs/apk/android-armv7-release-unsigned.apk ${ANDROID_KEY_ALIAS}
jarsigner -verify -certs platforms/android/build/outputs/apk/android-armv7-release-unsigned.apk
${ANDROID_ZIPALIGN} -vf 4 platforms/android/build/outputs/apk/android-armv7-release-unsigned.apk ./build/wphc-android-armv7.apk
fi
if [[ " ${platforms[*]} " == *" ios "* ]]; then
npm run buildProdIOS
rm -rf ./build/ios.app
mv ./platforms/ios/build/device/*.app ./build/ios.app
xcrun -sdk iphoneos PackageApplication -v $PWD/build/ios.app
sigh resign ./build/ios.ipa
fi