-
Notifications
You must be signed in to change notification settings - Fork 243
Emt 1964 Automate code signing and dSym binaries generation #1497
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -8,6 +8,8 @@ TVOS_PATH="./build/tvos/tvos.xcarchive" | |||||||||||||||||||||||
TVOS_SIM_PATH="./build/tvos/tvos_sim.xcarchive" | ||||||||||||||||||||||||
CATALYST_PATH="./build/catalyst/catalyst.xcarchive" | ||||||||||||||||||||||||
XCFRAMEWORK_PATH="./build/BranchSDK.xcframework" | ||||||||||||||||||||||||
XCFRAMEWORK_PATH_SIGNED="./build/signedFramework/" | ||||||||||||||||||||||||
XCFRAMEWORK_PATH_dSYM="./build/dSymFramework/BranchSDK.xcframework" | ||||||||||||||||||||||||
|
||||||||||||||||||||||||
# delete previous build | ||||||||||||||||||||||||
rm -rf "./build" | ||||||||||||||||||||||||
|
@@ -56,5 +58,21 @@ xcodebuild -create-xcframework \ | |||||||||||||||||||||||
-framework "${CATALYST_PATH}/Products/Library/Frameworks/BranchSDK.framework" \ | ||||||||||||||||||||||||
-output "${XCFRAMEWORK_PATH}" | ||||||||||||||||||||||||
|
||||||||||||||||||||||||
|
||||||||||||||||||||||||
|
||||||||||||||||||||||||
# create signed binary | ||||||||||||||||||||||||
mkdir -p "${XCFRAMEWORK_PATH_SIGNED}" | ||||||||||||||||||||||||
cp -rf "${XCFRAMEWORK_PATH}" "${XCFRAMEWORK_PATH_SIGNED}" | ||||||||||||||||||||||||
codesign --deep --timestamp -s "Apple Distribution: Branch Metrics, Inc. (R63EM248DP)" "${XCFRAMEWORK_PATH_SIGNED}/BranchSDK.xcframework" | ||||||||||||||||||||||||
Comment on lines
+61
to
+64
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Code Refactor Issue: The codesign command doesn't have error handling, which could lead to silent failures.
Suggested change
|
||||||||||||||||||||||||
|
||||||||||||||||||||||||
# package framework with dSyms | ||||||||||||||||||||||||
xcodebuild -create-xcframework \ | ||||||||||||||||||||||||
-framework "${IOS_PATH}/Products/Library/Frameworks/BranchSDK.framework" \ | ||||||||||||||||||||||||
-debug-symbols "$(pwd)/build/ios/ios.xcarchive/dSYMs/BranchSDK.framework.dSYM"\ | ||||||||||||||||||||||||
-framework "${IOS_SIM_PATH}/Products/Library/Frameworks/BranchSDK.framework" \ | ||||||||||||||||||||||||
-debug-symbols "$(pwd)/build/ios/ios_sim.xcarchive/dSYMs/BranchSDK.framework.dSYM"\ | ||||||||||||||||||||||||
-framework "${TVOS_PATH}/Products/Library/Frameworks/BranchSDK.framework" \ | ||||||||||||||||||||||||
-debug-symbols "$(pwd)/build/tvos/tvos.xcarchive/dSYMs/BranchSDK.framework.dSYM"\ | ||||||||||||||||||||||||
-framework "${TVOS_SIM_PATH}/Products/Library/Frameworks/BranchSDK.framework" \ | ||||||||||||||||||||||||
-debug-symbols "$(pwd)/build/tvos/tvos_sim.xcarchive/dSYMs/BranchSDK.framework.dSYM"\ | ||||||||||||||||||||||||
-framework "${CATALYST_PATH}/Products/Library/Frameworks/BranchSDK.framework" \ | ||||||||||||||||||||||||
-debug-symbols "$(pwd)/build/catalyst/catalyst.xcarchive/dSYMs/BranchSDK.framework.dSYM"\ | ||||||||||||||||||||||||
-output "${XCFRAMEWORK_PATH_dSYM}" |
Original file line number | Diff line number | Diff line change | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -8,6 +8,7 @@ TVOS_PATH="./build/tvos/tvos.xcarchive" | |||||||||||||||||
TVOS_SIM_PATH="./build/tvos/tvos_sim.xcarchive" | ||||||||||||||||||
CATALYST_PATH="./build/catalyst/catalyst.xcarchive" | ||||||||||||||||||
XCFRAMEWORK_PATH="./build/BranchSDK.xcframework" | ||||||||||||||||||
XCFRAMEWORK_PATH_SIGNED="./build/signedNoIDFAFramework/" | ||||||||||||||||||
|
||||||||||||||||||
# delete previous build | ||||||||||||||||||
rm -rf "./build" | ||||||||||||||||||
|
@@ -61,5 +62,7 @@ xcodebuild -create-xcframework \ | |||||||||||||||||
-framework "${CATALYST_PATH}/Products/Library/Frameworks/BranchSDK.framework" \ | ||||||||||||||||||
-output "${XCFRAMEWORK_PATH}" | ||||||||||||||||||
|
||||||||||||||||||
|
||||||||||||||||||
|
||||||||||||||||||
# create signed binary | ||||||||||||||||||
mkdir -p "${XCFRAMEWORK_PATH_SIGNED}" | ||||||||||||||||||
cp -rf "${XCFRAMEWORK_PATH}" "${XCFRAMEWORK_PATH_SIGNED}" | ||||||||||||||||||
codesign --timestamp -s "Apple Distribution: Branch Metrics, Inc. (R63EM248DP)" "${XCFRAMEWORK_PATH_SIGNED}/BranchSDK.xcframework" | ||||||||||||||||||
|
# create signed binary | |
mkdir -p "${XCFRAMEWORK_PATH_SIGNED}" | |
cp -rf "${XCFRAMEWORK_PATH}" "${XCFRAMEWORK_PATH_SIGNED}" | |
codesign --timestamp -s "Apple Distribution: Branch Metrics, Inc. (R63EM248DP)" "${XCFRAMEWORK_PATH_SIGNED}/BranchSDK.xcframework" | |
# create signed binary | |
mkdir -p \"${XCFRAMEWORK_PATH_SIGNED}\" | |
cp -rf \"${XCFRAMEWORK_PATH}\" \"${XCFRAMEWORK_PATH_SIGNED}\" | |
codesign --deep --timestamp -s \"Apple Distribution: Branch Metrics, Inc. (R63EM248DP)\" \"${XCFRAMEWORK_PATH_SIGNED}/BranchSDK.xcframework\"``` |
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -6,6 +6,12 @@ scheme='xcframework' | |||||||||||||||||||||||||||||||||
checksum_file=checksum.txt | ||||||||||||||||||||||||||||||||||
zip_file=Branch.zip | ||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||
checksum_file_signed=checksum_signed_xcframework.txt | ||||||||||||||||||||||||||||||||||
zip_file_signed=Branch_signed_xcframework.zip | ||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||
checksum_file_WithdSym=checksum_xcframework_WithdSym.txt | ||||||||||||||||||||||||||||||||||
zip_file_WithdSym=Branch_xcframework_WithdSym.zip | ||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||
scriptname=$(basename "${BASH_SOURCE[0]}") | ||||||||||||||||||||||||||||||||||
scriptpath="${BASH_SOURCE[0]}" | ||||||||||||||||||||||||||||||||||
scriptpath=$(cd "$(dirname "${scriptpath}")" && pwd) | ||||||||||||||||||||||||||||||||||
|
@@ -33,3 +39,15 @@ mv $checksum_file .. | |||||||||||||||||||||||||||||||||
# Remove source frameworks | ||||||||||||||||||||||||||||||||||
echo "Cleaning up" | ||||||||||||||||||||||||||||||||||
rm -rf BranchSDK.xcframework | ||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||
echo "Packaging signed BranchSDK.xcframework" | ||||||||||||||||||||||||||||||||||
zip -rqy $zip_file_signed ./signedFramework/BranchSDK.xcframework/ | ||||||||||||||||||||||||||||||||||
shasum $zip_file_signed >> $checksum_file_signed | ||||||||||||||||||||||||||||||||||
mv $zip_file_signed .. | ||||||||||||||||||||||||||||||||||
mv $checksum_file_signed .. | ||||||||||||||||||||||||||||||||||
Comment on lines
+42
to
+47
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Code Refactor Issue: The script doesn't check if the signed framework directory exists before attempting to package it.
Suggested change
|
||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||
echo "Packaging debug BranchSDK.xcframework with dSyms" | ||||||||||||||||||||||||||||||||||
zip -rqy $zip_file_WithdSym ./dSymFramework/BranchSDK.xcframework/ | ||||||||||||||||||||||||||||||||||
shasum $zip_file_WithdSym >> $checksum_file_WithdSym | ||||||||||||||||||||||||||||||||||
mv $zip_file_WithdSym .. | ||||||||||||||||||||||||||||||||||
mv $checksum_file_WithdSym .. | ||||||||||||||||||||||||||||||||||
Comment on lines
+48
to
+53
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Code Refactor Issue: Similar to the signed framework, there's no check if the dSym framework directory exists before packaging.
Suggested change
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Code Refactor
Issue: The certificate name is hardcoded, which makes it less maintainable and harder to change in the future.
Fix: Extract the certificate name to a variable at the top of the script.
Impact: Improves maintainability and makes it easier to update the certificate name in the future.