From 3d5b01c4fac532e992b0b8433c02ff884150805b Mon Sep 17 00:00:00 2001 From: Alexander Cyon Date: Fri, 16 Feb 2024 14:24:29 +0100 Subject: [PATCH] output zip path not folder --- Package.swift | 2 +- scripts/ios/build-sargon.sh | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/Package.swift b/Package.swift index 2edc31621..bd0a8d996 100644 --- a/Package.swift +++ b/Package.swift @@ -16,7 +16,7 @@ if useLocalFramework { ) } else { let releaseTag = "0.1.0" - let releaseChecksum = "dc2a4a457cf320682e61116ded238c00511d20d179aec6fc2d710c22f4b07a49" + let releaseChecksum = "90718602caa3f9cf7d1fd78b9e2d02c28f350731df421ba0ea701ed659c46967" binaryTarget = .binaryTarget( name: sargonBinaryTargetName, url: diff --git a/scripts/ios/build-sargon.sh b/scripts/ios/build-sargon.sh index eb981077f..29423e022 100755 --- a/scripts/ios/build-sargon.sh +++ b/scripts/ios/build-sargon.sh @@ -51,7 +51,8 @@ build_xcframework() { # Builds an XCFramework echo "📦 Generating XCFramework" rm -rf target/ios # Delete the output folder so we can regenerate it - OUTDIR="target/ios/lib$1-rs.xcframework" + XCFRAME_PATH="target/ios/lib$1-rs.xcframework" + XCFRAME_ZIP_PATH=$XCFRAME_PATH.zip" xcodebuild -create-xcframework \ -library target/aarch64-apple-ios/release/lib$1.a -headers target/uniffi-xcframework-staging \ -library target/ios-simulator-fat/release/lib$1.a -headers target/uniffi-xcframework-staging \ @@ -59,15 +60,15 @@ build_xcframework() { if $release; then echo "📦 ('release' is true) Building xcframework archive" - zip -r target/ios/lib$1-rs.xcframework.zip target/ios/lib$1-rs.xcframework - checksum=$(swift package compute-checksum target/ios/lib$1-rs.xcframework.zip) + zip -r $XCFRAME_ZIP_PATH $XCFRAME_PATH + checksum=$(swift package compute-checksum $XCFRAME_ZIP_PATH) version=$(cargo metadata --format-version 1 | jq -r '.packages[] | select(.name=="sargon") .version') sed -i "" -E "s/(let releaseTag = \")[^\"]+(\")/\1$version\2/g" Package.swift sed -i "" -E "s/(let releaseChecksum = \")[^\"]+(\")/\1$checksum\2/g" Package.swift else echo "📦 'release' is false" fi - echo "$OUTDIR" + echo "$XCFRAME_ZIP_PATH" }