Skip to content

Commit 38ce90e

Browse files
nan-liclaude
andcommitted
fix: sign release XCFrameworks with OneSignal identity, archive unsigned
Archive with CODE_SIGNING_ALLOWED=NO so the build needs no certificate (fixes the team 99SW8E36CT archive failure), then sign inner + outer slices with the OneSignal Apple Distribution identity. The framework list lives in a single XCFRAMEWORKS job env var. Drop the unused Lilomi dev-cert import. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 8e95157 commit 38ce90e

2 files changed

Lines changed: 38 additions & 22 deletions

File tree

.github/workflows/create-release-prs.yml

Lines changed: 29 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,20 @@ jobs:
4444
BASE_BRANCH: ${{ github.event.inputs.base_branch }}
4545
RELEASE_BRANCH: ${{ needs.prep.outputs.release_branch }}
4646
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
47+
# Single source of truth for the XCFrameworks the Code Sign and Verify steps
48+
# operate on (paths relative to iOS_SDK/OneSignalSDK). Keep in sync with the
49+
# frameworks built by build_all_frameworks.sh.
50+
XCFRAMEWORKS: >-
51+
OneSignal_Core/OneSignalCore.xcframework
52+
OneSignal_OSCore/OneSignalOSCore.xcframework
53+
OneSignal_Outcomes/OneSignalOutcomes.xcframework
54+
OneSignal_Extension/OneSignalExtension.xcframework
55+
OneSignal_Notifications/OneSignalNotifications.xcframework
56+
OneSignal_User/OneSignalUser.xcframework
57+
OneSignal_LiveActivities/OneSignalLiveActivities.xcframework
58+
OneSignal_Location/OneSignalLocation.xcframework
59+
OneSignal_InAppMessages/OneSignalInAppMessages.xcframework
60+
OneSignal_XCFramework/OneSignalFramework.xcframework
4761
4862
steps:
4963
- name: 📋 Display Configuration
@@ -75,21 +89,13 @@ jobs:
7589
with:
7690
xcode-version: "15.2"
7791

78-
- name: Install the Apple distribution certificate and provisioning profile (OneSignal)
92+
- name: Install the Apple distribution certificate (OneSignal)
7993
uses: apple-actions/import-codesign-certs@v2
8094
with:
8195
keychain-password: ${{ secrets.CERTIFICATES_P12_PASSWORD }}
8296
p12-file-base64: ${{ secrets.CERTIFICATES_P12 }}
8397
p12-password: ${{ secrets.CERTIFICATES_P12_PASSWORD }}
8498

85-
- name: Install the Apple distribution certificate and provisioning profile (Lilomi)
86-
uses: apple-actions/import-codesign-certs@v2
87-
with:
88-
create-keychain: false # do not create a new keychain for this value
89-
keychain-password: ${{ secrets.CERTIFICATES_P12_PASSWORD }}
90-
p12-file-base64: ${{ secrets.DEV_CERTIFICATES_P12 }}
91-
p12-password: ${{ secrets.DEV_CERTIFICATES_P12_PASSWORD }}
92-
9399
- name: Update Version in SDK and Podspec Files
94100
run: |
95101
cd iOS_SDK/OneSignalSDK
@@ -112,16 +118,20 @@ jobs:
112118
- name: Code Sign
113119
run: |
114120
cd iOS_SDK/OneSignalSDK
115-
codesign --timestamp -v --sign "Apple Distribution: OneSignal, Inc. (J3J28YJX9L)" OneSignal_Core/OneSignalCore.xcframework
116-
codesign --timestamp -v --sign "Apple Distribution: OneSignal, Inc. (J3J28YJX9L)" OneSignal_Extension/OneSignalExtension.xcframework
117-
codesign --timestamp -v --sign "Apple Distribution: OneSignal, Inc. (J3J28YJX9L)" OneSignal_InAppMessages/OneSignalInAppMessages.xcframework
118-
codesign --timestamp -v --sign "Apple Distribution: OneSignal, Inc. (J3J28YJX9L)" OneSignal_Location/OneSignalLocation.xcframework
119-
codesign --timestamp -v --sign "Apple Distribution: OneSignal, Inc. (J3J28YJX9L)" OneSignal_Notifications/OneSignalNotifications.xcframework
120-
codesign --timestamp -v --sign "Apple Distribution: OneSignal, Inc. (J3J28YJX9L)" OneSignal_OSCore/OneSignalOSCore.xcframework
121-
codesign --timestamp -v --sign "Apple Distribution: OneSignal, Inc. (J3J28YJX9L)" OneSignal_Outcomes/OneSignalOutcomes.xcframework
122-
codesign --timestamp -v --sign "Apple Distribution: OneSignal, Inc. (J3J28YJX9L)" OneSignal_User/OneSignalUser.xcframework
123-
codesign --timestamp -v --sign "Apple Distribution: OneSignal, Inc. (J3J28YJX9L)" OneSignal_XCFramework/OneSignalFramework.xcframework
124-
codesign --timestamp -v --sign "Apple Distribution: OneSignal, Inc. (J3J28YJX9L)" OneSignal_LiveActivities/OneSignalLiveActivities.xcframework
121+
set -e
122+
IDENTITY="Apple Distribution: OneSignal, Inc. (J3J28YJX9L)"
123+
for XCF in $XCFRAMEWORKS; do
124+
# Sign inside-out: each slice's .framework binary first, then the
125+
# .xcframework wrapper. -f replaces the linker's ad-hoc signature left
126+
# by the unsigned archive build, so both inner and outer end up signed
127+
# with the official OneSignal Apple Distribution identity.
128+
while IFS= read -r FW; do
129+
echo "Signing inner framework: $FW"
130+
codesign --timestamp -f -v --sign "$IDENTITY" "$FW"
131+
done < <(find "$XCF" -type d -name "*.framework")
132+
echo "Signing wrapper: $XCF"
133+
codesign --timestamp -f -v --sign "$IDENTITY" "$XCF"
134+
done
125135
shell: bash
126136

