Skip to content

Commit c30e401

Browse files
authored
feat: Make Sentry-WithoutUIKitOrAppKit available with SPM (#6160)
* feat: Add Sentry libraries without UIKit/AppKit to SPM * Update changelog * Remove `Sentry-WithoutUIKitOrAppKit-WithARM64e` on PRs * Update verification scripts
1 parent 5ae9ff1 commit c30e401

File tree

6 files changed

+65
-0
lines changed

6 files changed

+65
-0
lines changed

.github/actions/prepare-package.swift/action.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ runs:
2525
PACKAGE_FILE: ${{ inputs.package-file }}
2626
run: |
2727
sed -i '' '/Sentry-Dynamic-WithARM64e/d' $PACKAGE_FILE
28+
sed -i '' '/Sentry-WithoutUIKitOrAppKit-WithARM64e/d' $PACKAGE_FILE
2829
sed -i '' '/^[[:space:]]*\.binaryTarget($/{N;/\n[[:space:]]*),$/d;}' $PACKAGE_FILE
2930
- name: Change path of the framework
3031
shell: bash
@@ -35,3 +36,5 @@ runs:
3536
sed -i '' 's/checksum: ".*" \/\/Sentry-Static/path: "Sentry.xcframework.zip"/g' $PACKAGE_FILE
3637
sed -i '' 's/checksum: ".*" \/\/Sentry-Dynamic-WithARM64e/path: "Sentry-Dynamic-WithARM64e.xcframework.zip"/g' $PACKAGE_FILE
3738
sed -i '' 's/checksum: ".*" \/\/Sentry-Dynamic/path: "Sentry-Dynamic.xcframework.zip"/g' $PACKAGE_FILE
39+
sed -i '' 's/checksum: ".*" \/\/Sentry-WithoutUIKitOrAppKit-WithARM64e/path: "Sentry-WithoutUIKitOrAppKit-WithARM64e.xcframework.zip"/g' $PACKAGE_FILE
40+
sed -i '' 's/checksum: ".*" \/\/Sentry-WithoutUIKitOrAppKit/path: "Sentry-WithoutUIKitOrAppKit.xcframework.zip"/g' $PACKAGE_FILE

.github/workflows/version-bump-util.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,8 @@ jobs:
8282
echo "<FAKE STATIC ZIP>" > Carthage/Sentry.xcframework.zip
8383
echo "<FAKE DYNAMIC ZIP>" > Carthage/Sentry-Dynamic.xcframework.zip
8484
echo "<FAKE DYNAMIC WITH ARM64E ZIP>" > Carthage/Sentry-Dynamic-WithARM64e.xcframework.zip
85+
echo "<FAKE WITHOUT UIKIT OR APPKIT ZIP>" > Carthage/Sentry-WithoutUIKitOrAppKit.xcframework.zip
86+
echo "<FAKE WITHOUT UIKIT OR APPKIT WITH ARM64E ZIP>" > Carthage/Sentry-WithoutUIKitOrAppKit-WithARM64e.xcframework.zip
8587
8688
- name: Bump version
8789
run: ./scripts/bump.sh ${{ steps.generate-version-number.outputs.OLD_VERSION }} ${{ steps.generate-version-number.outputs.NEW_VERSION }}
@@ -95,6 +97,8 @@ jobs:
9597
--static-checksum "7062a80f8a80f8b6d812698af87384751567a6aaa0df6f03b0596d728b22dcfd" \
9698
--dynamic-checksum "f6325cd8f05523d60222451fa61b3cd3d58148e5a21236f82abfd3f92750c87c" \
9799
--dynamic-with-arm64e-checksum "bbb84b054e5792aa705b95541aa4585f793e566a6b95638f8fef8e308d9782c3" \
100+
--without-uikit-or-appkit-checksum "c647afe93889063325b5dfcabf43101749f6a8f37008cca858833ed280d2a84e" \
101+
--without-uikit-or-appkit-with-arm64e-checksum "af5af7edc8e107fe04b905bd23524fdc93914fce8e1bd72ccf281408efff9a47" \
98102
--last-release-runid "${{ github.run_id }}"
99103
100104
# This check validates that either version-bump-util passed or was skipped, which allows us

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Changelog
22

3+
## Unreleased
4+
5+
### Improvements
6+
7+
- Sentry without UIKit / AppKit is available to install with SPM (#6160)
8+
39
## 8.56.0-alpha.3
410

511
### Fixes

Package.swift

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ var products: [Product] = [
1313
.library(name: "Sentry", targets: ["Sentry", "SentryCppHelper"]),
1414
.library(name: "Sentry-Dynamic", targets: ["Sentry-Dynamic"]),
1515
.library(name: "Sentry-Dynamic-WithARM64e", targets: ["Sentry-Dynamic-WithARM64e"]),
16+
.library(name: "Sentry-WithoutUIKitOrAppKit", targets: ["Sentry-WithoutUIKitOrAppKit", "SentryCppHelper"]),
17+
.library(name: "Sentry-WithoutUIKitOrAppKit-WithARM64e", targets: ["Sentry-WithoutUIKitOrAppKit-WithARM64e", "SentryCppHelper"]),
1618
.library(name: "SentrySwiftUI", targets: ["Sentry", "SentrySwiftUI", "SentryCppHelper"])
1719
]
1820

@@ -32,6 +34,16 @@ var targets: [Target] = [
3234
url: "https://github.com/getsentry/sentry-cocoa/releases/download/8.56.0-alpha.3/Sentry-Dynamic-WithARM64e.xcframework.zip",
3335
checksum: "5a7eb7c6e6d49bb90e252d946f3e03477597d40604a860bbec74ee5aaf2d4272" //Sentry-Dynamic-WithARM64e
3436
),
37+
.binaryTarget(
38+
name: "Sentry-WithoutUIKitOrAppKit",
39+
url: "https://github.com/getsentry/sentry-cocoa/releases/download/8.56.0-alpha.3/Sentry-WithoutUIKitOrAppKit.xcframework.zip",
40+
checksum: "3be39a3bdbbb25820265b00711b81b3c307ff0db17ff7d797b5d54aeec8a8618" //Sentry-WithoutUIKitOrAppKit
41+
),
42+
.binaryTarget(
43+
name: "Sentry-WithoutUIKitOrAppKit-WithARM64e",
44+
url: "https://github.com/getsentry/sentry-cocoa/releases/download/8.56.0-alpha.3/Sentry-WithoutUIKitOrAppKit-WithARM64e.xcframework.zip",
45+
checksum: "699f6d265b0acebf25cc694979eaee527bb413aa754e572b7b297d6a96f5a3df" //Sentry-WithoutUIKitOrAppKit-WithARM64e
46+
),
3547
.target (
3648
name: "SentrySwiftUI",
3749
dependencies: ["Sentry", "SentryInternal"],

scripts/update-package-sha.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ fi
1616
NEW_CHECKSUM_STATIC=$(shasum -a 256 Carthage/Sentry.xcframework.zip | awk '{print $1}')
1717
NEW_CHECKSUM_DYNAMIC=$(shasum -a 256 Carthage/Sentry-Dynamic.xcframework.zip | awk '{print $1}')
1818
NEW_CHECKSUM_DYNAMIC_WITH_ARM64E=$(shasum -a 256 Carthage/Sentry-Dynamic-WithARM64e.xcframework.zip | awk '{print $1}')
19+
NEW_CHECKSUM_WITHOUT_UIKIT_OR_APPKIT=$(shasum -a 256 Carthage/Sentry-WithoutUIKitOrAppKit.xcframework.zip | awk '{print $1}')
20+
NEW_CHECKSUM_WITHOUT_UIKIT_OR_APPKIT_WITH_ARM64E=$(shasum -a 256 Carthage/Sentry-WithoutUIKitOrAppKit-WithARM64e.xcframework.zip | awk '{print $1}')
1921

2022
os=$(uname)
2123

@@ -26,10 +28,14 @@ for package_file in $PACKAGE_FILES; do
2628
sed -i "s/checksum: \".*\" \/\/Sentry-Static/checksum: \"$NEW_CHECKSUM_STATIC\" \/\/Sentry-Static/" "$package_file"
2729
sed -i "s/checksum: \".*\" \/\/Sentry-Dynamic/checksum: \"$NEW_CHECKSUM_DYNAMIC\" \/\/Sentry-Dynamic/" "$package_file"
2830
sed -i "s/checksum: \".*\" \/\/Sentry-Dynamic-WithARM64e/checksum: \"$NEW_CHECKSUM_DYNAMIC_WITH_ARM64E\" \/\/Sentry-Dynamic-WithARM64e/" "$package_file"
31+
sed -i "s/checksum: \".*\" \/\/Sentry-WithoutUIKitOrAppKit/checksum: \"$NEW_CHECKSUM_WITHOUT_UIKIT_OR_APPKIT\" \/\/Sentry-WithoutUIKitOrAppKit/" "$package_file"
32+
sed -i "s/checksum: \".*\" \/\/Sentry-WithoutUIKitOrAppKit-WithARM64e/checksum: \"$NEW_CHECKSUM_WITHOUT_UIKIT_OR_APPKIT_WITH_ARM64E\" \/\/Sentry-WithoutUIKitOrAppKit-WithARM64e/" "$package_file"
2933
else
3034
sed -i "" "s/checksum: \".*\" \/\/Sentry-Static/checksum: \"$NEW_CHECKSUM_STATIC\" \/\/Sentry-Static/" "$package_file"
3135
sed -i "" "s/checksum: \".*\" \/\/Sentry-Dynamic/checksum: \"$NEW_CHECKSUM_DYNAMIC\" \/\/Sentry-Dynamic/" "$package_file"
3236
sed -i "" "s/checksum: \".*\" \/\/Sentry-Dynamic-WithARM64e/checksum: \"$NEW_CHECKSUM_DYNAMIC_WITH_ARM64E\" \/\/Sentry-Dynamic-WithARM64e/" "$package_file"
37+
sed -i "" "s/checksum: \".*\" \/\/Sentry-WithoutUIKitOrAppKit/checksum: \"$NEW_CHECKSUM_WITHOUT_UIKIT_OR_APPKIT\" \/\/Sentry-WithoutUIKitOrAppKit/" "$package_file"
38+
sed -i "" "s/checksum: \".*\" \/\/Sentry-WithoutUIKitOrAppKit-WithARM64e/checksum: \"$NEW_CHECKSUM_WITHOUT_UIKIT_OR_APPKIT_WITH_ARM64E\" \/\/Sentry-WithoutUIKitOrAppKit-WithARM64e/" "$package_file"
3339
fi
3440
done
3541

scripts/verify-package-sha.sh

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ set -euo pipefail
99
EXPECTED_STATIC_CHECKSUM=""
1010
EXPECTED_DYNAMIC_CHECKSUM=""
1111
EXPECTED_DYNAMIC_WITH_ARM64E_CHECKSUM=""
12+
EXPECTED_WITHOUT_UIKIT_OR_APPKIT_CHECKSUM=""
13+
EXPECTED_WITHOUT_UIKIT_OR_APPKIT_WITH_ARM64E_CHECKSUM=""
1214
EXPECTED_LAST_RELEASE_RUNID=""
1315

1416
while [[ $# -gt 0 ]]; do
@@ -25,6 +27,14 @@ while [[ $# -gt 0 ]]; do
2527
EXPECTED_DYNAMIC_WITH_ARM64E_CHECKSUM="$2"
2628
shift 2
2729
;;
30+
--without-uikit-or-appkit-checksum)
31+
EXPECTED_WITHOUT_UIKIT_OR_APPKIT_CHECKSUM="$2"
32+
shift 2
33+
;;
34+
--without-uikit-or-appkit-with-arm64e-checksum)
35+
EXPECTED_WITHOUT_UIKIT_OR_APPKIT_WITH_ARM64E_CHECKSUM="$2"
36+
shift 2
37+
;;
2838
--last-release-runid)
2939
EXPECTED_LAST_RELEASE_RUNID="$2"
3040
shift 2
@@ -52,6 +62,16 @@ if [ -z "$EXPECTED_DYNAMIC_WITH_ARM64E_CHECKSUM" ]; then
5262
exit 1
5363
fi
5464

65+
if [ -z "$EXPECTED_WITHOUT_UIKIT_OR_APPKIT_CHECKSUM" ]; then
66+
echo "Error: --without-uikit-or-appkit-checksum is required"
67+
exit 1
68+
fi
69+
70+
if [ -z "$EXPECTED_WITHOUT_UIKIT_OR_APPKIT_WITH_ARM64E_CHECKSUM" ]; then
71+
echo "Error: --without-uikit-or-appkit-with-arm64e-checksum is required"
72+
exit 1
73+
fi
74+
5575
if [ -z "$EXPECTED_LAST_RELEASE_RUNID" ]; then
5676
echo "Error: --last-release-runid is required"
5777
exit 1
@@ -89,6 +109,20 @@ for package_file in $PACKAGE_FILES; do
89109
echo "::error::Expected checksum to be $EXPECTED_DYNAMIC_WITH_ARM64E_CHECKSUM but got $UPDATED_PACKAGE_SHA in $package_file"
90110
exit 1
91111
fi
112+
113+
# Verify without uikit or appkit checksum
114+
UPDATED_PACKAGE_SHA=$(grep "checksum.*Sentry-WithoutUIKitOrAppKit" "$package_file" | cut -d '"' -f 2 | head -n 1)
115+
if [ "$UPDATED_PACKAGE_SHA" != "$EXPECTED_WITHOUT_UIKIT_OR_APPKIT_CHECKSUM" ]; then
116+
echo "::error::Expected checksum to be $EXPECTED_WITHOUT_UIKIT_OR_APPKIT_CHECKSUM but got $UPDATED_PACKAGE_SHA in $package_file"
117+
exit 1
118+
fi
119+
120+
# Verify without uikit or appkit with arm64e checksum
121+
UPDATED_PACKAGE_SHA=$(grep "checksum.*Sentry-WithoutUIKitOrAppKit-WithARM64e" "$package_file" | cut -d '"' -f 2)
122+
if [ "$UPDATED_PACKAGE_SHA" != "$EXPECTED_WITHOUT_UIKIT_OR_APPKIT_WITH_ARM64E_CHECKSUM" ]; then
123+
echo "::error::Expected checksum to be $EXPECTED_WITHOUT_UIKIT_OR_APPKIT_WITH_ARM64E_CHECKSUM but got $UPDATED_PACKAGE_SHA in $package_file"
124+
exit 1
125+
fi
92126

93127
echo "✓ All checksums verified in $package_file"
94128
done

0 commit comments

Comments
 (0)