Skip to content

Commit 45fb9f0

Browse files
authored
sign and notarize Apple extensions (#16)
* feat(xcframework): add signing and notarization step for CloudSync.xcframework * fix(workflow): update sign and notarize step for xcframework * fix(workflow): enhance signing and notarization process for CloudSync.xcframework * fix(workflow):remove useless notarization step * refactor(xcframework): remove unused cloudsync_autoinit, modulemap and cloudsync header file * fix(workflow): update codesigning steps for apple platforms * fix(workflow): create CloudSync.framework directory during xcframework build * fix(workflow): add notarization step for CloudSync.xcframework * fix(workflow): enhance codesigning and notarization steps for macOS builds * fix(workflow): update macOS codesigning to use zip for notarization * fix(workflow): update stapling process for xcframework to handle multiple frameworks * fix(workflow): remove stapling steps for cloudsync.dylib and CloudSync.xcframework * fix(workflow): rename codesigning steps for clarity and include notarization * fix(workflow): update codesigning step for dylib and remove notarization process * bump version
1 parent 654d8fb commit 45fb9f0

File tree

3 files changed

+30
-6
lines changed

3 files changed

+30
-6
lines changed

.github/workflows/main.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,35 @@ jobs:
116116
- name: build sqlite-sync
117117
run: ${{ matrix.name == 'linux-musl' && matrix.arch == 'arm64' && 'docker exec alpine' || '' }} make extension ${{ matrix.make && matrix.make || ''}}
118118

119+
- name: create keychain for codesign
120+
if: matrix.os == 'macos-15'
121+
run: |
122+
echo "${{ secrets.APPLE_CERTIFICATE }}" | base64 --decode > certificate.p12
123+
security create-keychain -p "${{ secrets.KEYCHAIN_PASSWORD }}" build.keychain
124+
security default-keychain -s build.keychain
125+
security unlock-keychain -p "${{ secrets.KEYCHAIN_PASSWORD }}" build.keychain
126+
security import certificate.p12 -k build.keychain -P "${{ secrets.CERTIFICATE_PASSWORD }}" -T /usr/bin/codesign
127+
security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k "${{ secrets.KEYCHAIN_PASSWORD }}" build.keychain
128+
129+
- name: codesign dylib
130+
if: matrix.os == 'macos-15' && matrix.name != 'apple-xcframework'
131+
run: codesign --sign "${{ secrets.APPLE_TEAM_ID }}" --timestamp --options runtime dist/cloudsync.dylib
132+
133+
- name: codesign and notarize xcframework
134+
if: matrix.name == 'apple-xcframework'
135+
run: |
136+
find dist/CloudSync.xcframework -name "*.framework" -exec echo "Signing: {}" \; -exec codesign --sign "${{ secrets.APPLE_TEAM_ID }}" --timestamp --options runtime {} \; # Sign each individual framework FIRST
137+
codesign --sign "${{ secrets.APPLE_TEAM_ID }}" --timestamp --options runtime dist/CloudSync.xcframework # Then sign the xcframework wrapper
138+
ditto -c -k --keepParent dist/CloudSync.xcframework dist/CloudSync.xcframework.zip
139+
xcrun notarytool submit dist/CloudSync.xcframework.zip --apple-id "${{ secrets.APPLE_ID }}" --password "${{ secrets.APPLE_PASSWORD }}" --team-id "${{ secrets.APPLE_TEAM_ID }}" --wait
140+
rm dist/CloudSync.xcframework.zip
141+
142+
- name: cleanup keychain for codesign
143+
if: matrix.os == 'macos-15'
144+
run: |
145+
rm certificate.p12
146+
security delete-keychain build.keychain
147+
119148
- name: android setup test environment
120149
if: matrix.name == 'android' && matrix.arch != 'arm64-v8a'
121150
run: |

src/cloudsync.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3245,10 +3245,6 @@ void cloudsync_commit_alter (sqlite3_context *context, int argc, sqlite3_value *
32453245

32463246
// MARK: - Main Entrypoint -
32473247

3248-
int cloudsync_autoinit (void) {
3249-
return sqlite3_auto_extension((void *)sqlite3_cloudsync_init);
3250-
}
3251-
32523248
int cloudsync_register (sqlite3 *db, char **pzErrMsg) {
32533249
int rc = SQLITE_OK;
32543250

src/cloudsync.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,9 @@
2020
extern "C" {
2121
#endif
2222

23-
#define CLOUDSYNC_VERSION "0.8.26"
23+
#define CLOUDSYNC_VERSION "0.8.27"
2424

2525
int sqlite3_cloudsync_init (sqlite3 *db, char **pzErrMsg, const sqlite3_api_routines *pApi);
26-
int cloudsync_autoinit (void);
2726

2827
#ifdef __cplusplus
2928
}

0 commit comments

Comments
 (0)