Skip to content

Mac Release Guide

duskzhen edited this page Mar 20, 2025 · 1 revision

Preparation

First, if you need to notarize your application, please configure Apple's App-Specific Password and notarization environment. The core command is as follows:

xcrun notarytool store-credentials 'DeepChat' --apple-id 'account email' --team-id team-id --password 'app password, which can be generated in Apple's personal center'

If you don't understand this part, please refer to this tutorial.

Environment Variable Explanation

Parameter Description
CSC_KEY_PASSWORD Your certificate password, used for signing and notarization.
CSC_LINK The path to the certificate file, usually in .p12 format.
build_for_release Whether it is a release version. 1 indicates a release version. The difference is that the release version will call the notarization command for notarization.
npm_config_arch For cross-compilation packaging. Documentation
npm_config_target_arch For cross-compilation packaging. Documentation
npm_config_platform For cross-compilation packaging. Documentation

Environment Variable Setup

Building arm64 Mac on arm64 Platform

Prepare Environment

  export CSC_KEY_PASSWORD='your certificate password'
  export CSC_LINK="/foo/bar/keys/your certificate.p12"
  export build_for_release=1

Install Dependencies

rm -rf node_modules
npm i
npm install --cpu=arm64 --os=darwin sharp
npm run installRuntime:mac:arm64
npm run build:mac:arm64

Building intel Mac on intel Platform

Prepare Environment

  export CSC_KEY_PASSWORD='your certificate password'
  export CSC_LINK="/foo/bar/keys/your certificate.p12"
  export build_for_release=1

Install Dependencies

rm -rf node_modules
npm i
npm install --cpu=x64 --os=darwin sharp
npm run installRuntime:mac:x64
npm run build:mac:x64

Building intel Mac on arm64 Platform

Prepare Environment

  export CSC_KEY_PASSWORD='your certificate password'
  export CSC_LINK="/foo/bar/keys/your certificate.p12"
  export build_for_release=1
  export npm_config_arch="x64"
  export npm_config_target_arch="x64"
  export npm_config_platform="darwin"

Install Dependencies

rm -rf node_modules
npm i
npm install --cpu=x64 --os=darwin sharp
npm run installRuntime:mac:x64
npm run build:mac:x64
Clone this wiki locally