Skip to content

Commit fab5875

Browse files
committed
CORE-1677 rework release scripts to build xcframeworks for testing. Separate actual release.
1 parent d86f9a1 commit fab5875

File tree

13 files changed

+168
-108
lines changed

13 files changed

+168
-108
lines changed

carthage-files/BranchSDK.xcodeproj/project.pbxproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1298,7 +1298,7 @@
12981298
);
12991299
runOnlyForDeploymentPostprocessing = 0;
13001300
shellPath = /bin/sh;
1301-
shellScript = "# config\nIOS_PATH=\"./build/ios/ios_static.xcarchive\"\nIOS_SIM_PATH=\"./build/ios/ios_static_sim.xcarchive\"\nXCFRAMEWORK_PATH=\"./build/static/Branch.xcframework\"\n\n# delete previous build\nrm -rf \"./build\" \n\n# build iOS framework\nxcodebuild archive \\\n -scheme Branch-static \\\n -archivePath \"${IOS_PATH}\" \\\n -sdk iphoneos \\\n SKIP_INSTALL=NO\n\n# build iOS simulator framework\nxcodebuild archive \\\n -scheme Branch-static \\\n -archivePath \"${IOS_SIM_PATH}\" \\\n -sdk iphonesimulator \\\n SKIP_INSTALL=NO\n\n# package frameworks\nxcodebuild -create-xcframework \\\n -framework \"${IOS_PATH}/Products/Library/Frameworks/Branch.framework\" \\\n -framework \"${IOS_SIM_PATH}/Products/Library/Frameworks/Branch.framework\" \\\n -output \"${XCFRAMEWORK_PATH}\"\n \n";
1301+
shellScript = "# config\nIOS_PATH=\"./build/ios/ios.xcarchive\"\nIOS_SIM_PATH=\"./build/ios/ios_sim.xcarchive\"\nXCFRAMEWORK_PATH=\"./build/Branch.xcframework\"\n\n# delete previous build\nrm -rf \"./build\" \n\n# build iOS framework\nxcodebuild archive \\\n -scheme Branch-static \\\n -archivePath \"${IOS_PATH}\" \\\n -sdk iphoneos \\\n SKIP_INSTALL=NO\n\n# build iOS simulator framework\nxcodebuild archive \\\n -scheme Branch-static \\\n -archivePath \"${IOS_SIM_PATH}\" \\\n -sdk iphonesimulator \\\n SKIP_INSTALL=NO\n\n# package frameworks\nxcodebuild -create-xcframework \\\n -framework \"${IOS_PATH}/Products/Library/Frameworks/Branch.framework\" \\\n -framework \"${IOS_SIM_PATH}/Products/Library/Frameworks/Branch.framework\" \\\n -output \"${XCFRAMEWORK_PATH}\"\n \n";
13021302
};
13031303
/* End PBXShellScriptBuildPhase section */
13041304

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

4-
# deploy-announce - Prompts to check the announcement of a new SDK version.
4+
# announce_sdk_release.sh - Prompts to check the announcement of a new SDK version.
55
#
66
# Edward Smith, January 2017
77

8-
version=$(./scripts/version)
8+
version=$(./scripts/version.sh)
99

1010
echo ""
1111
echo ""

scripts/askYN renamed to scripts/askYN.sh

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

3-
# askYN - Ask the user a yes/no question on stdout/stdin.
3+
# askYN.sh - Ask the user a yes/no question on stdout/stdin.
44
#
5-
# Usage: askYN [ "Question?" ]
5+
# Usage: askYN.sh [ "Question?" ]
66
#
77
# Exits with code 0 for yes, 1 for no.
88
#
Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,33 @@
11
#!/bin/bash
22
set -euo pipefail
33

4-
# deploy-checksum - The zip & checksum the framework.
5-
#
6-
# Edward Smith, December 2016
7-
84
scriptname=$(basename "${BASH_SOURCE[0]}")
95
scriptpath="${BASH_SOURCE[0]}"
106
scriptpath=$(cd "$(dirname "${scriptpath}")" && pwd)
7+
cd ${scriptpath}/../carthage-files
8+
9+
# Build
10+
echo "Building Branch.xcframework"
11+
xcodebuild -scheme 'Branch-xcframework'
12+
13+
# Move to build folder
1114
cd ${scriptpath}/../carthage-files/build
1215

1316
# Zip the SDK files
14-
echo "Zipping frameworks"
17+
echo "Zipping Branch.xcframework"
1518
zip -rqy Branch.zip Branch.xcframework/
1619

17-
# Checksum the zip files
18-
echo "Creating checksums"
20+
# Checksum the zip file
21+
echo "Creating Branch.zip checksum"
1922
checksum_file=checksum
2023

2124
echo '#checksum for Branch.zip on Github' > "$checksum_file"
2225
shasum Branch.zip >> $checksum_file
2326

24-
# remove source frameworks
27+
# Move zip file and checksum
2528
mv Branch.zip ..
2629
mv checksum ..
30+
31+
# Remove source frameworks
2732
echo "Cleaning up"
2833
rm -rf Branch.xcframework
29-

scripts/build_static_framework.sh

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#!/bin/bash
2+
set -euo pipefail
3+
4+
scriptname=$(basename "${BASH_SOURCE[0]}")
5+
scriptpath="${BASH_SOURCE[0]}"
6+
scriptpath=$(cd "$(dirname "${scriptpath}")" && pwd)
7+
cd ${scriptpath}/../carthage-files
8+
9+
# Build
10+
echo "Building Branch.xcframework"
11+
xcodebuild -scheme 'Branch-static-xcframework'
12+
13+
# Move to build folder
14+
cd ${scriptpath}/../carthage-files/build
15+
16+
# Zip the SDK files
17+
echo "Zipping static Branch.xcframework"
18+
zip -rqy Branch_static.zip Branch.xcframework/
19+
20+
# Checksum the zip file
21+
echo "Creating Branch_static.zip checksum"
22+
checksum_file=checksum_static
23+
24+
echo '#checksum for Branch_static.zip on Github' > "$checksum_file"
25+
shasum Branch_static.zip >> $checksum_file
26+
27+
# Move zip file and checksum
28+
mv Branch_static.zip ..
29+
mv checksum_static ..
30+
31+
# Remove source frameworks
32+
echo "Cleaning up"
33+
rm -rf Branch.xcframework
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/bash
22
set -euo pipefail
33

4-
# deploy-preflight - Check that the development environment is set up for deployment.
4+
# check_build_environment.sh - Check that the development environment is set up for deployment.
55
#
66
# Edward Smith, January 2017
77

scripts/deploy-build-framework

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

scripts/deploy-release

Lines changed: 0 additions & 76 deletions
This file was deleted.
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/bash
22
set -euo pipefail
33

4-
# deploy-git-tag - Commit and push the current git changes. Create a version tag and push to master.
4+
# git_commit_and_tag.sh - Commit and push the current git changes. Create a version tag and push to master.
55
#
66
# Edward Smith, January 2017
77

@@ -10,7 +10,7 @@ scriptfile="${scriptfile}"/$(basename "$0")
1010
cd $(dirname "$scriptfile")/..
1111

1212
git_branch=$(git symbolic-ref --short HEAD)
13-
version=$(./scripts/version)
13+
version=$(./scripts/version.sh)
1414

1515
echo ">>> Merging and pushing '$git_branch' to master..." 1>&2
1616

scripts/prep_release.sh

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
#!/bin/bash
2+
set -euo pipefail
3+
4+
# prep_release.sh - prepares release candidate for testing
5+
#
6+
# This script is written to be excessively modular so it can be debugged or restarted easily.
7+
#
8+
# Edward Smith, December 2016
9+
10+
scriptfile="$( cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
11+
scriptfile="${scriptfile}"/$(basename "$0")
12+
cd $(dirname "$scriptfile")/..
13+
14+
scriptFailed=1
15+
function finish {
16+
if [ $scriptFailed -ne 0 ]; then
17+
echo ">>> Error: `basename "$scriptfile"` failed!" 1>&2
18+
exit 1
19+
fi
20+
}
21+
trap finish EXIT
22+
23+
24+
version=$(./scripts/version.sh)
25+
26+
echo ""
27+
echo "Before continuing:"
28+
echo "- Make sure that the release version number is already updated."
29+
echo "- Make sure that the ChangeLog.md has been updated, spell checked, and is coherent."
30+
echo "- Unit tests pass in Xcode"
31+
echo ""
32+
if ! ./scripts/askYN.sh "Build Branch release candidate version ${version}?"; then
33+
echo ">>> Nothing built." 1>&2
34+
exit 1
35+
fi
36+
37+
# Prompt for editor input for ChangeLog.
38+
nano ChangeLog.md
39+
40+
# Check that deployment software is installed
41+
./scripts/check_build_environment.sh
42+
43+
# Pre-release CocoaPod lint
44+
echo ">>> Linting release candidate..." 1>&2
45+
pod lib lint Branch.podspec --verbose
46+
47+
# Build the frameworks
48+
echo ">>> Building the frameworks..." 1>&2
49+
./scripts/build_framework.sh
50+
./scripts/build_static_framework.sh
51+
52+
echo ""
53+
echo "SDK release candidate is ready for testing"
54+
55+
# Completed OK:
56+
scriptFailed=0

0 commit comments

Comments
 (0)