Skip to content

feat: add macOS (DMG) build support#8

Open
fengcunhan wants to merge 1 commit intoMemeCalculate:mainfrom
fengcunhan:feat/macos-build
Open

feat: add macOS (DMG) build support#8
fengcunhan wants to merge 1 commit intoMemeCalculate:mainfrom
fengcunhan:feat/macos-build

Conversation

@fengcunhan
Copy link

变更说明

本 PR 为项目添加了 macOS 平台的构建支持。

变更内容

electron-builder.yml

  • 新增 mac 构建目标,输出格式为 DMG
  • 同时支持 x64(Intel)和 arm64(Apple Silicon)两种架构
  • 设置 identity: null 跳过代码签名(分发时可配置 Apple Developer 证书开启)

package.json

  • 新增 build:mac 脚本,方便在 macOS 环境下一键构建

构建方法

在 macOS 系统上执行:

ELECTRON_MIRROR="https://npmmirror.com/mirrors/electron/" npm run build:mac

构建产物位于 release/moyin-creator-{version}-mac.dmg

注意事项

  • 未签名的应用首次打开时会触发 Gatekeeper 安全提示,用户可通过右键菜单 → 打开来绕过
  • 若需正式签名分发,需配置 CSC_LINKCSC_KEY_PASSWORD 环境变量并移除 identity: null

- Add mac target with DMG format for x64 and arm64 architectures
- Set identity: null to skip code signing (can be enabled later with proper certs)
- Add build:mac npm script for easy macOS builds
- Use ELECTRON_MIRROR for faster electron binary downloads in China

To build macOS package:
  ELECTRON_MIRROR="https://npmmirror.com/mirrors/electron/" npm run build:mac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant