11#! /bin/bash
22set -euo pipefail
33
4- # deploy-release
4+ # deploy-release
5+ # Edward Smith, December 2016
56
67scriptfile=" $( cd " $( dirname " ${BASH_SOURCE[0]} " ) " && pwd) "
78scriptfile=" ${scriptfile} " /$( basename " $0 " )
89cd $( dirname " $scriptfile " ) /..
910
1011version=$( ./scripts/version)
1112
13+ scriptFailed=1
14+ function finish {
15+ if [ $scriptFailed -ne 0 ]; then
16+ echo " >>> Error: ` basename " $scriptfile " ` failed!" 1>&2
17+ exit 1
18+ fi
19+ }
20+ trap finish EXIT
21+
22+
1223if ! ./scripts/askYN " Deploy Branch release version ${version} ?" ; then
1324 echo " >>> Nothing deployed." 1>&2
1425 exit 1
1526fi
1627
28+
1729git_branch=$( git symbolic-ref --short HEAD)
1830
1931# Prompt for editor input for ChangeLog.
@@ -60,8 +72,8 @@ git commit -m "Updates for ${version} release"
6072git push
6173git checkout master
6274git pull
63- git merge origin " $git_branch "
64- git commit
75+ git merge -m " Merge $git_branch " origin " $git_branch "
76+ ( git commit || true)
6577git tag " ${version} "
6678git push
6779git push --tags origin master
@@ -70,7 +82,7 @@ echo '>>> Pushing Branch Cocoapod...' 1>&2
7082pod trunk push Branch.podspec
7183
7284
73- # Finally, deploy the zips to AWS:
85+ # Finally, deploy the zips to AWS:
7486echo ' >>> Uploading to AWS...' 1>&2
7587aws s3 cp --acl public-read Branch-iOS-SDK.zip s3://branchhost/
7688aws s3 cp --acl public-read Branch-iOS-TestBed.zip s3://branchhost/
@@ -79,7 +91,16 @@ aws s3 cp --acl public-read Branch-iOS-TestBed.zip s3://branchhost/
7991open ChangeLog.md
8092open ' https://github.com/BranchMetrics/ios-branch-deep-linking/releases/new'
8193open ' https://groups.google.com/forum/#!newtopic/branch-sdk-releases'
94+ open " ./carthage-files"
8295echo " Inform the SDK Releases Group! We've released."
8396echo " Subject: 'iOS SDK Release $version '"
8497echo " Body: < The change log >"
98+ echo " "
99+ echo " Also, add the carthage-files 'Branch.framework.zip' to the Github release."
100+
101+ # Remove remnants:
102+ (rm Branch-iOS-SDK.zip || true)
103+ (rm Branch-iOS-TestBed.zip || true)
85104
105+ # Completed OK:
106+ scriptFailed=0
0 commit comments