Skip to content

Commit 418de0d

Browse files
authored
fix: upload script fixed
1 parent c114a25 commit 418de0d

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

scripts/upload-apk.sh

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@ export DEVELOPMENT_BRANCH=${DEVELOPMENT_BRANCH:-development}
88
git config --global user.email "noreply@travis.com"
99
git config --global user.name "Travis CI"
1010

11+
if [ "$TRAVIS_PULL_REQUEST" != "false" -o "$TRAVIS_REPO_SLUG" != "fossasia/pslab-android" ] || ! [ "$TRAVIS_BRANCH" == "$DEVELOPMENT_BRANCH" -o "$TRAVIS_BRANCH" == "$PUBLISH_BRANCH" ]; then
12+
echo "We upload apk only for changes in Development or Master"
13+
exit 0
14+
fi
15+
1116
# Generate Playstore bundle
1217
./gradlew bundlePlaystoreRelease
1318

@@ -43,18 +48,17 @@ done
4348
git checkout --orphan temporary
4449
# Push generated apk files to apk branch
4550
git add .
46-
git commit -am "Travis build pushed to [$TRAVIS_BRANCH]"
51+
git commit -m "Travis build pushed to [$TRAVIS_BRANCH]"
4752

4853
# Delete current apk branch
4954
git branch -D apk
5055
# Rename current branch to apk
5156
git branch -m apk
5257

53-
git push origin apk --force --quiet > /dev/null
58+
git push origin apk -f --quiet > /dev/null
5459

5560
# Publish App to Play Store
5661
if [ "$TRAVIS_BRANCH" == "$PUBLISH_BRANCH" ]; then
57-
ls
5862
gem install fastlane
5963
fastlane supply --aab pslab-master-app.aab --track alpha --json_key ../scripts/fastlane.json --package_name $PACKAGE_NAME
6064
fi

0 commit comments

Comments
 (0)