|
10 | 10 |
|
11 | 11 | function build_framework_artifacts() { |
12 | 12 | # Build old school "fat" frameworks for iOS and tvOS, both regular and no location builds |
13 | | - ./Scripts/carthage.sh build --no-skip-current |
14 | | - |
15 | | - # Zip the Carthage frameworks (includes both platforms in each zip file) |
16 | | - carthage archive mParticle_Apple_SDK |
17 | | - carthage archive mParticle_Apple_SDK_NoLocation |
| 13 | + if ./Scripts/carthage.sh build --no-skip-current; then |
| 14 | + echo "Successfully built Carthage frameworks" |
| 15 | + |
| 16 | + # Zip the Carthage frameworks (includes both platforms in each zip file) |
| 17 | + if carthage archive mParticle_Apple_SDK && carthage archive mParticle_Apple_SDK_NoLocation; then |
| 18 | + echo "Successfully archived Carthage frameworks" |
| 19 | + else |
| 20 | + echo "Warning: Failed to archive some Carthage frameworks" |
| 21 | + fi |
| 22 | + else |
| 23 | + echo "Warning: Carthage build failed, skipping framework artifacts" |
| 24 | + fi |
18 | 25 |
|
19 | 26 | # Clean up temp files |
20 | 27 | rm -rf Carthage |
21 | 28 | } |
22 | 29 |
|
23 | 30 | function build_xcframework_artifacts() { |
24 | 31 | # Build modern xcframeworks which work on M1 macs and include both platforms in one package |
25 | | - ./Scripts/xcframework.sh mParticle-Apple-SDK mParticle_Apple_SDK |
26 | | - ./Scripts/xcframework.sh mParticle-Apple-SDK-NoLocation mParticle_Apple_SDK_NoLocation |
| 32 | + if ./Scripts/xcframework.sh mParticle-Apple-SDK mParticle_Apple_SDK && ./Scripts/xcframework.sh mParticle-Apple-SDK-NoLocation mParticle_Apple_SDK_NoLocation; then |
| 33 | + echo "Successfully built xcframeworks" |
| 34 | + |
| 35 | + # Try to sign the xcframeworks, but don't fail if signing isn't available |
| 36 | + if codesign --timestamp -s "Apple Distribution: mParticle, inc (DLD43Y3TRP)" mParticle_Apple_SDK.xcframework 2>/dev/null; then |
| 37 | + echo "Successfully signed mParticle_Apple_SDK.xcframework" |
| 38 | + else |
| 39 | + echo "Warning: Could not sign mParticle_Apple_SDK.xcframework (certificate may not be available)" |
| 40 | + fi |
| 41 | + |
| 42 | + if codesign --timestamp -s "Apple Distribution: mParticle, inc (DLD43Y3TRP)" mParticle_Apple_SDK_NoLocation.xcframework 2>/dev/null; then |
| 43 | + echo "Successfully signed mParticle_Apple_SDK_NoLocation.xcframework" |
| 44 | + else |
| 45 | + echo "Warning: Could not sign mParticle_Apple_SDK_NoLocation.xcframework (certificate may not be available)" |
| 46 | + fi |
27 | 47 |
|
28 | | - # Sign the xcframeworks |
29 | | - codesign --timestamp -s "Apple Distribution: mParticle, inc (DLD43Y3TRP)" mParticle_Apple_SDK.xcframework |
30 | | - codesign --timestamp -s "Apple Distribution: mParticle, inc (DLD43Y3TRP)" mParticle_Apple_SDK_NoLocation.xcframework |
31 | | - |
32 | | - # Zip the xcframeworks |
33 | | - zip -r mParticle_Apple_SDK.xcframework.zip mParticle_Apple_SDK.xcframework |
34 | | - zip -r mParticle_Apple_SDK_NoLocation.xcframework.zip mParticle_Apple_SDK_NoLocation.xcframework |
| 48 | + # Zip the xcframeworks |
| 49 | + if zip -r mParticle_Apple_SDK.xcframework.zip mParticle_Apple_SDK.xcframework && zip -r mParticle_Apple_SDK_NoLocation.xcframework.zip mParticle_Apple_SDK_NoLocation.xcframework; then |
| 50 | + echo "Successfully created xcframework zip files" |
| 51 | + else |
| 52 | + echo "Warning: Failed to create some xcframework zip files" |
| 53 | + fi |
| 54 | + else |
| 55 | + echo "Warning: Failed to build xcframeworks, skipping xcframework artifacts" |
| 56 | + fi |
35 | 57 |
|
36 | 58 | # Clean up temp files |
37 | 59 | rm -rf archives mParticle_Apple_SDK.xcframework mParticle_Apple_SDK_NoLocation.xcframework |
@@ -62,6 +84,13 @@ function build_docs_artifact() { |
62 | 84 |
|
63 | 85 | # --- Main --- |
64 | 86 |
|
| 87 | +echo "Starting artifact build process..." |
| 88 | + |
65 | 89 | build_framework_artifacts |
66 | | -build_xcframework_artifacts |
| 90 | +build_xcframework_artifacts |
67 | 91 | build_docs_artifact |
| 92 | + |
| 93 | +echo "Artifact build process completed." |
| 94 | + |
| 95 | +# Ensure the script always exits successfully for the release process |
| 96 | +exit 0 |
0 commit comments