Skip to content

Commit 923066d

Browse files
authored
Make the release scripts more robust AIS-172 (#544)
* Added better script prompts. * Added 'whichapp' to find build tools. * Added more scripts, updated documentation. * Documented release steps. * Moved release procedure document to Confluence. Cleaned up project files.
1 parent d6a9d03 commit 923066d

File tree

12 files changed

+283
-158
lines changed

12 files changed

+283
-158
lines changed
File renamed without changes.
File renamed without changes.

iOS_SDK_Release_Procedure

Lines changed: 0 additions & 110 deletions
This file was deleted.

scripts/deploy-announce

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#!/bin/bash
2+
set -euo pipefail
3+
4+
# deploy-announce - Prompts to check the announcement of a new SDK version.
5+
#
6+
# Edward Smith, January 2017
7+
8+
version=$(./scripts/version)
9+
10+
echo ""
11+
echo ""
12+
echo ">>> Huzzah! The Branch SDK for iOS has been published!"
13+
echo ">>> Inform the world!"
14+
echo ""
15+
echo "Add a release announcement in Google Groups:"
16+
echo "Subject: 'An Update for the Branch SDK for iOS is Available: Version $version'"
17+
echo " Body: < The change log >"
18+
open 'https://groups.google.com/forum/#!newtopic/branch-sdk-releases'
19+
open ChangeLog.md
20+
echo ""
21+
echo "Add a similar announcement at Github:"
22+
echo "Subject: 'Release $version'"
23+
echo " Body: < The change log >"
24+
echo "Also, add the ./carthage-files/Branch.framework.zip to the Github release."
25+
open 'https://github.com/BranchMetrics/ios-branch-deep-linking/releases/new'
26+
open "./carthage-files"
27+
echo ""
28+
echo "- Check that the Fabric has uploaded & the version is correct."
29+
open -a Fabric.app
30+
echo "- Check that the CocoaPod has uploaded & the version is correct."
31+
open 'https://cocoapods.org/pods/Branch#changelog'

scripts/deploy-carthage

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
#!/bin/bash
22
set -euo pipefail
33

4-
# deploy-carthage -- Deploy the Branch.framework with Carthage
5-
# EB Smith. November, 2016.
4+
# deploy-carthage -- Deploy the Branch.framework with Carthage
5+
#
6+
# Edward Smith, November 2016
67

78
scriptname=$(basename "${BASH_SOURCE[0]}")
89
scriptpath="${BASH_SOURCE[0]}"

scripts/deploy-check

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
#!/bin/bash
2+
set -euo pipefail
3+
4+
# deploy-check - Check that the development environment is set up for deployment.
5+
#
6+
# Edward Smith, January 2017
7+
8+
9+
wasError=0
10+
11+
12+
function checkApp() {
13+
local appname="$1"
14+
local apppath=$(./scripts/whichapp "$appname" 2>&1)
15+
if (( ${#apppath} == 0 )); then
16+
echo ">>> Error: The application $appname not installed." 1>&2
17+
wasError=1
18+
fi
19+
}
20+
21+
22+
function checkTool() {
23+
local appname="$1"
24+
local apppath=$(which "$appname")
25+
if (( ${#apppath} == 0 )); then
26+
echo ">>> Error: The tool '$appname' is not installed." 1>&2
27+
wasError=1
28+
fi
29+
}
30+
31+
32+
function checkVariable() {
33+
local v=$1
34+
if [ -z ${!v+x} ]; then
35+
echo ">>> Error: Bash variable '$v' is unset." 1>&2
36+
wasError=1
37+
fi
38+
local vval=${!v}
39+
if (( ${#vval} == 0 )); then
40+
echo ">>> Error: Bash variable '$v' is empty." 1>&2
41+
wasError=1
42+
fi
43+
}
44+
45+
46+
# Check vim
47+
checkTool vim
48+
49+
# Check Xcode
50+
checkApp Xcode
51+
52+
# Check CocoaPods
53+
checkTool pod
54+
55+
# Check Carthage
56+
checkTool carthage
57+
58+
# Check Fabric
59+
checkApp Fabric
60+
checkVariable FABRIC_KEY
61+
62+
# Check Github
63+
if ! git push --dry-run &> /dev/null; then
64+
echo ">>> Error: Not able to push to github." 1>&2
65+
wasError=1
66+
fi
67+
68+
# Check AWS
69+
checkTool aws
70+
checkVariable AWS_ACCESS_KEY_ID
71+
checkVariable AWS_SECRET_ACCESS_KEY
72+
checkVariable AWS_DEFAULT_REGION
73+
74+
# Check Google login
75+
#open 'https://groups.google.com/forum/#!newtopic/branch-sdk-releases'
76+
77+
78+
if [[ $wasError != 0 ]]; then
79+
echo ">>> Error: deploy-check failed." 1>&2
80+
exit 1
81+
fi
82+

scripts/deploy-checksum

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/bin/bash
2+
set -euo pipefail
3+
4+
# deploy-checksum - The zip & checksum the framework.
5+
#
6+
# Edward Smith, December 2016
7+
8+
9+
# Zip the SDK files
10+
echo '>>> Zipping Branch-iOS-SDK...' 1>&2
11+
zip -rqy Branch-iOS-SDK.zip Branch-SDK/ Branch.framework/
12+
13+
echo '>>> Zipping Branch-iOS-TestBed...' 1>&2
14+
zip -rqy Branch-iOS-TestBed.zip Branch-SDK/ Branch-TestBed/ Branch.framework/
15+
16+
# Checksum the zip files
17+
echo '>>> Creating checksum file...' 1>&2
18+
checksum_file=checksum
19+
echo '#checksum for Branch-iOS-SDK found at https://s3-us-west-1.amazonaws.com/branchhost/Branch-iOS-SDK.zip' > "$checksum_file"
20+
shasum Branch-iOS-SDK.zip >> $checksum_file
21+
22+
echo '#checksum for Branch-iOS-TestBed found at https://s3-us-west-1.amazonaws.com/branchhost/Branch-iOS-TestBed.zip' >> "$checksum_file"
23+
shasum Branch-iOS-TestBed.zip >> $checksum_file

scripts/deploy-fabric

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
#!/bin/bash
22
set -euo pipefail
33

4-
# deploy-fabric -- Deploy the Branch.framework to Fabric
5-
# EB Smith. October, 2016.
4+
# deploy-fabric - Deploys Branch.framework to Fabric
5+
#
6+
# Edward Smith, October 2016
67

78
scriptname=$(basename "BASH_SOURCE[0]")
89
scriptpath="${BASH_SOURCE[0]}"

scripts/deploy-git-tag

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
#!/bin/bash
2+
set -euo pipefail
23

3-
# deploy-git-tag
4+
# deploy-git-tag - Commit and push the current git changes. Create a version tag and push to master.
5+
#
46
# Edward Smith, January 2017
57

6-
set -euo pipefail
7-
88
scriptfile="$( cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
99
scriptfile="${scriptfile}"/$(basename "$0")
1010
cd $(dirname "$scriptfile")/..

0 commit comments

Comments
 (0)