chore: configure macOS Developer ID signing

This commit is contained in:
gongzhiyong
2026-05-18 13:33:32 +08:00
parent f43aa269d6
commit 8135798e9e
4 changed files with 25 additions and 6 deletions
+13 -1
View File
@@ -12,6 +12,7 @@ CANONICAL_OUTPUT_DIR="${DESKTOP_DIR}/build-artifacts/macos-arm64"
APP_BUNDLE_NAME="HeiCode.app"
APP_BUNDLE_ID="com.heicode.desktop"
DMG_VOLUME_NAME="Heicode"
CODESIGN_IDENTITY="${CODESIGN_IDENTITY:-Developer ID Application: zhiyong Gong (R49P76Q59F)}"
APP_VERSION="$(bun -e "console.log(require('${DESKTOP_DIR}/src-tauri/tauri.conf.json').version)" 2>/dev/null || echo "0.0.0")"
DEFAULT_DMG_BASENAME="Heicode_${APP_VERSION}_aarch64.dmg"
@@ -25,6 +26,9 @@ Usage:
Environment:
SKIP_INSTALL=1 Skip `bun install` in the repo root and desktop app.
SIGN_BUILD=1 Remove the default `--no-sign` flag and allow signed builds.
CODESIGN_IDENTITY
Signing identity used when SIGN_BUILD=1.
Defaults to "Developer ID Application: zhiyong Gong (R49P76Q59F)".
OPEN_OUTPUT=1 Open the canonical artifact output directory in Finder after a successful build.
Examples:
@@ -245,7 +249,15 @@ sign_canonical_app_bundle() {
# fails strict bundle validation once Resources/icon.icns exists. Sign only
# the outer bundle: do not pass --deep, because re-signing claude-sidecar
# changes its code-signature hash and breaks existing macOS Keychain ACLs.
codesign --force --sign - --timestamp=none "${app_bundle}"
if [[ "${SIGN_BUILD:-0}" == "1" ]]; then
codesign --force \
--sign "${CODESIGN_IDENTITY}" \
--options runtime \
--timestamp \
"${app_bundle}"
else
codesign --force --sign - --timestamp=none "${app_bundle}"
fi
if [[ -x "${sidecar}" ]]; then
sidecar_cdhash_after="$(codesign_cdhash "${sidecar}")"
+1 -1
View File
@@ -1525,7 +1525,7 @@ checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea"
[[package]]
name = "heicode-desktop"
version = "0.1.8"
version = "0.2.1"
dependencies = [
"anyhow",
"portable-pty",
@@ -14,5 +14,12 @@
"acceptFirstMouse": true
}
]
},
"bundle": {
"macOS": {
"signingIdentity": "Developer ID Application: zhiyong Gong (R49P76Q59F)",
"hardenedRuntime": true,
"providerShortName": "R49P76Q59F"
}
}
}
+4 -4
View File
@@ -46,9 +46,9 @@
"mac": {
"category": "public.app-category.developer-tools",
"icon": "icon.png",
"identity": null,
"hardenedRuntime": false,
"gatekeeperAssess": false,
"identity": "Developer ID Application: zhiyong Gong (R49P76Q59F)",
"hardenedRuntime": true,
"gatekeeperAssess": true,
"entitlements": "entitlements.mac.plist",
"entitlementsInherit": "entitlements.mac.plist",
"target": [
@@ -98,4 +98,4 @@
"allowToChangeInstallationDirectory": true
}
}
}
}