Skip to content

Commit ae436ea

Browse files
committed
chore: improve bash script for release
1 parent 14a654b commit ae436ea

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

scripts/prep-key.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
#!/bin/sh
22
set -e
33

4-
export DEPLOY_BRANCH=${DEPLOY_BRANCH:-development}
5-
export PUBLISH_BRANCH=${PUBLISH_BRANCH:-master}
4+
[[ $TRAVIS_PULL_REQUEST =~ ^(false)$ && $TRAVIS_REPO_SLUG =~ ^(fossasia/open-event-attendee-android)$ && $TRAVIS_BRANCH =~ ^(development|master)$ ]] && DEV_OR_MASTER_BUILD=true || DEV_OR_MASTER_BUILD=false
5+
[[ $TRAVIS_BRANCH =~ ^(master)$ && $TRAVIS_REPO_SLUG =~ ^(fossasia/open-event-attendee-android)$ && $TRAVIS_PULL_REQUEST_SLUG =~ ^(fossasia/open-event-attendee-android)$ ]] && PR_FOR_RELEASE=true || PR_FOR_RELEASE=false
66

7-
if [ "$TRAVIS_PULL_REQUEST" != "false" -o "$TRAVIS_REPO_SLUG" != "fossasia/open-event-attendee-android" ] || ! [ "$TRAVIS_BRANCH" == "$DEPLOY_BRANCH" -o "$TRAVIS_BRANCH" == "$PUBLISH_BRANCH" ]; then
7+
if ! ( $DEV_OR_MASTER_BUILD || $PR_FOR_RELEASE ); then
88
echo "We decrypt key only for pushes to the master branch and not PRs. So, skip."
99
exit 0
1010
fi

scripts/update-apk.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,9 @@ if $IS_PUBLISH_BRANCH ;then
5757
cd ..
5858
gem install fastlane
5959
fastlane supply --aab ./apk/eventyay-attendee-master-app-playStore-release.aab --skip_upload_apk true --track alpha --json_key ./scripts/fastlane.json --package_name $PACKAGE_NAME $FASTLANE_DRY_RUN
60+
if [ $? -ne 0 ]; then
61+
exit 1
62+
fi
6063
if $PR_FOR_RELEASE ;then
6164
exit 0
6265
fi

0 commit comments

Comments
 (0)