ci: 私钥写入文件前 strip 掉前后空白,修复首字节换行符问题

This commit is contained in:
小鱼开发
2026-05-19 12:49:48 +08:00
parent 00409fd9a8
commit ce754f7004
+1 -1
View File
@@ -102,7 +102,7 @@ jobs:
DMG_PATH=$(ls src-tauri/target/universal-apple-darwin/release/bundle/dmg/*.dmg | head -1)
rm -f "${DMG_PATH}.sig"
# 用 python 将私钥写入文件,避免 shell heredoc 缩进问题
python3 -c "import os; open('/tmp/private.key','w').write(os.environ['TAURI_SIGNING_PRIVATE_KEY'])"
python3 -c "import os; open('/tmp/private.key','w').write(os.environ['TAURI_SIGNING_PRIVATE_KEY'].strip())"
npx tauri signer sign -f /tmp/private.key -p "$TAURI_SIGNING_PRIVATE_KEY_PASSWORD" "$DMG_PATH"
rm -f /tmp/private.key
env: