Skip to content

Commit 6220a68

Browse files
authored
ci: build and sign xcframework (#5271)
* ci: build and sign xcframework * Setup ruby * Use fastlane lane * Ignore bump version * Upload permissions for sign_and_zip.sh * Add comments to `sign_and_zip.sh` * Add comment to the test workflow * Use same script for zipping xcframeworks and optionally sign them * Update make comand name * Cleanup bash script * Use `build-signed-xcframework` in framework release * Add fastlane step to release workflow * Remove temporary test workflow * Add comment to explain why using ditto * Rename `prepare_sign_xcframework` to `prepare_signed_xcframework` * Update changelog
1 parent 1a3ac75 commit 6220a68

File tree

5 files changed

+65
-6
lines changed

5 files changed

+65
-6
lines changed

.github/workflows/release.yml

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,30 @@ jobs:
2121
steps:
2222
- uses: actions/checkout@v4
2323

24+
- uses: ruby/setup-ruby@v1
25+
with:
26+
bundler-cache: true
27+
28+
- name: "Download Fastlane Certificate"
29+
run: bundle exec fastlane prepare_signed_xcframework
30+
env:
31+
APP_STORE_CONNECT_KEY_ID: ${{ secrets.APP_STORE_CONNECT_KEY_ID }}
32+
APP_STORE_CONNECT_ISSUER_ID: ${{ secrets.APP_STORE_CONNECT_ISSUER_ID }}
33+
APP_STORE_CONNECT_KEY: ${{ secrets.APP_STORE_CONNECT_KEY }}
34+
FASTLANE_KEYCHAIN_PASSWORD: ${{ secrets.FASTLANE_KEYCHAIN_PASSWORD }}
35+
MATCH_GIT_PRIVATE_KEY: ${{ secrets.MATCH_GIT_PRIVATE_KEY }}
36+
MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }}
37+
MATCH_USERNAME: ${{ secrets.MATCH_USERNAME }}
38+
shell: sh
39+
2440
- name: "Generate XCFramework"
2541
run: |
2642
./scripts/ci-select-xcode.sh 15.2
2743
make bump-version TO=${{ github.event.inputs.version }}
2844
# We need to build the framework during release to get it's SHA value
2945
# the framework will be saved as an artefact and we will use the same
3046
# binary for the entire release process to avoid the SHA to change
31-
make build-xcframework
47+
make build-signed-xcframework
3248
3349
- uses: actions/upload-artifact@v4
3450
with:

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+
### Features
6+
7+
- XCFrameworks are now signed (#5271)
8+
39
## 8.51.1
410

511
### Fixes

Makefile

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -104,11 +104,12 @@ analyze:
104104
build-xcframework:
105105
@echo "--> Carthage: creating Sentry xcframework"
106106
./scripts/build-xcframework.sh | tee build-xcframework.log
107-
# use ditto here to avoid clobbering symlinks which exist in macOS frameworks
108-
ditto -c -k -X --rsrc --keepParent Carthage/Sentry.xcframework Carthage/Sentry.xcframework.zip
109-
ditto -c -k -X --rsrc --keepParent Carthage/Sentry-Dynamic.xcframework Carthage/Sentry-Dynamic.xcframework.zip
110-
ditto -c -k -X --rsrc --keepParent Carthage/SentrySwiftUI.xcframework Carthage/SentrySwiftUI.xcframework.zip
111-
ditto -c -k -X --rsrc --keepParent Carthage/Sentry-WithoutUIKitOrAppKit.xcframework Carthage/Sentry-WithoutUIKitOrAppKit.zip
107+
./scripts/zip_built_sdks.sh
108+
109+
build-signed-xcframework:
110+
@echo "--> Carthage: creating Signed Sentry xcframework"
111+
./scripts/build-xcframework.sh | tee build-xcframework.log
112+
./scripts/zip_built_sdks.sh --sign
112113

113114
build-xcframework-sample:
114115
./scripts/create-carthage-json.sh

fastlane/Fastfile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,16 @@ platform :ios do
99
ios_swift_clip_infoplist_path = "./Samples/iOS-Swift/iOS-SwiftClip/Info.plist"
1010
configuration = if is_ci then 'TestCI' else 'Test' end
1111

12+
lane :prepare_signed_xcframework do
13+
setup_ci
14+
15+
match(
16+
type: "appstore",
17+
readonly: true,
18+
app_identifier: ["io.sentry.sample.iOS-Swift"], # Any app identifier will do
19+
)
20+
end
21+
1222
lane :bump_build_number do
1323
increment_build_number(
1424
build_number: ENV["FASTLANE_BUILD_NUMBER"],

scripts/zip_built_sdks.sh

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/bin/bash
2+
3+
set -eou pipefail
4+
5+
args="${1:-}"
6+
7+
frameworks=( Sentry Sentry-Dynamic SentrySwiftUI Sentry-WithoutUIKitOrAppKit )
8+
9+
should_sign=false
10+
[[ "$args" == "--sign" ]] && should_sign=true
11+
12+
sentry_certificate="Apple Distribution: GetSentry LLC (97JCY7859U)"
13+
14+
for framework in "${frameworks[@]}"; do
15+
framework_path="Carthage/$framework.xcframework"
16+
17+
if [[ "$should_sign" == true ]]; then
18+
echo "Signing $framework"
19+
# This is Sentry's certificate name, and should not change
20+
codesign --sign "$sentry_certificate" --timestamp --options runtime --deep --force "$framework_path"
21+
fi
22+
23+
echo "Zipping $framework"
24+
# use ditto here to avoid clobbering symlinks which exist in macOS frameworks
25+
ditto -c -k -X --rsrc --keepParent "$framework_path" "$framework_path.zip"
26+
done

0 commit comments

Comments
 (0)