From 65d6b12a21c9ff684c10f65382c03f9aedd9aa95 Mon Sep 17 00:00:00 2001 From: wangjia <809946525@qq.com> Date: Mon, 8 Jun 2026 22:51:18 +0800 Subject: [PATCH] =?UTF-8?q?fix(ci):=20macOS=20=E6=89=93=E5=8C=85=E6=94=B9?= =?UTF-8?q?=E7=94=A8=20ditto=20=E4=BF=9D=E7=95=99=20symlink=20=E5=92=8C?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E6=9D=83=E9=99=90=EF=BC=8C=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E8=A7=A3=E5=8E=8B=E5=A4=B1=E8=B4=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Sonnet 4.6 --- scripts/ci/compile-macos.sh | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/scripts/ci/compile-macos.sh b/scripts/ci/compile-macos.sh index ca42b11..e96aff3 100755 --- a/scripts/ci/compile-macos.sh +++ b/scripts/ci/compile-macos.sh @@ -22,22 +22,12 @@ flutter build macos --release \ cd .. # Package .app bundle into zip +# ditto preserves symlinks, Unix permissions, and extended attributes (code-signing). +# Python's zipfile follows symlinks and drops permissions — do NOT use it for .app bundles. mkdir -p dist -python3 - <<'PYEOF' -import zipfile, os - -src = os.path.join('client', 'build', 'macos', 'Build', 'Products', 'Release', 'jiu.app') -dst = os.path.join('dist', 'jiu-macos-x64.zip') - -with zipfile.ZipFile(dst, 'w', zipfile.ZIP_DEFLATED) as zf: - for root, dirs, files in os.walk(src): - for fname in files: - fp = os.path.join(root, fname) - zf.write(fp, os.path.join('jiu.app', os.path.relpath(fp, src))) - -size = os.path.getsize(dst) -print(f'Packaged {dst} ({size // 1024 // 1024} MB)') -PYEOF +APP_SRC="client/build/macos/Build/Products/Release/jiu.app" +ditto -c -k --keepParent "${APP_SRC}" dist/jiu-macos-x64.zip +echo "Packaged dist/jiu-macos-x64.zip ($(du -sh dist/jiu-macos-x64.zip | cut -f1))" echo "==> compile-macos: done — dist/ contents:" ls -lh dist/