cicy-desktop 2.1.146 → 2.1.148

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -171,3 +171,33 @@ jobs:
171
171
  gh release upload "${{ steps.meta.outputs.tag }}" dist/latest-mac.yml \
172
172
  --repo "$GITHUB_REPOSITORY" --clobber
173
173
  fi
174
+
175
+ # Lightweight app installer (~150MB): prebuilt ad-hoc-signed .app + install.command.
176
+ # No Apple cert (installer strips quarantine + re-ad-hoc-signs locally). Docker is
177
+ # NOT bundled — the app downloads + reuses it at runtime (keeps this small). For a
178
+ # fully-offline install, drop the docker base disk + cicy-code image next to
179
+ # install.command in a docker/ subdir and it'll stage them instead.
180
+ - name: Build app installer bundles (.app + installer, no docker)
181
+ continue-on-error: true # extra artifact — never fail the dmg/zip release
182
+ shell: bash
183
+ env:
184
+ GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
185
+ run: |
186
+ set -euo pipefail
187
+ VER="${{ steps.meta.outputs.version }}"
188
+ for ARCH in x64 arm64; do
189
+ WANT="$([ "$ARCH" = x64 ] && echo x86_64 || echo arm64)"
190
+ APP=""
191
+ for d in $(find dist -maxdepth 2 -type d -name "*.app"); do
192
+ if lipo -archs "$d/Contents/MacOS/"* 2>/dev/null | grep -qw "$WANT"; then APP="$d"; break; fi
193
+ done
194
+ [ -n "$APP" ] || { echo "::warning::no $ARCH .app found, skipping"; continue; }
195
+ echo "app installer $ARCH ← $APP"
196
+ B="appbundle-$ARCH"; rm -rf "$B"; mkdir -p "$B"
197
+ cp -R "$APP" "$B/CiCy Desktop.app"
198
+ cp scripts/mac-allinone/install.command "$B/"; chmod +x "$B/install.command"
199
+ OUT="cicy-desktop-app-$VER-$ARCH.tar.gz"
200
+ tar -czf "$OUT" -C "$B" .
201
+ gh release upload "${{ steps.meta.outputs.tag }}" "$OUT" --repo "$GITHUB_REPOSITORY" --clobber
202
+ echo "uploaded $OUT ($(du -h "$OUT" | cut -f1))"
203
+ done
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cicy-desktop",
3
- "version": "2.1.146",
3
+ "version": "2.1.148",
4
4
  "description": "CiCy - AI-powered operating system browser",
5
5
  "main": "src/main.js",
6
6
  "bin": {
@@ -0,0 +1,67 @@
1
+ #!/bin/bash
2
+ # CiCy Desktop — offline all-in-one installer for macOS (NO Apple signing needed).
3
+ #
4
+ # Without an Apple Developer cert a DOWNLOADED .app/.dmg is Gatekeeper-quarantined
5
+ # ("已损坏 / 无法打开", hard-blocked on arm64). electron-builder already produces a
6
+ # working ad-hoc-signed CiCy Desktop.app (in the -mac.zip); the only thing stopping
7
+ # it from opening is the download quarantine flag. So this installer:
8
+ # 1. installs that prebuilt .app and strips the quarantine (xattr -cr) + re-ad-hoc-
9
+ # signs it locally (codesign --sign -, no cert) → opens normally, no signing.
10
+ # 2. pre-stages the docker base disk + cicy-code image so the app's docker
11
+ # bootstrap REUSES them → zero download, fully offline.
12
+ #
13
+ # Bundle layout (this file sits at the bundle root):
14
+ # CiCy Desktop.app — prebuilt app (from electron-builder)
15
+ # docker/ubuntu-2404-<arch>-docker.raw.gz — colima base disk (340MB)
16
+ # docker/cicy-code-latest.tar.gz — cicy-code image (167MB)
17
+ set -euo pipefail
18
+
19
+ HERE="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
20
+ APP_NAME="CiCy Desktop"
21
+ DEST_APP="/Applications/$APP_NAME.app"
22
+ ARCH="$(uname -m)"; [ "$ARCH" = "x86_64" ] && DTAG="amd64" || DTAG="arm64"
23
+
24
+ echo "==> CiCy Desktop 离线安装(arch=$ARCH)"
25
+
26
+ SRC_APP="$HERE/$APP_NAME.app"
27
+ [ -d "$SRC_APP" ] || { echo "缺少 $APP_NAME.app(包损坏?)"; exit 1; }
28
+
29
+ # ── 1) 安装到 /Applications ─────────────────────────────────────────────────
30
+ echo "==> 安装到 $DEST_APP …"
31
+ if [ -w "/Applications" ] || [ ! -e "$DEST_APP" ]; then
32
+ rm -rf "$DEST_APP" 2>/dev/null || true
33
+ ditto "$SRC_APP" "$DEST_APP"
34
+ else
35
+ echo " 需要管理员权限覆盖旧版,请输入密码:"
36
+ sudo rm -rf "$DEST_APP"; sudo ditto "$SRC_APP" "$DEST_APP"
37
+ sudo chown -R "$(id -un)":staff "$DEST_APP" 2>/dev/null || true
38
+ fi
39
+
40
+ # ── 2) 清隔离 + 本地 ad-hoc 自签(免 Apple 证书的关键)──────────────────────
41
+ echo "==> 清隔离属性 + 本地 ad-hoc 自签 …"
42
+ xattr -dr com.apple.quarantine "$DEST_APP" 2>/dev/null || true
43
+ xattr -cr "$DEST_APP" 2>/dev/null || true
44
+ # 重新 ad-hoc 签整个 bundle(ditto 后保险起见;已签则等价覆盖)
45
+ codesign --force --deep --sign - "$DEST_APP" 2>/dev/null || \
46
+ echo " (codesign 警告可忽略,quarantine 已清即可打开)"
47
+
48
+ # ── 3) (可选)预暂存 docker 包 —— 仅当 bundle 里带了 docker/ 时(全离线包)。
49
+ # app-only 包没有这个目录:跳过,docker 由 app 运行时联网装(一次,之后复用)。
50
+ DISK_SRC="$HERE/docker/ubuntu-2404-$DTAG-docker.raw.gz"
51
+ IMG_SRC="$HERE/docker/cicy-code-latest.tar.gz"
52
+ STAGED=0
53
+ if [ -f "$DISK_SRC" ] || [ -f "$IMG_SRC" ]; then
54
+ echo "==> 检测到离线 docker 包,预暂存以便零下载 …"
55
+ mkdir -p "$HOME/cicy-ai/colima" "$HOME/Downloads"
56
+ [ -f "$DISK_SRC" ] && ditto "$DISK_SRC" "$HOME/cicy-ai/colima/ubuntu-2404-$DTAG-docker.raw.gz" && echo " 基础盘已就位($DTAG)" && STAGED=1
57
+ [ -f "$IMG_SRC" ] && ditto "$IMG_SRC" "$HOME/Downloads/cicy-code-latest.tar.gz" && echo " cicy-code 镜像已就位" && STAGED=1
58
+ fi
59
+
60
+ echo ""
61
+ echo "✅ 安装完成 —— 打开「启动台」或 /Applications 里的「$APP_NAME」。"
62
+ if [ "$STAGED" = 1 ]; then
63
+ echo " docker 运行环境已预置,首次点安装直接复用、不下载。"
64
+ else
65
+ echo " docker 首次点安装会联网下载运行环境(之后复用,不再重下)。"
66
+ fi
67
+ open "$DEST_APP" || true