Skip to content

Commit 1c4584a

Browse files
committed
feat: 优化公证步骤,改为公证 DMG 文件并添加调试信息
1 parent 1f24d06 commit 1c4584a

File tree

1 file changed

+20
-11
lines changed

1 file changed

+20
-11
lines changed

.github/workflows/release.yml

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -285,35 +285,44 @@ jobs:
285285
prerelease: false
286286
args: ${{ matrix.args }}
287287

288-
- name: Notarize app (macOS only)
288+
- name: Notarize DMG (macOS only)
289289
if: matrix.platform == 'macos-latest'
290290
env:
291291
APPLE_ID: ${{ secrets.APPLE_ID }}
292292
APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }}
293293
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
294294
run: |
295-
# 获取构建的 app 路径
296-
APP_PATH="src-tauri/target/${{ matrix.args == '--target aarch64-apple-darwin' && 'aarch64-apple-darwin' || matrix.args == '--target x86_64-apple-darwin' && 'x86_64-apple-darwin' || '' }}/release/bundle/macos/NoteGen.app"
295+
# 获取构建的 DMG 路径
296+
TARGET_DIR="${{ matrix.args == '--target aarch64-apple-darwin' && 'aarch64-apple-darwin' || matrix.args == '--target x86_64-apple-darwin' && 'x86_64-apple-darwin' || '' }}"
297+
DMG_PATH="src-tauri/target/${TARGET_DIR}/release/bundle/dmg/NoteGen_0.23.4_${{ matrix.args == '--target aarch64-apple-darwin' && 'aarch64' || matrix.args == '--target x86_64-apple-darwin' && 'x64' || '' }}.dmg"
298+
APP_PATH="src-tauri/target/${TARGET_DIR}/release/bundle/macos/NoteGen.app"
297299
298-
if [ -f "$APP_PATH" ]; then
299-
echo "🔐 开始公证 $APP_PATH"
300+
echo "🔍 检查 DMG 路径: $DMG_PATH"
301+
echo "🔍 检查 APP 路径: $APP_PATH"
302+
303+
if [ -f "$DMG_PATH" ]; then
304+
echo "🔐 开始公证 DMG: $DMG_PATH"
300305
301-
# 使用 xcrun notarytool 进行公证(更快)
306+
# 使用 xcrun notarytool 进行公证 DMG
302307
# 设置 10 分钟超时
303-
timeout 600 xcrun notarytool submit "$APP_PATH" \
308+
timeout 600 xcrun notarytool submit "$DMG_PATH" \
304309
--apple-id "$APPLE_ID" \
305310
--password "$APPLE_PASSWORD" \
306311
--team-id "$APPLE_TEAM_ID" \
307312
--wait \
308313
--output-format json || echo "⚠️ 公证超时,但代码签名已完成"
309314
310-
# 获取公证结果并附加票据
311-
echo "📎 附加公证票据"
312-
xcrun stapler staple "$APP_PATH"
315+
# 获取公证结果并附加票据到 APP
316+
if [ -f "$APP_PATH" ]; then
317+
echo "📎 附加公证票据到 APP"
318+
xcrun stapler staple "$APP_PATH"
319+
fi
313320
314321
echo "✅ 公证完成"
315322
else
316-
echo "❌ 找不到应用文件: $APP_PATH"
323+
echo "❌ 找不到 DMG 文件: $DMG_PATH"
324+
echo "📁 可用文件列表:"
325+
find src-tauri/target -name "*.dmg" -o -name "*.app" 2>/dev/null || true
317326
fi
318327
319328
- name: Generate release tag

0 commit comments

Comments
 (0)