From 79cc4beab145db0c3cc7b99fc6faacd53561d20c Mon Sep 17 00:00:00 2001 From: Alfredo Gallardo Date: Tue, 4 Jun 2024 00:56:38 -0400 Subject: [PATCH] - feature: add app store connect --- apps/shinkai-desktop/src-tauri/Info.plist | 8 ++ .../src-tauri/entitlements.plist | 20 ++++ .../src-tauri/ollama-entitlements.plist | 13 +++ .../src-tauri/shinkai-node-entitlements.plist | 13 +++ .../shinkai-desktop/src-tauri/tauri.conf.json | 3 +- .../tauri.macos-app-store-connect.conf.json | 104 ++++++++++++++++++ ci-scripts/build-app-store-connect.sh | 30 +++++ 7 files changed, 190 insertions(+), 1 deletion(-) create mode 100644 apps/shinkai-desktop/src-tauri/Info.plist create mode 100644 apps/shinkai-desktop/src-tauri/entitlements.plist create mode 100644 apps/shinkai-desktop/src-tauri/ollama-entitlements.plist create mode 100644 apps/shinkai-desktop/src-tauri/shinkai-node-entitlements.plist create mode 100644 apps/shinkai-desktop/src-tauri/tauri.macos-app-store-connect.conf.json create mode 100755 ci-scripts/build-app-store-connect.sh diff --git a/apps/shinkai-desktop/src-tauri/Info.plist b/apps/shinkai-desktop/src-tauri/Info.plist new file mode 100644 index 000000000..75ed29489 --- /dev/null +++ b/apps/shinkai-desktop/src-tauri/Info.plist @@ -0,0 +1,8 @@ + + + + + CFBundleIdentifier + com.shinkai.desktop + + \ No newline at end of file diff --git a/apps/shinkai-desktop/src-tauri/entitlements.plist b/apps/shinkai-desktop/src-tauri/entitlements.plist new file mode 100644 index 000000000..b8c7f102f --- /dev/null +++ b/apps/shinkai-desktop/src-tauri/entitlements.plist @@ -0,0 +1,20 @@ + + + + + + com.apple.security.app-sandbox + + com.apple.security.network.client + + com.apple.application-identifier + PKYM3LZ24S.com.shinkai.desktop + + com.apple.developer.team-identifier + PKYM3LZ24S + + com.apple.security.application-groups + PKYM3LZ24S.com.shinkai.desktop + + + \ No newline at end of file diff --git a/apps/shinkai-desktop/src-tauri/ollama-entitlements.plist b/apps/shinkai-desktop/src-tauri/ollama-entitlements.plist new file mode 100644 index 000000000..84ddab51a --- /dev/null +++ b/apps/shinkai-desktop/src-tauri/ollama-entitlements.plist @@ -0,0 +1,13 @@ + + + + + + com.apple.security.app-sandbox + + com.apple.security.inherit + + com.apple.security.network.server + + + diff --git a/apps/shinkai-desktop/src-tauri/shinkai-node-entitlements.plist b/apps/shinkai-desktop/src-tauri/shinkai-node-entitlements.plist new file mode 100644 index 000000000..84ddab51a --- /dev/null +++ b/apps/shinkai-desktop/src-tauri/shinkai-node-entitlements.plist @@ -0,0 +1,13 @@ + + + + + + com.apple.security.app-sandbox + + com.apple.security.inherit + + com.apple.security.network.server + + + diff --git a/apps/shinkai-desktop/src-tauri/tauri.conf.json b/apps/shinkai-desktop/src-tauri/tauri.conf.json index 564bf6fc2..d4dba195e 100644 --- a/apps/shinkai-desktop/src-tauri/tauri.conf.json +++ b/apps/shinkai-desktop/src-tauri/tauri.conf.json @@ -80,7 +80,8 @@ "icons/icon.ico" ], "macOS": { - "minimumSystemVersion": "10.13" + "minimumSystemVersion": "12.0", + "entitlements": "./entitlements.plist" }, "externalBin": [ "bin/shinkai-node", diff --git a/apps/shinkai-desktop/src-tauri/tauri.macos-app-store-connect.conf.json b/apps/shinkai-desktop/src-tauri/tauri.macos-app-store-connect.conf.json new file mode 100644 index 000000000..2944359f3 --- /dev/null +++ b/apps/shinkai-desktop/src-tauri/tauri.macos-app-store-connect.conf.json @@ -0,0 +1,104 @@ +{ + "build": { + "beforeDevCommand": "npm run dev", + "beforeBuildCommand": "npm run build", + "devPath": "http://localhost:1420", + "distDir": "../dist", + "withGlobalTauri": false + }, + "package": { + "productName": "Shinkai Desktop", + "version": "../../../package.json" + }, + "tauri": { + "allowlist": { + "all": false, + "globalShortcut": { + "all": true + }, + "fs": { + "all": true + }, + "shell": { + "all": false, + "open": true, + "sidecar": true, + "scope": [ + { "name": "bin/shinkai-node", "sidecar": true }, + { "name": "bin/ollama", "sidecar": true } + ] + }, + "window": { + "startDragging": true, + "close": true, + "create": true, + "setFocus": true + }, + "notification": { + "all": true + }, + "os": { + "all": true + }, + "dialog": { + "all": true, + "ask": true, + "confirm": true, + "message": true, + "open": true, + "save": true + }, + "path": { + "all": true + }, + "http": { + "all": false, + "request": true, + "scope": [ + "http://localhost" + ] + } + }, + "bundle": { + "active": true, + "targets": "all", + "identifier": "com.shinkai.desktop", + "icon": [ + "icons/32x32.png", + "icons/128x128.png", + "icons/128x128@2x.png", + "icons/icon.icns", + "icons/icon.ico" + ], + "macOS": { + "minimumSystemVersion": "12.0", + "entitlements": "./entitlements.plist" + }, + "externalBin": [ + "bin/shinkai-node", + "bin/ollama" + ], + "category": "Productivity" + }, + "security": { + "csp": null + }, + "windows": [ + { + "transparent": true, + "title": "Shinkai Desktop", + "width": 1000, + "height": 750, + "resizable": true, + "fileDropEnabled": false + } + ], + "macOSPrivateApi": true, + "systemTray": { + "iconPath": "icons/icon.png" + }, + "updater": { + "active": false + } + } +} diff --git a/ci-scripts/build-app-store-connect.sh b/ci-scripts/build-app-store-connect.sh new file mode 100755 index 000000000..de063e3c0 --- /dev/null +++ b/ci-scripts/build-app-store-connect.sh @@ -0,0 +1,30 @@ +app_path="./apps/shinkai-desktop/src-tauri/target/release/bundle/macos/Shinkai Desktop.app"; + +sign_app="3rd Party Mac Developer Application: dcSpark Global LTD (PKYM3LZ24S)"; + +sign_install="3rd Party Mac Developer Installer: dcSpark Global LTD (PKYM3LZ24S)"; + +build_name="./Shinkai Desktop.pkg"; + +profile="./embedded.provisionprofile"; + +cp_dir="${app_path}/Contents/"; + +npx nx build shinkai-desktop --config="./src-tauri/tauri.macos-app-store-connect.conf.json"; +cp "${profile}" "${cp_dir}"; + +codesign -d -vvv -f -s "${sign_app}" --entitlements "./apps/shinkai-desktop/src-tauri/ollama-entitlements.plist" -i "com.shinkai.desktop" "${app_path}/Contents/MacOS/ollama" +codesign -d -vvv -f -s "${sign_app}" --entitlements "./apps/shinkai-desktop/src-tauri/shinkai-node-entitlements.plist" -i "com.shinkai.desktop" "${app_path}/Contents/MacOS/shinkai-node" + +./main -p "apps/shinkai-desktop/src-tauri/Info.plist" "${app_path}/Contents/MacOS/ollama" +./main -p "apps/shinkai-desktop/src-tauri/Info.plist" "${app_path}/Contents/MacOS/shinkai-node" + +mv "${app_path}/Contents/MacOS/ollama.patched" "${app_path}/Contents/MacOS/ollama" +mv "${app_path}/Contents/MacOS/shinkai-node.patched" "${app_path}/Contents/MacOS/shinkai-node" + +codesign -d -vvv -f -s "${sign_app}" --entitlements "./apps/shinkai-desktop/src-tauri/ollama-entitlements.plist" -i "com.shinkai.desktop" "${app_path}/Contents/MacOS/ollama" +codesign -d -vvv -f -s "${sign_app}" --entitlements "./apps/shinkai-desktop/src-tauri/shinkai-node-entitlements.plist" -i "com.shinkai.desktop" "${app_path}/Contents/MacOS/shinkai-node" +codesign -d -vvv -f -s "${sign_app}" --entitlements "./apps/shinkai-desktop/src-tauri/entitlements.plist" "${app_path}/Contents/MacOS/Shinkai Desktop" +codesign -d -vvv -f -s "${sign_app}" --entitlements "./apps/shinkai-desktop/src-tauri/entitlements.plist" "${app_path}"; + +productbuild --sign "${sign_install}" --component "${app_path}" /Applications/ "${build_name}";