cicy-desktop 2.1.184 → 2.1.185
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.
|
@@ -40,12 +40,21 @@ jobs:
|
|
|
40
40
|
# linux-arm64 用户的包里塞的是 x64 二进制。强制把两个 linux 架构都装进 node_modules,
|
|
41
41
|
# electron-builder 两架构都打包,localbin 按用户机器选。必须在所有 npm install 之后。
|
|
42
42
|
- name: Bundle BOTH linux arches of cicy-code/mihomo (runner is single-arch)
|
|
43
|
+
shell: bash
|
|
43
44
|
run: |
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
45
|
+
set -e
|
|
46
|
+
# npm pack(不看 os/cpu/lockfile)+ 解压,绕开 `npm install --force` 在已有 lockfile 上的 no-op。
|
|
47
|
+
for pkg in cicy-code-linux-x64 cicy-code-linux-arm64 cicy-mihomo-linux-x64 cicy-mihomo-linux-arm64; do
|
|
48
|
+
ver=$(node -e "const o=require('./package.json').optionalDependencies||{}; process.stdout.write(o['$pkg']||'')")
|
|
49
|
+
[ -z "$ver" ] && { echo "skip $pkg"; continue; }
|
|
50
|
+
bin=cicy-code; case "$pkg" in cicy-mihomo*) bin=mihomo;; esac
|
|
51
|
+
if [ -f "node_modules/$pkg/$bin" ]; then echo "$pkg present"; continue; fi
|
|
52
|
+
echo "npm pack $pkg@$ver → node_modules/$pkg"
|
|
53
|
+
tmp=$(mktemp -d); ( cd "$tmp" && npm pack "$pkg@$ver" --silent ); tar -xzf "$tmp"/*.tgz -C "$tmp"
|
|
54
|
+
rm -rf "node_modules/$pkg"; mkdir -p "node_modules/$pkg"; cp -R "$tmp/package/." "node_modules/$pkg/"; rm -rf "$tmp"
|
|
55
|
+
done
|
|
47
56
|
ls node_modules | grep -E 'cicy-(code|mihomo)-linux' || true
|
|
48
|
-
for a in x64 arm64; do test -f "node_modules/cicy-code-linux-$a/cicy-code" || { echo "::error::cicy-code-linux-$a
|
|
57
|
+
for a in x64 arm64; do test -f "node_modules/cicy-code-linux-$a/cicy-code" || { echo "::error::cicy-code-linux-$a missing"; exit 1; }; done
|
|
49
58
|
|
|
50
59
|
# NOTE: the homepage SPA is rebuilt automatically by the prebuild:linux npm
|
|
51
60
|
# hook (scripts/build-homepage.cjs) right before `npm run build:linux` below,
|
|
@@ -44,13 +44,22 @@ jobs:
|
|
|
44
44
|
# 装进 node_modules(--force 绕过 EBADPLATFORM),让 electron-builder 两架构都打包,
|
|
45
45
|
# localbin 按用户机器选对应那份。必须在所有 npm install 之后(否则被剪枝)。
|
|
46
46
|
- name: Bundle BOTH macOS arches of cicy-code/mihomo (runner is single-arch)
|
|
47
|
+
shell: bash
|
|
47
48
|
run: |
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
npm
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
49
|
+
set -e
|
|
50
|
+
# `npm install --force` 在已有 lockfile 的项目里会判 "up to date" 跳过非本机架构
|
|
51
|
+
# → 改用 `npm pack`(纯按名下 tarball,不看 os/cpu/lockfile)+ 解压进 node_modules。
|
|
52
|
+
for pkg in cicy-code-darwin-x64 cicy-code-darwin-arm64 cicy-mihomo-darwin-x64 cicy-mihomo-darwin-arm64; do
|
|
53
|
+
ver=$(node -e "const o=require('./package.json').optionalDependencies||{}; process.stdout.write(o['$pkg']||'')")
|
|
54
|
+
[ -z "$ver" ] && { echo "skip $pkg (not pinned)"; continue; }
|
|
55
|
+
bin=cicy-code; case "$pkg" in cicy-mihomo*) bin=mihomo;; esac
|
|
56
|
+
if [ -f "node_modules/$pkg/$bin" ]; then echo "$pkg present (native arch)"; continue; fi
|
|
57
|
+
echo "npm pack $pkg@$ver → node_modules/$pkg"
|
|
58
|
+
tmp=$(mktemp -d); ( cd "$tmp" && npm pack "$pkg@$ver" --silent ); tar -xzf "$tmp"/*.tgz -C "$tmp"
|
|
59
|
+
rm -rf "node_modules/$pkg"; mkdir -p "node_modules/$pkg"; cp -R "$tmp/package/." "node_modules/$pkg/"; rm -rf "$tmp"
|
|
60
|
+
done
|
|
61
|
+
echo "--- bundled darwin subpackages ---"; ls node_modules | grep -E 'cicy-(code|mihomo)-darwin' || true
|
|
62
|
+
for a in x64 arm64; do test -f "node_modules/cicy-code-darwin-$a/cicy-code" || { echo "::error::cicy-code-darwin-$a binary missing"; exit 1; }; done
|
|
54
63
|
|
|
55
64
|
# NOTE: the homepage SPA is rebuilt automatically by the prebuild:mac npm
|
|
56
65
|
# hook (scripts/build-homepage.cjs) right before `npm run build:mac` below,
|