fix: arm64 打包脚本改用 if/else 分支替代 EXTRA_ARGS 数组
bash 数组展开在 GitHub Actions 中不稳定, 改为 NOTARIZE 变量 + if/else 直接调用不同命令行。 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
1 parent
db86644c7e
commit
5629da9571
1 file changed
+12
-6
@@ -167,18 +167,24 @@ jobs:
|
||||
run: |
|
||||
set -euo pipefail
|
||||
|
||||
EXTRA_ARGS=()
|
||||
if [[ "${{ steps.mac_mode.outputs.notarize }}" != "true" ]]; then
|
||||
EXTRA_ARGS=(-c.mac.notarize=false)
|
||||
fi
|
||||
NOTARIZE="${{ steps.mac_mode.outputs.notarize }}"
|
||||
|
||||
for i in 1 2 3; do
|
||||
echo "electron-builder arm64 attempt $i/3 (notarize=${{ steps.mac_mode.outputs.notarize }})"
|
||||
if npx electron-builder --mac --arm64 --config electron-builder.yml "${EXTRA_ARGS[@]}" --publish never; then
|
||||
echo "electron-builder arm64 attempt $i/3 (notarize=$NOTARIZE)"
|
||||
|
||||
if [[ "$NOTARIZE" == "true" ]]; then
|
||||
npx electron-builder --mac --arm64 --config electron-builder.yml --publish never
|
||||
else
|
||||
npx electron-builder --mac --arm64 --config electron-builder.yml -c.mac.notarize=false --publish never
|
||||
fi
|
||||
|
||||
if [ $? -eq 0 ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [ "$i" -lt 3 ]; then sleep $((i * 60)); fi
|
||||
done
|
||||
|
||||
exit 1
|
||||
|
||||
# Restore x64 artifacts alongside arm64 output
|
||||
|
||||
Reference in new issue
Block a user