diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a6a8d20..bc43b2a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -70,6 +70,42 @@ jobs: TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }} TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }} + - name: Add README to DMG + run: | + DMG_PATH=$(ls tauri-app/src-tauri/target/universal-apple-darwin/release/bundle/dmg/*.dmg | head -1) + DMG_RW="/tmp/temp_rw.dmg" + MOUNT_POINT="/tmp/dmg_mount" + + # 转换为可读写格式 + hdiutil convert "$DMG_PATH" -format UDRW -o "$DMG_RW" + + # 挂载可读写 DMG + mkdir -p "$MOUNT_POINT" + hdiutil attach "$DMG_RW" -mountpoint "$MOUNT_POINT" -nobrowse + + # 复制 README.txt 到 DMG 根目录 + cp tauri-app/src-tauri/README.txt "$MOUNT_POINT/" + + # 卸载 + hdiutil detach "$MOUNT_POINT" + + # 删除原 DMG,转换回压缩只读格式 + rm -f "$DMG_PATH" + hdiutil convert "$DMG_RW" -format UDZO -o "$DMG_PATH" + + # 清理临时文件 + rm -f "$DMG_RW" + + - name: Re-sign DMG + working-directory: tauri-app + run: | + DMG_PATH=$(ls src-tauri/target/universal-apple-darwin/release/bundle/dmg/*.dmg | head -1) + rm -f "${DMG_PATH}.sig" + npx tauri signer sign -k "$TAURI_SIGNING_PRIVATE_KEY" -p "$TAURI_SIGNING_PRIVATE_KEY_PASSWORD" "$DMG_PATH" + env: + TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }} + TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }} + - name: Upload artifacts uses: actions/upload-artifact@v4 with: diff --git a/tauri-app/src-tauri/README.txt b/tauri-app/src-tauri/README.txt new file mode 100644 index 0000000..781d54e --- /dev/null +++ b/tauri-app/src-tauri/README.txt @@ -0,0 +1,9 @@ +美家卡智影 - 首次打开指南 + +首次打开如遇打开失败,请按以下步骤操作: + +方法 1: +在应用图标上右键(或按住 Control 点击),选择"打开",然后在弹出的对话框中再次点击"打开"。 + +方法 2: +前往 系统设置 → 隐私与安全性,在"安全性"板块找到被拦截的应用记录,点击"仍要打开"按钮。 diff --git a/tauri-app/src-tauri/dmg-background-darkAqua.tiff b/tauri-app/src-tauri/dmg-background-darkAqua.tiff deleted file mode 100644 index 104f4ea..0000000 Binary files a/tauri-app/src-tauri/dmg-background-darkAqua.tiff and /dev/null differ diff --git a/tauri-app/src-tauri/dmg-background.png b/tauri-app/src-tauri/dmg-background.png deleted file mode 100644 index 76fa7a9..0000000 Binary files a/tauri-app/src-tauri/dmg-background.png and /dev/null differ diff --git a/tauri-app/src-tauri/dmg-background.tiff b/tauri-app/src-tauri/dmg-background.tiff deleted file mode 100644 index 0e8c976..0000000 Binary files a/tauri-app/src-tauri/dmg-background.tiff and /dev/null differ diff --git a/tauri-app/src-tauri/tauri.conf.json b/tauri-app/src-tauri/tauri.conf.json index af2719c..0581c38 100644 --- a/tauri-app/src-tauri/tauri.conf.json +++ b/tauri-app/src-tauri/tauri.conf.json @@ -72,7 +72,6 @@ "minimumSystemVersion": "13.0", "infoPlist": "Info.plist", "dmg": { - "background": "dmg-background.tiff", "windowSize": { "width": 660, "height": 400