127137
- name: Commit Build and Push Changes

iOS_SDK/OneSignalSDK/build_all_frameworks.sh

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,17 @@ create_xcframework() {
2626

2727
xcodebuild -list
2828

29-
xcodebuild archive ONLY_ACTIVE_ARCH=NO -scheme ${BUILD_SCHEME} -destination="generic/platform=iOS Simulator" -archivePath "${SIMULATOR_ARCHIVE_PATH}" -sdk iphonesimulator SKIP_INSTALL=NO BUILD_LIBRARIES_FOR_DISTRIBUTION=YES
29+
# Note: code signing is disabled here. These are distribution XCFrameworks
30+
# that are signed afterward with the Apple Distribution cert in the workflow's
31+
# "Code Sign" step, so the archive itself does not need to be signed. This also
32+
# avoids depending on the project's baked-in DEVELOPMENT_TEAM / dev certificate.
33+
CODE_SIGN_FLAGS="CODE_SIGN_IDENTITY= CODE_SIGNING_REQUIRED=NO CODE_SIGNING_ALLOWED=NO"
3034

31-
xcodebuild archive -scheme ${BUILD_SCHEME} -destination="generic/platform=iOS" -archivePath "${IOS_DEVICE_ARCHIVE_PATH}" -sdk iphoneos SKIP_INSTALL=NO BUILD_LIBRARIES_FOR_DISTRIBUTION=YES
35+
xcodebuild archive ONLY_ACTIVE_ARCH=NO -scheme ${BUILD_SCHEME} -destination="generic/platform=iOS Simulator" -archivePath "${SIMULATOR_ARCHIVE_PATH}" -sdk iphonesimulator SKIP_INSTALL=NO BUILD_LIBRARIES_FOR_DISTRIBUTION=YES ${CODE_SIGN_FLAGS}
3236

33-
xcodebuild archive -scheme ${BUILD_SCHEME} -destination='generic/platform=macOS,variant=Mac Catalyst' -archivePath "${CATALYST_ARCHIVE_PATH}" SKIP_INSTALL=NO BUILD_LIBRARIES_FOR_DISTRIBUTION=YES
37+
xcodebuild archive -scheme ${BUILD_SCHEME} -destination="generic/platform=iOS" -archivePath "${IOS_DEVICE_ARCHIVE_PATH}" -sdk iphoneos SKIP_INSTALL=NO BUILD_LIBRARIES_FOR_DISTRIBUTION=YES ${CODE_SIGN_FLAGS}
38+
39+
xcodebuild archive -scheme ${BUILD_SCHEME} -destination='generic/platform=macOS,variant=Mac Catalyst' -archivePath "${CATALYST_ARCHIVE_PATH}" SKIP_INSTALL=NO BUILD_LIBRARIES_FOR_DISTRIBUTION=YES ${CODE_SIGN_FLAGS}
3440

3541
xcodebuild -create-xcframework -framework ${SIMULATOR_ARCHIVE_PATH}/Products/Library/Frameworks/${FRAMEWORK_NAME}.framework -debug-symbols ${SIMULATOR_ARCHIVE_PATH}/dSYMs/${FRAMEWORK_NAME}.framework.dSYM -framework ${IOS_DEVICE_ARCHIVE_PATH}/Products/Library/Frameworks/${FRAMEWORK_NAME}.framework -debug-symbols ${IOS_DEVICE_ARCHIVE_PATH}/dSYMs/${FRAMEWORK_NAME}.framework.dSYM -framework ${CATALYST_ARCHIVE_PATH}/Products/Library/Frameworks/${FRAMEWORK_NAME}.framework -debug-symbols ${CATALYST_ARCHIVE_PATH}/dSYMs/${FRAMEWORK_NAME}.framework.dSYM -output "${FRAMEWORK_PATH}"
3642
rm -rf "${SIMULATOR_ARCHIVE_PATH}"

0 commit comments

Comments
 (0)