|
31 | 31 | run: echo "VERSION=${GITHUB_REF_NAME#v}" >> "$GITHUB_OUTPUT" |
32 | 32 |
|
33 | 33 | - name: Build (Release) |
34 | | - run: swift build -c release |
| 34 | + run: | |
| 35 | + # First build to generate SPM resource bundle accessor |
| 36 | + swift build -c release |
| 37 | +
|
| 38 | + # Patch Bundle.module to use resourceURL (Contents/Resources/) instead of |
| 39 | + # bundleURL (.app/ root) which codesign rejects as "unsealed contents" |
| 40 | + find .build -name "resource_bundle_accessor.swift" -path "*/release/*" \ |
| 41 | + -exec sed -i '' 's/Bundle\.main\.bundleURL/Bundle.main.resourceURL!/' {} \; |
| 42 | +
|
| 43 | + # Rebuild with patched accessor |
| 44 | + swift build -c release |
35 | 45 |
|
36 | 46 | # --- Code Signing --- |
37 | 47 | - name: Import signing certificate |
@@ -67,15 +77,10 @@ jobs: |
67 | 77 |
|
68 | 78 | cp .build/release/${{ env.APP_NAME }} "$APP_DIR/MacOS/" |
69 | 79 |
|
70 | | - # Copy SPM resource bundles (e.g. KeyboardShortcuts) |
71 | | - # Bundle.module looks at Bundle.main.bundleURL (= .app/) first, |
72 | | - # so place bundles at the .app root — the path SPM actually checks. |
73 | | - APP_ROOT="${{ runner.temp }}/${{ env.APP_NAME }}.app" |
74 | | - find .build -name "*.bundle" -path "*/release/*" -exec cp -R {} "$APP_ROOT/" \; |
75 | | -
|
76 | | - # Verify bundles were copied |
77 | | - echo "=== .app root ===" |
78 | | - ls -la "$APP_ROOT/" || true |
| 80 | + # Copy SPM resource bundles into Contents/Resources/ |
| 81 | + find .build -name "*.bundle" -path "*/release/*" -exec cp -R {} "$APP_DIR/Resources/" \; |
| 82 | + echo "=== Resources ===" |
| 83 | + ls -la "$APP_DIR/Resources/" || true |
79 | 84 |
|
80 | 85 | cp ${{ env.APP_NAME }}/Info.plist "$APP_DIR/" |
81 | 86 | /usr/libexec/PlistBuddy -c "Set :CFBundleShortVersionString ${{ steps.version.outputs.VERSION }}" "$APP_DIR/Info.plist" |
|
0 commit comments