File tree 5 files changed +36
-0
lines changed
5 files changed +36
-0
lines changed Original file line number Diff line number Diff line change @@ -130,3 +130,7 @@ fabric.properties
130
130
# ## AndroidStudio Patch ###
131
131
132
132
! /gradle /wrapper /gradle-wrapper.jar
133
+
134
+ fastlane.json
135
+ key.jks
136
+ secrets.tar
Original file line number Diff line number Diff line change @@ -21,4 +21,5 @@ install:
21
21
script :
22
22
- ./gradlew build
23
23
after_success :
24
+ - bash scripts/prep-key.sh
24
25
- bash scripts/update-apk.sh
Original file line number Diff line number Diff line change
1
+ #! /bin/sh
2
+ set -e
3
+
4
+ export DEPLOY_BRANCH=${DEPLOY_BRANCH:- master}
5
+
6
+ if [ " $TRAVIS_PULL_REQUEST " != " false" -o " $TRAVIS_REPO_SLUG " != " fossasia/open-event-android" -o " $TRAVIS_BRANCH " != " $DEPLOY_BRANCH " ]; then
7
+ echo " We decrypt key only for pushes to the master branch and not PRs. So, skip."
8
+ exit 0
9
+ fi
10
+
11
+ # Decrypt keys
12
+ openssl aes-256-cbc -K $encrypted_59a1db41ee4d_key -iv $encrypted_59a1db41ee4d_iv -in ./scripts/secrets.tar.enc -out ./scripts/secrets.tar -d
13
+ tar xvf ./scripts/secrets.tar -C scripts/
Original file line number Diff line number Diff line change @@ -47,6 +47,15 @@ if [ "$TRAVIS_BRANCH" == "$DEPLOY_BRANCH" ]; then
47
47
done
48
48
fi
49
49
50
+ # Signing Apps
51
+
52
+ if [ " $TRAVIS_BRANCH " == " $PUBLISH_BRANCH " ]; then
53
+ echo " Push to master branch detected, signing the app..."
54
+ cp app-release-unsigned.apk app-release-unaligned.apk
55
+ jarsigner -verbose -tsa http://timestamp.comodoca.com/rfc3161 -sigalg SHA1withRSA -digestalg SHA1 -keystore ../scripts/key.jks -storepass $STORE_PASS -keypass $KEY_PASS app-release-unaligned.apk $ALIAS
56
+ ${ANDROID_HOME} /build-tools/27.0.3/zipalign -v -p 4 app-release-unaligned.apk app-release.apk
57
+ fi
58
+
50
59
# Create a new branch that will contains only latest apk
51
60
git checkout --orphan temporary
52
61
@@ -61,3 +70,12 @@ git branch -m apk
61
70
62
71
# Force push to origin since histories are unrelated
63
72
git push origin apk --force --quiet > /dev/null
73
+
74
+ # Publish App to Play Store
75
+ if [ " $TRAVIS_BRANCH " != " $PUBLISH_BRANCH " ]; then
76
+ echo " We publish apk only for changes in master branch. So, let's skip this shall we ? :)"
77
+ exit 0
78
+ fi
79
+
80
+ gem install fastlane
81
+ fastlane supply --apk test-app-release.apk --track alpha --json_key ../scripts/fastlane.json --package_name $PACKAGE_NAME
You can’t perform that action at this time.
0 commit comments