1
0

refactor: 合并 macOS 桌面打包流程

将 macOS .app 打包直接并入 desktop-build-mac,减少重复的桌面构建入口。\n\n同时移除未实现或已废弃的 desktop-package-* 命令和独立打包脚本,降低维护成本。
This commit is contained in:
2026-04-24 19:02:21 +08:00
parent d143c5f3df
commit b2e9dd8b7f
3 changed files with 46 additions and 84 deletions

View File

@@ -1,68 +0,0 @@
#!/bin/bash
VERSION="1.0.0"
APP_NAME="Nex"
BUNDLE_ID="io.nex.gateway"
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
PROJECT_ROOT="$(cd "${SCRIPT_DIR}/../.." && pwd)"
BUILD_DIR="${PROJECT_ROOT}/build"
ASSETS_DIR="${PROJECT_ROOT}/assets"
echo "打包 macOS .app..."
mkdir -p "${BUILD_DIR}/${APP_NAME}.app/Contents/MacOS"
mkdir -p "${BUILD_DIR}/${APP_NAME}.app/Contents/Resources"
if [ -f "${BUILD_DIR}/nex-mac-arm64" ]; then
cp "${BUILD_DIR}/nex-mac-arm64" "${BUILD_DIR}/${APP_NAME}.app/Contents/MacOS/nex"
elif [ -f "${BUILD_DIR}/nex-mac-amd64" ]; then
cp "${BUILD_DIR}/nex-mac-amd64" "${BUILD_DIR}/${APP_NAME}.app/Contents/MacOS/nex"
else
echo "错误: 未找到 macOS 二进制文件,请先运行 make desktop-build-mac"
exit 1
fi
if [ -f "${ASSETS_DIR}/AppIcon.icns" ]; then
cp "${ASSETS_DIR}/AppIcon.icns" "${BUILD_DIR}/${APP_NAME}.app/Contents/Resources/"
else
echo "警告: 未找到 AppIcon.icns"
fi
cat > "${BUILD_DIR}/${APP_NAME}.app/Contents/Info.plist" << EOF
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>zh_CN</string>
<key>CFBundleExecutable</key>
<string>nex</string>
<key>CFBundleIconFile</key>
<string>AppIcon</string>
<key>CFBundleIdentifier</key>
<string>${BUNDLE_ID}</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>${APP_NAME} Gateway</string>
<key>CFBundleDisplayName</key>
<string>${APP_NAME} Gateway</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>${VERSION}</string>
<key>CFBundleVersion</key>
<string>${VERSION}</string>
<key>LSMinimumSystemVersion</key>
<string>10.13</string>
<key>LSUIElement</key>
<true/>
<key>NSHighResolutionCapable</key>
<true/>
</dict>
</plist>
EOF
chmod +x "${BUILD_DIR}/${APP_NAME}.app/Contents/MacOS/nex"
echo "打包完成: ${BUILD_DIR}/${APP_NAME}.app"