Skip to content

Commit 736c625

Browse files
authored
Merge pull request #358 from davidmann4/packaging/macos-cli-in-app
packaging(macos): ship materialcraft-cli inside MaterialCraft.app
2 parents 1802abb + 9eae054 commit 736c625

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

‎README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ are in [`AGENTS.md`](AGENTS.md). Every bundled asset is listed with its licence
215215
| Build | File | Notes |
216216
|---|---|---|
217217
| App, universal (Apple silicon + Intel) | `materialcraft-<ver>-macos-universal.dmg` | Signed and notarized |
218-
| Command-line tool, universal | `materialcraft-cli-<ver>-macos-universal.zip` | Signed and notarized |
218+
| Command-line tool, universal | `materialcraft-cli-<ver>-macos-universal.zip` | Signed and notarized; the app also carries it as `MaterialCraft.app/Contents/MacOS/materialcraft-cli` |
219219

220220
### Linux
221221

‎packaging/macos/package.sh‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
# Build, sign and (optionally) notarize the macOS release artifacts:
33
#
44
# $DIST/materialcraft-<version>-macos-<arch>.dmg MaterialCraft.app on a drag-to-Applications DMG
5+
# (the CLI inside too: Contents/MacOS/materialcraft-cli)
56
# $DIST/materialcraft-cli-<version>-macos-<arch>.zip the headless CLI
67
#
78
# Usage: packaging/macos/package.sh [--arch universal|aarch64|x86_64] [--skip-build]
@@ -102,6 +103,9 @@ echo "==> assembling $APP"
102103
mkdir -p "$APP/Contents/MacOS" "$APP/Contents/Resources"
103104
# Executable and icon carry the display name (CFBundleExecutable / CFBundleIconFile).
104105
cp "$WORK/bin/materialcraft" "$APP/Contents/MacOS/MaterialCraft"
106+
# The CLI too, beside the app's executable: the ArtCraft Launcher finds `materialcraft-cli` next to it
107+
# and registers `materialcraft-cli mcp` for agents, which starts the app beside it when it is closed.
108+
cp "$WORK/bin/materialcraft-cli" "$APP/Contents/MacOS/materialcraft-cli"
105109
cp "$ROOT/assets/app-icon/materialcraft.icns" "$APP/Contents/Resources/MaterialCraft.icns"
106110
sed -e "s/@VERSION@/$VERSION/g" -e "s/@SHORT_VERSION@/$SHORT_VERSION/g" \
107111
-e "s/@BUILD_SHA@/${MATERIALCRAFT_BUILD_SHA:-unknown}/g" \
@@ -112,7 +116,9 @@ printf 'APPL????' >"$APP/Contents/PkgInfo"
112116
copy_docs "$APP/Contents/Resources"
113117

114118
# Sign inside-out: nested code first, then the bundle itself (no --deep on the final signature).
115-
# Today the only nested code is the main executable; frameworks/helpers would be signed here too.
119+
# The bundled CLI is nested executable code, signed as the standalone CLI is (its own identifier,
120+
# hardened runtime), before the app's executable and the bundle are sealed.
121+
sign --options runtime --identifier ai.storyteller.materialcraft-cli "$APP/Contents/MacOS/materialcraft-cli"
116122
sign --options runtime --entitlements "$HERE/entitlements.plist" "$APP/Contents/MacOS/MaterialCraft"
117123
sign --options runtime --entitlements "$HERE/entitlements.plist" "$APP"
118124
codesign --verify --strict --deep --verbose=2 "$APP"

0 commit comments

Comments
 (0)