diff --git a/Configurations/make-release-package.sh b/Configurations/make-release-package.sh index 1d3ef02f..f50463f9 100755 --- a/Configurations/make-release-package.sh +++ b/Configurations/make-release-package.sh @@ -5,6 +5,7 @@ set -e # This guards against our archives being corrupt / created incorrectly. function verify_code_signatures() { verification_directory="$1" + check_aux_apps="$2" if [[ -z "$verification_directory" ]]; then echo "Provided verification directory does not exist" >&2 @@ -13,8 +14,11 @@ function verify_code_signatures() { # Search the current directory for all instances of the framework to verify them (XCFrameworks can have multiple copies of a framework for different platforms). find "${verification_directory}" -name "Sparkle.framework" -type d -exec codesign --verify -vvv --deep {} \; - codesign --verify -vvv --deep "${verification_directory}/sparkle.app" - codesign --verify -vvv --deep "${verification_directory}/Sparkle Test App.app" + + if [ "$check_aux_apps" = true ] ; then + codesign --verify -vvv --deep "${verification_directory}/sparkle.app" + codesign --verify -vvv --deep "${verification_directory}/Sparkle Test App.app" + fi codesign --verify -vvv --deep "${verification_directory}/bin/BinaryDelta" codesign --verify -vvv --deep "${verification_directory}/bin/generate_appcast" codesign --verify -vvv --deep "${verification_directory}/bin/sign_update" @@ -38,9 +42,7 @@ if [ "$ACTION" = "" ] ; then cp "$CONFIGURATION_BUILD_DIR/generate_keys" "$CONFIGURATION_BUILD_DIR/staging/bin" cp "$CONFIGURATION_BUILD_DIR/sign_update" "$CONFIGURATION_BUILD_DIR/staging/bin" cp -R "$CONFIGURATION_BUILD_DIR/Sparkle Test App.app" "$CONFIGURATION_BUILD_DIR/staging" - cp -R "$CONFIGURATION_BUILD_DIR/Sparkle Test App.app" "$CONFIGURATION_BUILD_DIR/staging-spm" cp -R "$CONFIGURATION_BUILD_DIR/sparkle.app" "$CONFIGURATION_BUILD_DIR/staging" - cp -R "$CONFIGURATION_BUILD_DIR/sparkle.app" "$CONFIGURATION_BUILD_DIR/staging-spm" cp -R "$CONFIGURATION_BUILD_DIR/Sparkle.framework" "$CONFIGURATION_BUILD_DIR/staging" cp -R "$CONFIGURATION_BUILD_DIR/Sparkle.xcframework" "$CONFIGURATION_BUILD_DIR/staging-spm" @@ -58,19 +60,28 @@ if [ "$ACTION" = "" ] ; then # because missing dSYMs in a release build SHOULD trigger a build failure if [ "$CONFIGURATION" = "Release" ] ; then cp -R "$CONFIGURATION_BUILD_DIR/BinaryDelta.dSYM" "$CONFIGURATION_BUILD_DIR/staging/Symbols" + cp -R "$CONFIGURATION_BUILD_DIR/generate_appcast.dSYM" "$CONFIGURATION_BUILD_DIR/staging/Symbols" + cp -R "$CONFIGURATION_BUILD_DIR/generate_keys.dSYM" "$CONFIGURATION_BUILD_DIR/staging/Symbols" + cp -R "$CONFIGURATION_BUILD_DIR/sign_update.dSYM" "$CONFIGURATION_BUILD_DIR/staging/Symbols" + cp -R "$CONFIGURATION_BUILD_DIR/Sparkle Test App.app.dSYM" "$CONFIGURATION_BUILD_DIR/staging/Symbols" + cp -R "$CONFIGURATION_BUILD_DIR/sparkle.app.dSYM" "$CONFIGURATION_BUILD_DIR/staging/Symbols" + cp -R "$CONFIGURATION_BUILD_DIR/Sparkle.framework.dSYM" "$CONFIGURATION_BUILD_DIR/staging/Symbols" + cp -R "$CONFIGURATION_BUILD_DIR/Autoupdate.dSYM" "$CONFIGURATION_BUILD_DIR/staging/Symbols" + cp -R "$CONFIGURATION_BUILD_DIR/Updater.app.dSYM" "$CONFIGURATION_BUILD_DIR/staging/Symbols" + cp -R "$CONFIGURATION_BUILD_DIR/${INSTALLER_LAUNCHER_NAME}.xpc.dSYM" "$CONFIGURATION_BUILD_DIR/staging/Symbols" + cp -R "$CONFIGURATION_BUILD_DIR/${DOWNLOADER_NAME}.xpc.dSYM" "$CONFIGURATION_BUILD_DIR/staging/Symbols" fi cp -R "$CONFIGURATION_BUILD_DIR/staging/bin" "$CONFIGURATION_BUILD_DIR/staging-spm" - cp -R "$CONFIGURATION_BUILD_DIR/staging/Symbols" "$CONFIGURATION_BUILD_DIR/staging-spm" cd "$CONFIGURATION_BUILD_DIR/staging" @@ -102,7 +113,7 @@ if [ "$ACTION" = "" ] ; then # Test code signing validity of the extracted products # This guards against our archives being corrupt / created incorrectly - verify_code_signatures "/tmp/sparkle-extract" + verify_code_signatures "/tmp/sparkle-extract" true rm -rf "/tmp/sparkle-extract" rm -rf "$CONFIGURATION_BUILD_DIR/staging" @@ -122,7 +133,7 @@ if [ "$ACTION" = "" ] ; then # Test code signing validity of the extracted Swift package # This guards against our archives being corrupt / created incorrectly ditto -x -k "../Sparkle-for-Swift-Package-Manager.zip" "/tmp/sparkle-spm-extract" - verify_code_signatures "/tmp/sparkle-spm-extract" + verify_code_signatures "/tmp/sparkle-spm-extract" false rm -rf "/tmp/sparkle-spm-extract" rm -rf "$CONFIGURATION_BUILD_DIR/staging-spm" diff --git a/Configurations/make-xcframework.sh b/Configurations/make-xcframework.sh new file mode 100755 index 00000000..1d1e2480 --- /dev/null +++ b/Configurations/make-xcframework.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +# Deleting old products +rm -rd "$BUILT_PRODUCTS_DIR/Sparkle.xcarchive" +rm -rd "$BUILT_PRODUCTS_DIR/Sparkle.xcframework" + +xcodebuild archive -scheme Sparkle -archivePath "$BUILT_PRODUCTS_DIR/Sparkle.xcarchive" BUILD_LIBRARY_FOR_DISTRIBUTION=YES SKIP_INSTALL=NO + +if [ $XCODE_VERSION_MAJOR -ge "1200" ]; then +xcodebuild -create-xcframework -framework "$BUILT_PRODUCTS_DIR/Sparkle.xcarchive/Products/Library/Frameworks/Sparkle.framework" -debug-symbols "$BUILT_PRODUCTS_DIR/Sparkle.xcarchive/dSYMs/Sparkle.framework.dSYM" -debug-symbols "$BUILT_PRODUCTS_DIR/Sparkle.xcarchive/dSYMs/Autoupdate.dSYM" -debug-symbols "$BUILT_PRODUCTS_DIR/Sparkle.xcarchive/dSYMs/Updater.app.dSYM" -debug-symbols "$BUILT_PRODUCTS_DIR/Sparkle.xcarchive/dSYMs/Installer.xpc.dSYM" -debug-symbols "$BUILT_PRODUCTS_DIR/Sparkle.xcarchive/dSYMs/Downloader.xpc.dSYM" -output "$BUILT_PRODUCTS_DIR/Sparkle.xcframework" +else +echo "warning: Your Xcode version does not support bundling dSYMs in XCFrameworks directly. You should copy them manually into the XCFramework." +echo "note: cp '$BUILT_PRODUCTS_DIR/Sparkle.xcarchive/dSYMs/Sparkle.framework.dSYM' '$BUILT_PRODUCTS_DIR/Sparkle.xcframework/your_architecture/dSYMs'" +xcodebuild -create-xcframework -framework "$BUILT_PRODUCTS_DIR/Sparkle.xcarchive/Products/Library/Frameworks/Sparkle.framework" -output "$BUILT_PRODUCTS_DIR/Sparkle.xcframework" +fi diff --git a/Sparkle.xcodeproj/project.pbxproj b/Sparkle.xcodeproj/project.pbxproj index c942e4f2..f6daf8ee 100644 --- a/Sparkle.xcodeproj/project.pbxproj +++ b/Sparkle.xcodeproj/project.pbxproj @@ -1086,6 +1086,7 @@ 722FB7E4260EE53F00EB571C /* SUNormalization.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SUNormalization.m; sourceTree = ""; }; 72316BD11E0DA8430039EFD9 /* SUUnarchiverNotifier.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SUUnarchiverNotifier.h; path = Autoupdate/SUUnarchiverNotifier.h; sourceTree = SOURCE_ROOT; }; 72316BD21E0DA8430039EFD9 /* SUUnarchiverNotifier.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SUUnarchiverNotifier.m; path = Autoupdate/SUUnarchiverNotifier.m; sourceTree = SOURCE_ROOT; }; + 7235B75E29DFC0120081FE4E /* make-xcframework.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = "make-xcframework.sh"; sourceTree = ""; }; 723ABCD7259A9A9D00BDB4FA /* Base */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = Base; path = Base.lproj/Sparkle.strings; sourceTree = ""; }; 723ABD37259A9BA500BDB4FA /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/SUUpdateAlert.xib; sourceTree = ""; }; 723ABD4C259A9BB900BDB4FA /* ar */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ar; path = ar.lproj/SUUpdateAlert.strings; sourceTree = ""; }; @@ -2495,6 +2496,7 @@ EA1E285722B6622E004AA304 /* ed25519-Release.xcconfig */, EA1E285922B6622E004AA304 /* ed25519-Shared.xcconfig */, 14732BC91960F70A00593899 /* make-release-package.sh */, + 7235B75E29DFC0120081FE4E /* make-xcframework.sh */, 14652F7919A93E5F00959E44 /* set-git-version-info.sh */, 72045CE426FEE708004F96E5 /* strip-framework.sh */, 720C192827127A3800740C8E /* release-move-tag.sh */, @@ -3321,7 +3323,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "# Deleting old products\nrm -rd \"$BUILT_PRODUCTS_DIR/Sparkle.xcarchive\"\nrm -rd \"$BUILT_PRODUCTS_DIR/Sparkle.xcframework\"\n\nxcodebuild archive -scheme Sparkle -archivePath \"$BUILT_PRODUCTS_DIR/Sparkle.xcarchive\" BUILD_LIBRARY_FOR_DISTRIBUTION=YES SKIP_INSTALL=NO\n\nif [ $XCODE_VERSION_MAJOR -ge \"1200\" ]; then\nxcodebuild -create-xcframework -framework \"$BUILT_PRODUCTS_DIR/Sparkle.xcarchive/Products/Library/Frameworks/Sparkle.framework\" -debug-symbols \"$BUILT_PRODUCTS_DIR/Sparkle.xcarchive/dSYMs/Sparkle.framework.dSYM\" -output \"$BUILT_PRODUCTS_DIR/Sparkle.xcframework\"\nelse\necho \"warning: Your Xcode version does not support bundling dSYMs in XCFrameworks directly. You should copy them manually into the XCFramework.\"\necho \"note: cp '$BUILT_PRODUCTS_DIR/Sparkle.xcarchive/dSYMs/Sparkle.framework.dSYM' '$BUILT_PRODUCTS_DIR/Sparkle.xcframework/your_architecture/dSYMs'\"\nxcodebuild -create-xcframework -framework \"$BUILT_PRODUCTS_DIR/Sparkle.xcarchive/Products/Library/Frameworks/Sparkle.framework\" -output \"$BUILT_PRODUCTS_DIR/Sparkle.xcframework\"\nfi\n"; + shellScript = "\"$SRCROOT/Configurations/make-xcframework.sh\"\n"; }; /* End PBXShellScriptBuildPhase section */