OpenClaw macOS 发布(Sparkle)
此应用现已集成 Sparkle 自动更新。发布版本必须使用 Developer ID 签名、压缩,并发布带有已签名 appcast 条目。
前置要求
- 已安装 Developer ID Application 证书(例如:
Developer ID Application: <Developer Name> (<TEAMID>))。 - 在环境变量中设置 Sparkle 私钥路径为
SPARKLE_PRIVATE_KEY_FILE(指向你的 Sparkle ed25519 私钥;公钥已嵌入 Info.plist)。如果缺失,请检查~/.profile。 - 如需 Gatekeeper 安全的 DMG/zip 分发,需配置
xcrun notarytool的公证凭证(钥匙串配置文件或 API 密钥)。- 我们使用名为
openclaw-notary的钥匙串配置文件,从 shell 配置文件中的 App Store Connect API 密钥环境变量创建:APP_STORE_CONNECT_API_KEY_P8、APP_STORE_CONNECT_KEY_ID、APP_STORE_CONNECT_ISSUER_IDecho "$APP_STORE_CONNECT_API_KEY_P8" | sed 's/\\n/\n/g' > /tmp/openclaw-notary.p8xcrun notarytool store-credentials "openclaw-notary" --key /tmp/openclaw-notary.p8 --key-id "$APP_STORE_CONNECT_KEY_ID" --issuer "$APP_STORE_CONNECT_ISSUER_ID"
- 我们使用名为
- 已安装
pnpm依赖(pnpm install --config.node-linker=hoisted)。 - Sparkle 工具通过 SwiftPM 自动获取,位于
apps/macos/.build/artifacts/sparkle/Sparkle/bin/(sign_update、generate_appcast等)。
构建与打包
注意事项:
APP_BUILD映射到CFBundleVersion/sparkle:version;保持数字格式且单调递增(不要使用-beta),否则 Sparkle 会将其视为相同版本。- 默认为当前架构(
$(uname -m))。对于发布/通用构建,请设置BUILD_ARCHS="arm64 x86_64"(或BUILD_ARCHS=all)。 - 使用
scripts/package-mac-dist.sh生成发布产物(zip + DMG + 公证)。使用scripts/package-mac-app.sh用于本地/开发打包。
bash
# From repo root; set release IDs so Sparkle feed is enabled.
# APP_BUILD must be numeric + monotonic for Sparkle compare.
BUNDLE_ID=bot.molt.mac \
APP_VERSION=2026.2.3 \
APP_BUILD="$(git rev-list --count HEAD)" \
BUILD_CONFIG=release \
SIGN_IDENTITY="Developer ID Application: <Developer Name> (<TEAMID>)" \
scripts/package-mac-app.sh
# Zip for distribution (includes resource forks for Sparkle delta support)
ditto -c -k --sequesterRsrc --keepParent dist/OpenClaw.app dist/OpenClaw-2026.2.3.zip
# Optional: also build a styled DMG for humans (drag to /Applications)
scripts/create-dmg.sh dist/OpenClaw.app dist/OpenClaw-2026.2.3.dmg
# Recommended: build + notarize/staple zip + DMG
# First, create a keychain profile once:
# xcrun notarytool store-credentials "openclaw-notary" \
# --apple-id "<apple-id>" --team-id "<team-id>" --password "<app-specific-password>"
NOTARIZE=1 NOTARYTOOL_PROFILE=openclaw-notary \
BUNDLE_ID=bot.molt.mac \
APP_VERSION=2026.2.3 \
APP_BUILD="$(git rev-list --count HEAD)" \
BUILD_CONFIG=release \
SIGN_IDENTITY="Developer ID Application: <Developer Name> (<TEAMID>)" \
scripts/package-mac-dist.sh
# Optional: ship dSYM alongside the release
ditto -c -k --keepParent apps/macos/.build/release/OpenClaw.app.dSYM dist/OpenClaw-2026.2.3.dSYM.zipAppcast 条目
使用发布说明生成器,使 Sparkle 渲染格式化的 HTML 说明:
bash
SPARKLE_PRIVATE_KEY_FILE=/path/to/ed25519-private-key scripts/make_appcast.sh dist/OpenClaw-2026.2.3.zip https://raw.githubusercontent.com/openclaw/openclaw/main/appcast.xml从 CHANGELOG.md 生成 HTML 发布说明(通过 scripts/changelog-to-html.sh)并将其嵌入 appcast 条目。 发布时将更新后的 appcast.xml 与发布资源(zip + dSYM)一起提交。
发布与验证
- 将
OpenClaw-2026.2.3.zip(和OpenClaw-2026.2.3.dSYM.zip)上传到标签v2026.2.3的 GitHub 发布版本。 - 确保原始 appcast URL 与嵌入的 feed 匹配:
https://raw.githubusercontent.com/openclaw/openclaw/main/appcast.xml。 - 完整性检查:
curl -I https://raw.githubusercontent.com/openclaw/openclaw/main/appcast.xml返回 200。- 资源上传后
curl -I <enclosure url>返回 200。 - 在之前的公开版本上,从"关于"标签运行"检查更新…",验证 Sparkle 能正常安装新版本。
完成定义:已发布签名应用 + appcast,从旧版本的更新流程正常工作,且发布资源已附加到 GitHub 发布版本。