Skip to content

Commit

Permalink
- feature: add app store connect
Browse files Browse the repository at this point in the history
  • Loading branch information
agallardol committed Jun 4, 2024
1 parent f1b247a commit 79cc4be
Show file tree
Hide file tree
Showing 7 changed files with 190 additions and 1 deletion.
8 changes: 8 additions & 0 deletions apps/shinkai-desktop/src-tauri/Info.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleIdentifier</key>
<string>com.shinkai.desktop</string>
</dict>
</plist>
20 changes: 20 additions & 0 deletions apps/shinkai-desktop/src-tauri/entitlements.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>

<key>com.apple.security.app-sandbox</key><true/>

<key>com.apple.security.network.client</key><true/>

<key>com.apple.application-identifier</key>
<string>PKYM3LZ24S.com.shinkai.desktop</string>

<key>com.apple.developer.team-identifier</key>
<string>PKYM3LZ24S</string>

<key>com.apple.security.application-groups</key>
<string>PKYM3LZ24S.com.shinkai.desktop</string>

</dict>
</plist>
13 changes: 13 additions & 0 deletions apps/shinkai-desktop/src-tauri/ollama-entitlements.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>

<key>com.apple.security.app-sandbox</key><true/>

<key>com.apple.security.inherit</key><true/>

<key>com.apple.security.network.server</key><true/>

</dict>
</plist>
13 changes: 13 additions & 0 deletions apps/shinkai-desktop/src-tauri/shinkai-node-entitlements.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>

<key>com.apple.security.app-sandbox</key><true/>

<key>com.apple.security.inherit</key><true/>

<key>com.apple.security.network.server</key><true/>

</dict>
</plist>
3 changes: 2 additions & 1 deletion apps/shinkai-desktop/src-tauri/tauri.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@
"icons/icon.ico"
],
"macOS": {
"minimumSystemVersion": "10.13"
"minimumSystemVersion": "12.0",
"entitlements": "./entitlements.plist"
},
"externalBin": [
"bin/shinkai-node",
Expand Down
104 changes: 104 additions & 0 deletions apps/shinkai-desktop/src-tauri/tauri.macos-app-store-connect.conf.json
Original file line number Diff line number Diff line change
@@ -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/[email protected]",
"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
}
}
}
30 changes: 30 additions & 0 deletions ci-scripts/build-app-store-connect.sh
Original file line number Diff line number Diff line change
@@ -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}";

0 comments on commit 79cc4be

Please sign in to comment.