@@ -135,7 +135,7 @@ jobs:
135135 codesign --sign "${{ secrets.APPLE_TEAM_ID }}" --timestamp --options runtime dist/js.xcframework # Then sign the xcframework wrapper
136136 ditto -c -k --keepParent dist/js.xcframework dist/js.xcframework.zip
137137 xcrun notarytool submit dist/js.xcframework.zip --apple-id "${{ secrets.APPLE_ID }}" --password "${{ secrets.APPLE_PASSWORD }}" --team-id "${{ secrets.APPLE_TEAM_ID }}" --wait
138- rm dist/js.xcframework.zip
138+ rm -rf dist/js.xcframework
139139
140140 - name : cleanup keychain for codesign
141141 if : matrix.os == 'macos-15'
@@ -220,7 +220,11 @@ jobs:
220220 if [[ "$name" != "js-apple-xcframework" && "$name" != "js-android-aar" ]]; then
221221 tar -czf "${name}-${VERSION}.tar.gz" -C "$folder" .
222222 fi
223- if [[ "$name" != "js-android-aar" ]]; then
223+ if [[ "$name" == "js-apple-xcframework" ]]; then
224+ # Use the ditto-created zip that preserves macOS symlinks and extract for other steps
225+ cp "$folder/js.xcframework.zip" "${name}-${VERSION}.zip"
226+ unzip -q "$folder/js.xcframework.zip" -d "$folder/"
227+ elif [[ "$name" != "js-android-aar" ]]; then
224228 (cd "$folder" && zip -rq "../../${name}-${VERSION}.zip" .)
225229 else
226230 cp "$folder"/*.aar "${name}-${VERSION}.aar"
@@ -315,6 +319,23 @@ jobs:
315319 echo " Platform packages: 7"
316320 echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
317321
322+ - name : update Package.swift checksum and version
323+ if : steps.tag.outputs.version != ''
324+ run : |
325+ VERSION=${{ steps.tag.outputs.version }}
326+ ZIP="js-apple-xcframework-${VERSION}.zip"
327+ if [ -f "$ZIP" ]; then
328+ CHECKSUM=$(swift package compute-checksum "$ZIP")
329+ URL="https://github.com/sqliteai/sqlite-js/releases/download/${VERSION}/${ZIP}"
330+ sed -i "s|url: \".*apple-xcframework.*\"|url: \"${URL}\"|" Package.swift
331+ sed -i "s|checksum: \".*\"|checksum: \"${CHECKSUM}\"|" Package.swift
332+ git config --global user.email "$GITHUB_ACTOR@users.noreply.github.com"
333+ git config --global user.name "$GITHUB_ACTOR"
334+ git add Package.swift
335+ git commit -m "Update Package.swift checksum for ${VERSION} [skip ci]" || true
336+ git push origin main || true
337+ fi
338+
318339 - uses : softprops/action-gh-release@v2.2.1
319340 if : steps.tag.outputs.version != ''
320341 with :
0 commit comments