Skip to content

Commit 4596eb8

Browse files
authored
Merge pull request #78 from K9i-0/fix/sparkle-notarization
fix: Sparkle.framework内のすべてのバイナリを適切に署名してnotarization失敗を修正
2 parents 2f9210c + 61a3e6f commit 4596eb8

File tree

3 files changed

+75
-15
lines changed

3 files changed

+75
-15
lines changed

.github/workflows/build-and-sign.yml

Lines changed: 64 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -188,28 +188,61 @@ jobs:
188188
echo "=== App bundle root after cleanup ==="
189189
ls -la "ClaudeCodeMonitor.app/"
190190
191-
# Sign Sparkle.framework first if it exists
191+
# Sign Sparkle.framework components if it exists
192192
if [ -d "ClaudeCodeMonitor.app/Contents/Frameworks/Sparkle.framework" ]; then
193-
echo "=== Signing Sparkle.framework ==="
194-
codesign --force --strict \
195-
--options runtime \
196-
--sign "$CERT_NAME" \
197-
--timestamp \
193+
echo "=== Signing Sparkle.framework components ==="
194+
195+
# Sign individual binaries first
196+
if [ -f "ClaudeCodeMonitor.app/Contents/Frameworks/Sparkle.framework/Versions/B/Autoupdate" ]; then
197+
echo " Signing Autoupdate binary..."
198+
codesign --force --options runtime --sign "$CERT_NAME" --timestamp \
199+
"ClaudeCodeMonitor.app/Contents/Frameworks/Sparkle.framework/Versions/B/Autoupdate"
200+
fi
201+
202+
if [ -f "ClaudeCodeMonitor.app/Contents/Frameworks/Sparkle.framework/Versions/B/Sparkle" ]; then
203+
echo " Signing Sparkle binary..."
204+
codesign --force --options runtime --sign "$CERT_NAME" --timestamp \
205+
"ClaudeCodeMonitor.app/Contents/Frameworks/Sparkle.framework/Versions/B/Sparkle"
206+
fi
207+
208+
# Sign Updater.app
209+
if [ -d "ClaudeCodeMonitor.app/Contents/Frameworks/Sparkle.framework/Versions/B/Updater.app" ]; then
210+
echo " Signing Updater.app..."
211+
codesign --force --deep --options runtime --sign "$CERT_NAME" --timestamp \
212+
"ClaudeCodeMonitor.app/Contents/Frameworks/Sparkle.framework/Versions/B/Updater.app"
213+
fi
214+
215+
# Sign XPCServices
216+
if [ -d "ClaudeCodeMonitor.app/Contents/Frameworks/Sparkle.framework/Versions/B/XPCServices" ]; then
217+
echo " Signing XPC Services..."
218+
find "ClaudeCodeMonitor.app/Contents/Frameworks/Sparkle.framework/Versions/B/XPCServices" \
219+
-name "*.xpc" -exec codesign --force --deep --options runtime --sign "$CERT_NAME" --timestamp {} \;
220+
fi
221+
222+
# Finally sign the framework itself
223+
echo " Signing Sparkle.framework..."
224+
codesign --force --options runtime --sign "$CERT_NAME" --timestamp \
198225
"ClaudeCodeMonitor.app/Contents/Frameworks/Sparkle.framework"
199226
fi
200227
201-
# Try signing (without --deep to preserve framework signatures)
202-
echo "=== Attempting to sign app ==="
203-
codesign --force --strict \
228+
# Sign the app with --deep to ensure all components are signed
229+
echo "=== Attempting to sign app with --deep ==="
230+
codesign --force --deep --strict \
204231
--options runtime \
205232
--entitlements ClaudeCodeMonitor.entitlements \
206233
--sign "$CERT_NAME" \
207234
--timestamp \
208235
"ClaudeCodeMonitor.app"
209236
210-
# Verify signature
211-
codesign --verify --deep --strict --verbose=2 "ClaudeCodeMonitor.app"
237+
# Verify signature with detailed output
238+
echo "=== Verifying signature ==="
239+
codesign --verify --deep --strict --verbose=4 "ClaudeCodeMonitor.app"
240+
241+
echo "=== Signature details ==="
212242
codesign -dvvv "ClaudeCodeMonitor.app"
243+
244+
echo "=== Verifying with spctl ==="
245+
spctl -a -vvv -t install "ClaudeCodeMonitor.app" || echo "Note: spctl check may fail in CI environment"
213246
214247
# Ad-hoc sign if no certificates
215248
- name: Ad-hoc sign app bundle
@@ -278,8 +311,26 @@ jobs:
278311
if: steps.check_signing.outputs.has_signing_cert == 'true' && steps.check_signing.outputs.has_notarization == 'true'
279312
run: |
280313
echo "📎 Stapling notarization..."
281-
xcrun stapler staple "$DMG_PATH"
282-
xcrun stapler validate "$DMG_PATH"
314+
echo "DMG_PATH: $DMG_PATH"
315+
316+
# Check if DMG exists
317+
if [ ! -f "$DMG_PATH" ]; then
318+
echo "❌ DMG file not found at: $DMG_PATH"
319+
ls -la
320+
exit 1
321+
fi
322+
323+
# Verify DMG signature before stapling
324+
echo "=== Verifying DMG signature before stapling ==="
325+
codesign --verify --verbose=2 "$DMG_PATH"
326+
327+
# Attempt to staple
328+
echo "=== Stapling notarization ticket ==="
329+
xcrun stapler staple -v "$DMG_PATH"
330+
331+
# Validate the staple
332+
echo "=== Validating stapled notarization ==="
333+
xcrun stapler validate -v "$DMG_PATH"
283334
284335
# Generate changelog for development releases
285336
- name: Generate changelog

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,15 @@ All notable changes to this project will be documented in this file.
1717

1818

1919

20+
21+
## [0.7.14] - 2025-07-06
22+
23+
### Fixed
24+
- Staple notarization失敗を修正
25+
- Sparkle.framework内のすべてのバイナリ(Autoupdate、Sparkle、Updater.app、XPCServices)を個別に署名
26+
- アプリ全体の署名に--deepオプションを追加
27+
- 署名検証とデバッグ情報を強化
28+
2029
## [0.7.13] - 2025-07-06
2130

2231
### Fixed

Info.plist

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@
1717
<key>CFBundlePackageType</key>
1818
<string>APPL</string>
1919
<key>CFBundleShortVersionString</key>
20-
<string>0.7.13</string>
20+
<string>0.7.14</string>
2121
<key>CFBundleVersion</key>
22-
<string>0.7.13</string>
22+
<string>0.7.14</string>
2323
<key>CcusageVersion</key>
2424
<string>15.3.0</string>
2525
<key>LSMinimumSystemVersion</key>

0 commit comments

Comments
 (0)