@lobehub/lobehub 2.0.0-next.291 → 2.0.0-next.292
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.
- package/.conductor/setup.sh +107 -0
- package/.cursor/rules/linear.mdc +53 -0
- package/.github/actions/desktop-build-setup/action.yml +29 -0
- package/.github/actions/desktop-upload-artifacts/action.yml +46 -0
- package/.github/workflows/release-desktop-beta.yml +76 -115
- package/.github/workflows/release-desktop-stable.yml +461 -0
- package/CHANGELOG.md +33 -0
- package/CLAUDE.md +2 -48
- package/apps/desktop/dev-app-update.yml +10 -0
- package/apps/desktop/electron-builder.mjs +40 -10
- package/apps/desktop/electron.vite.config.ts +3 -2
- package/apps/desktop/package.json +2 -1
- package/apps/desktop/scripts/update-test/README.md +222 -0
- package/apps/desktop/scripts/update-test/dev-app-update.local.yml +18 -0
- package/apps/desktop/scripts/update-test/generate-manifest.sh +277 -0
- package/apps/desktop/scripts/update-test/run-test.sh +105 -0
- package/apps/desktop/scripts/update-test/setup.sh +111 -0
- package/apps/desktop/scripts/update-test/start-server.sh +70 -0
- package/apps/desktop/scripts/update-test/stop-server.sh +33 -0
- package/apps/desktop/src/main/core/infrastructure/UpdaterManager.ts +120 -9
- package/apps/desktop/src/main/core/infrastructure/__tests__/UpdaterManager.test.ts +17 -1
- package/apps/desktop/src/main/env.ts +19 -11
- package/apps/desktop/src/main/modules/updater/configs.ts +14 -1
- package/changelog/v1.json +9 -0
- package/conductor.json +5 -0
- package/locales/en-US/subscription.json +2 -2
- package/locales/zh-CN/subscription.json +2 -2
- package/package.json +1 -1
- package/packages/builtin-tool-notebook/src/client/Render/CreateDocument/DocumentCard.tsx +16 -14
- package/packages/electron-client-ipc/src/useWatchBroadcast.ts +10 -4
- package/packages/model-bank/src/aiModels/qiniu.ts +6 -6
- package/packages/observability-otel/src/node.ts +39 -37
- package/scripts/electronWorkflow/mergeMacReleaseFiles.js +22 -8
- package/src/app/(backend)/api/version/route.ts +13 -0
- package/src/app/[variants]/(desktop)/desktop-onboarding/_layout/index.tsx +2 -1
- package/src/app/[variants]/(main)/_layout/index.tsx +2 -1
- package/src/app/[variants]/(main)/agent/cron/[cronId]/features/CronJobScheduleConfig.tsx +0 -1
- package/src/app/[variants]/(main)/agent/cron/[cronId]/index.tsx +5 -5
- package/src/app/[variants]/(main)/agent/features/Conversation/ThreadHydration.tsx +3 -1
- package/src/app/[variants]/(main)/group/features/Conversation/ThreadHydration.tsx +3 -1
- package/src/app/[variants]/(main)/settings/provider/features/ProviderConfig/Checker.tsx +3 -3
- package/src/app/[variants]/(mobile)/router/mobileRouter.config.tsx +1 -4
- package/src/app/[variants]/router/desktopRouter.config.tsx +1 -4
- package/src/components/HtmlPreview/PreviewDrawer.tsx +1 -1
- package/src/features/Conversation/Messages/AssistantGroup/components/GroupItem.tsx +12 -2
- package/src/features/Conversation/Messages/Tool/Tool/index.tsx +10 -1
- package/src/features/{ElectronTitlebar/hooks → Electron/navigation}/useNavigationHistory.ts +1 -1
- package/src/features/{ElectronTitlebar/NavigationBar/index.tsx → Electron/titlebar/NavigationBar.tsx} +1 -1
- package/src/features/{ElectronTitlebar/NavigationBar → Electron/titlebar}/RecentlyViewed.tsx +1 -1
- package/src/features/{ElectronTitlebar/index.tsx → Electron/titlebar/TitleBar.tsx} +19 -9
- package/src/features/Electron/titlebar/WinControl.tsx +5 -0
- package/src/features/Electron/updater/UpdateModal.tsx +299 -0
- package/src/features/LibraryModal/AddFilesToKnowledgeBase/index.test.tsx +24 -0
- package/src/features/LibraryModal/AddFilesToKnowledgeBase/index.tsx +21 -24
- package/src/features/LibraryModal/CreateNew/index.tsx +18 -22
- package/src/features/PluginDevModal/index.tsx +1 -1
- package/src/layout/GlobalProvider/AppTheme.tsx +1 -1
- package/src/libs/swr/index.ts +26 -30
- package/src/store/aiInfra/slices/aiProvider/action.ts +16 -17
- package/src/store/chat/slices/portal/action.test.ts +0 -2
- package/src/store/chat/slices/portal/action.ts +17 -44
- package/src/store/chat/slices/thread/action.test.ts +4 -1
- package/src/store/chat/slices/thread/action.ts +6 -1
- package/src/components/FunctionModal/createModalHooks.ts +0 -48
- package/src/components/FunctionModal/index.ts +0 -1
- package/src/components/FunctionModal/style.tsx +0 -44
- package/src/features/ElectronTitlebar/UpdateModal.tsx +0 -274
- package/src/features/ElectronTitlebar/WinControl/index.tsx +0 -90
- /package/src/features/{ElectronTitlebar/Connection/index.tsx → Electron/connection/Connection.tsx} +0 -0
- /package/src/features/{ElectronTitlebar/Connection → Electron/connection}/ConnectionMode.tsx +0 -0
- /package/src/features/{ElectronTitlebar/Connection → Electron/connection}/Option.tsx +0 -0
- /package/src/features/{ElectronTitlebar/Connection → Electron/connection}/RemoteStatus.tsx +0 -0
- /package/src/features/{ElectronTitlebar/Connection → Electron/connection}/Waiting.tsx +0 -0
- /package/src/features/{ElectronTitlebar/Connection → Electron/connection}/WaitingAnim.tsx +0 -0
- /package/src/features/{ElectronTitlebar/helpers → Electron/navigation}/routeMetadata.ts +0 -0
- /package/src/features/{ElectronTitlebar/hooks → Electron/system}/useWatchThemeUpdate.ts +0 -0
- /package/src/features/{ElectronTitlebar → Electron/titlebar}/SimpleTitleBar.tsx +0 -0
- /package/src/features/{ElectronTitlebar → Electron/updater}/UpdateNotification.tsx +0 -0
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
|
|
3
|
+
# Conductor workspace setup script
|
|
4
|
+
# This script creates symlinks for .env and all node_modules directories
|
|
5
|
+
|
|
6
|
+
LOG_FILE="$PWD/.conductor-setup.log"
|
|
7
|
+
|
|
8
|
+
log() {
|
|
9
|
+
local timestamp=$(date '+%Y-%m-%d %H:%M:%S')
|
|
10
|
+
echo "[$timestamp] $1" | tee -a "$LOG_FILE"
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
log "=========================================="
|
|
14
|
+
log "Conductor Setup Script Started"
|
|
15
|
+
log "=========================================="
|
|
16
|
+
log "CONDUCTOR_ROOT_PATH: $CONDUCTOR_ROOT_PATH"
|
|
17
|
+
log "Current working directory: $PWD"
|
|
18
|
+
log ""
|
|
19
|
+
|
|
20
|
+
# Check if CONDUCTOR_ROOT_PATH is set
|
|
21
|
+
if [ -z "$CONDUCTOR_ROOT_PATH" ]; then
|
|
22
|
+
log "ERROR: CONDUCTOR_ROOT_PATH is not set!"
|
|
23
|
+
exit 1
|
|
24
|
+
fi
|
|
25
|
+
|
|
26
|
+
# Symlink .env file
|
|
27
|
+
log "--- Symlinking .env file ---"
|
|
28
|
+
if [ -f "$CONDUCTOR_ROOT_PATH/.env" ]; then
|
|
29
|
+
ln -sf "$CONDUCTOR_ROOT_PATH/.env" .env
|
|
30
|
+
if [ -L ".env" ]; then
|
|
31
|
+
log "SUCCESS: .env symlinked -> $(readlink .env)"
|
|
32
|
+
else
|
|
33
|
+
log "ERROR: Failed to create .env symlink"
|
|
34
|
+
fi
|
|
35
|
+
else
|
|
36
|
+
log "WARNING: $CONDUCTOR_ROOT_PATH/.env does not exist, skipping"
|
|
37
|
+
fi
|
|
38
|
+
|
|
39
|
+
log ""
|
|
40
|
+
log "--- Finding node_modules directories ---"
|
|
41
|
+
|
|
42
|
+
# Find all node_modules directories (excluding .pnpm internal and .next build cache)
|
|
43
|
+
# NODE_MODULES_DIRS=$(find "$CONDUCTOR_ROOT_PATH" -maxdepth 3 -name "node_modules" -type d 2>/dev/null | grep -v ".pnpm" | grep -v ".next")
|
|
44
|
+
|
|
45
|
+
# log "Found node_modules directories:"
|
|
46
|
+
# echo "$NODE_MODULES_DIRS" >> "$LOG_FILE"
|
|
47
|
+
|
|
48
|
+
# log ""
|
|
49
|
+
# log "--- Creating node_modules symlinks ---"
|
|
50
|
+
|
|
51
|
+
# # Counter for statistics
|
|
52
|
+
# total=0
|
|
53
|
+
# success=0
|
|
54
|
+
# failed=0
|
|
55
|
+
|
|
56
|
+
# for dir in $NODE_MODULES_DIRS; do
|
|
57
|
+
# total=$((total + 1))
|
|
58
|
+
|
|
59
|
+
# # Get relative path by removing CONDUCTOR_ROOT_PATH prefix
|
|
60
|
+
# rel_path="${dir#$CONDUCTOR_ROOT_PATH/}"
|
|
61
|
+
# parent_dir=$(dirname "$rel_path")
|
|
62
|
+
|
|
63
|
+
# log "Processing: $rel_path"
|
|
64
|
+
# log " Source: $dir"
|
|
65
|
+
# log " Parent dir: $parent_dir"
|
|
66
|
+
|
|
67
|
+
# # Create parent directory if needed
|
|
68
|
+
# if [ "$parent_dir" != "." ]; then
|
|
69
|
+
# if [ ! -d "$parent_dir" ]; then
|
|
70
|
+
# mkdir -p "$parent_dir"
|
|
71
|
+
# log " Created parent directory: $parent_dir"
|
|
72
|
+
# fi
|
|
73
|
+
# fi
|
|
74
|
+
|
|
75
|
+
# # Create symlink
|
|
76
|
+
# ln -sf "$dir" "$rel_path"
|
|
77
|
+
|
|
78
|
+
# # Verify symlink was created
|
|
79
|
+
# if [ -L "$rel_path" ]; then
|
|
80
|
+
# log " SUCCESS: $rel_path -> $(readlink "$rel_path")"
|
|
81
|
+
# success=$((success + 1))
|
|
82
|
+
# else
|
|
83
|
+
# log " ERROR: Failed to create symlink for $rel_path"
|
|
84
|
+
# failed=$((failed + 1))
|
|
85
|
+
# fi
|
|
86
|
+
|
|
87
|
+
# log ""
|
|
88
|
+
# done
|
|
89
|
+
|
|
90
|
+
log "=========================================="
|
|
91
|
+
log "Setup Complete"
|
|
92
|
+
log "=========================================="
|
|
93
|
+
log "Total node_modules: $total"
|
|
94
|
+
log "Successful symlinks: $success"
|
|
95
|
+
log "Failed symlinks: $failed"
|
|
96
|
+
log ""
|
|
97
|
+
|
|
98
|
+
# List created symlinks for verification
|
|
99
|
+
log "--- Verification: Listing symlinks in workspace ---"
|
|
100
|
+
find . -maxdepth 1 -type l -exec ls -la {} \; 2>/dev/null >> "$LOG_FILE"
|
|
101
|
+
find ./packages -maxdepth 2 -type l -name "node_modules" -exec ls -la {} \; 2>/dev/null >> "$LOG_FILE"
|
|
102
|
+
find ./apps -maxdepth 2 -type l -name "node_modules" -exec ls -la {} \; 2>/dev/null >> "$LOG_FILE"
|
|
103
|
+
find ./e2e -maxdepth 2 -type l -name "node_modules" -exec ls -la {} \; 2>/dev/null >> "$LOG_FILE"
|
|
104
|
+
|
|
105
|
+
log ""
|
|
106
|
+
log "Log file saved to: $LOG_FILE"
|
|
107
|
+
log "Setup script finished."
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
---
|
|
2
|
+
alwaysApply: true
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Linear Issue Management
|
|
6
|
+
|
|
7
|
+
When working with Linear issues:
|
|
8
|
+
|
|
9
|
+
1. **Retrieve issue details** before starting work using `mcp__linear-server__get_issue`
|
|
10
|
+
2. **Check for sub-issues**: If the issue has sub-issues, retrieve and review ALL sub-issues using `mcp__linear-server__list_issues` with `parentId` filter before starting work
|
|
11
|
+
3. **Update issue status** when completing tasks using `mcp__linear-server__update_issue`
|
|
12
|
+
4. **MUST add completion comment** using `mcp__linear-server__create_comment`
|
|
13
|
+
|
|
14
|
+
## Creating Issues
|
|
15
|
+
|
|
16
|
+
When creating new Linear issues using `mcp__linear-server__create_issue`, **MUST add the `claude code` label** to indicate the issue was created by Claude Code.
|
|
17
|
+
|
|
18
|
+
## Completion Comment (REQUIRED)
|
|
19
|
+
|
|
20
|
+
**Every time you complete an issue, you MUST add a comment summarizing the work done.** This is critical for:
|
|
21
|
+
|
|
22
|
+
- Team visibility and knowledge sharing
|
|
23
|
+
- Code review context
|
|
24
|
+
- Future reference and debugging
|
|
25
|
+
|
|
26
|
+
## PR Linear Issue Association (REQUIRED)
|
|
27
|
+
|
|
28
|
+
**When creating PRs for Linear issues, MUST include magic keywords in PR body:** `Fixes LOBE-123`, `Closes LOBE-123`, or `Resolves LOBE-123`, and summarize the work done in the linear issue comment and update the issue status to "In Review".
|
|
29
|
+
|
|
30
|
+
## IMPORTANT: Per-Issue Completion Rule
|
|
31
|
+
|
|
32
|
+
**When working on multiple issues (e.g., parent issue with sub-issues), you MUST update status and add comment for EACH issue IMMEDIATELY after completing it.** Do NOT wait until all issues are done to update them in batch.
|
|
33
|
+
|
|
34
|
+
**Workflow for EACH individual issue:**
|
|
35
|
+
|
|
36
|
+
1. Complete the implementation for this specific issue
|
|
37
|
+
2. Run type check: `bun run type-check`
|
|
38
|
+
3. Run related tests if applicable
|
|
39
|
+
4. Create PR if needed
|
|
40
|
+
5. **IMMEDIATELY** update issue status to **"In Review"** (NOT "Done"): `mcp__linear-server__update_issue`
|
|
41
|
+
6. **IMMEDIATELY** add completion comment: `mcp__linear-server__create_comment`
|
|
42
|
+
7. Only then move on to the next issue
|
|
43
|
+
|
|
44
|
+
**Note:** Issue status should be set to **"In Review"** when PR is created. The status will be updated to **"Done"** only after the PR is merged (usually handled by Linear-GitHub integration or manually).
|
|
45
|
+
|
|
46
|
+
**❌ Wrong approach:**
|
|
47
|
+
|
|
48
|
+
- Complete Issue A → Complete Issue B → Complete Issue C → Update all statuses → Add all comments
|
|
49
|
+
- Mark issue as "Done" immediately after creating PR
|
|
50
|
+
|
|
51
|
+
**✅ Correct approach:**
|
|
52
|
+
|
|
53
|
+
- Complete Issue A → Create PR → Update A status to "In Review" → Add A comment → Complete Issue B → ...
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
name: Desktop Build Setup
|
|
2
|
+
description: Setup Node.js, pnpm and install dependencies for desktop build
|
|
3
|
+
|
|
4
|
+
inputs:
|
|
5
|
+
node-version:
|
|
6
|
+
description: Node.js version
|
|
7
|
+
required: true
|
|
8
|
+
|
|
9
|
+
runs:
|
|
10
|
+
using: composite
|
|
11
|
+
steps:
|
|
12
|
+
- name: Install pnpm
|
|
13
|
+
uses: pnpm/action-setup@v4
|
|
14
|
+
with:
|
|
15
|
+
run_install: false
|
|
16
|
+
|
|
17
|
+
- name: Setup Node.js
|
|
18
|
+
uses: actions/setup-node@v6
|
|
19
|
+
with:
|
|
20
|
+
node-version: ${{ inputs.node-version }}
|
|
21
|
+
package-manager-cache: false
|
|
22
|
+
|
|
23
|
+
- name: Install dependencies
|
|
24
|
+
shell: bash
|
|
25
|
+
run: pnpm install --node-linker=hoisted
|
|
26
|
+
|
|
27
|
+
- name: Install deps on Desktop
|
|
28
|
+
shell: bash
|
|
29
|
+
run: npm run install-isolated --prefix=./apps/desktop
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
name: Desktop Upload Artifacts
|
|
2
|
+
description: Rename macOS yml for multi-arch and upload build artifacts
|
|
3
|
+
|
|
4
|
+
inputs:
|
|
5
|
+
artifact-name:
|
|
6
|
+
description: Name for the uploaded artifact
|
|
7
|
+
required: true
|
|
8
|
+
retention-days:
|
|
9
|
+
description: Number of days to retain artifacts
|
|
10
|
+
required: false
|
|
11
|
+
default: '5'
|
|
12
|
+
|
|
13
|
+
runs:
|
|
14
|
+
using: composite
|
|
15
|
+
steps:
|
|
16
|
+
- name: Rename macOS latest-mac.yml for multi-architecture support
|
|
17
|
+
if: runner.os == 'macOS'
|
|
18
|
+
shell: bash
|
|
19
|
+
run: |
|
|
20
|
+
cd apps/desktop/release
|
|
21
|
+
if [ -f "latest-mac.yml" ]; then
|
|
22
|
+
SYSTEM_ARCH=$(uname -m)
|
|
23
|
+
if [[ "$SYSTEM_ARCH" == "arm64" ]]; then
|
|
24
|
+
ARCH_SUFFIX="arm64"
|
|
25
|
+
else
|
|
26
|
+
ARCH_SUFFIX="x64"
|
|
27
|
+
fi
|
|
28
|
+
mv latest-mac.yml "latest-mac-${ARCH_SUFFIX}.yml"
|
|
29
|
+
echo "✅ Renamed latest-mac.yml to latest-mac-${ARCH_SUFFIX}.yml"
|
|
30
|
+
fi
|
|
31
|
+
|
|
32
|
+
- name: Upload artifact
|
|
33
|
+
uses: actions/upload-artifact@v6
|
|
34
|
+
with:
|
|
35
|
+
name: ${{ inputs.artifact-name }}
|
|
36
|
+
path: |
|
|
37
|
+
apps/desktop/release/latest*
|
|
38
|
+
apps/desktop/release/*.dmg*
|
|
39
|
+
apps/desktop/release/*.zip*
|
|
40
|
+
apps/desktop/release/*.exe*
|
|
41
|
+
apps/desktop/release/*.AppImage
|
|
42
|
+
apps/desktop/release/*.deb*
|
|
43
|
+
apps/desktop/release/*.snap*
|
|
44
|
+
apps/desktop/release/*.rpm*
|
|
45
|
+
apps/desktop/release/*.tar.gz*
|
|
46
|
+
retention-days: ${{ inputs.retention-days }}
|
|
@@ -1,22 +1,59 @@
|
|
|
1
1
|
name: Release Desktop Beta
|
|
2
2
|
|
|
3
|
+
# ============================================
|
|
4
|
+
# Beta/Nightly 频道发版工作流
|
|
5
|
+
# ============================================
|
|
6
|
+
# 触发条件: 发布包含 pre-release 标识的 release
|
|
7
|
+
# 如: v2.0.0-beta.1, v2.0.0-alpha.1, v2.0.0-rc.1, v2.0.0-nightly.xxx
|
|
8
|
+
#
|
|
9
|
+
# 注意: Stable 版本 (如 v2.0.0) 由 release-desktop-stable.yml 处理
|
|
10
|
+
# ============================================
|
|
11
|
+
|
|
3
12
|
on:
|
|
4
13
|
release:
|
|
5
|
-
types: [published]
|
|
14
|
+
types: [published]
|
|
6
15
|
|
|
7
|
-
# 确保同一时间只运行一个相同的 workflow,取消正在进行的旧的运行
|
|
8
16
|
concurrency:
|
|
9
17
|
group: ${{ github.ref }}-${{ github.workflow }}
|
|
10
18
|
cancel-in-progress: true
|
|
11
19
|
|
|
12
|
-
# Add default permissions
|
|
13
20
|
permissions: read-all
|
|
14
21
|
|
|
22
|
+
env:
|
|
23
|
+
NODE_VERSION: '24.11.1'
|
|
24
|
+
|
|
15
25
|
jobs:
|
|
26
|
+
# ============================================
|
|
27
|
+
# 检查是否为 Beta/Nightly 版本 (排除 Stable)
|
|
28
|
+
# ============================================
|
|
29
|
+
check-beta:
|
|
30
|
+
name: Check if Beta/Nightly Release
|
|
31
|
+
runs-on: ubuntu-latest
|
|
32
|
+
outputs:
|
|
33
|
+
is_beta: ${{ steps.check.outputs.is_beta }}
|
|
34
|
+
version: ${{ steps.check.outputs.version }}
|
|
35
|
+
steps:
|
|
36
|
+
- name: Check release tag
|
|
37
|
+
id: check
|
|
38
|
+
run: |
|
|
39
|
+
version="${{ github.event.release.tag_name }}"
|
|
40
|
+
version="${version#v}"
|
|
41
|
+
echo "version=${version}" >> $GITHUB_OUTPUT
|
|
42
|
+
|
|
43
|
+
# Beta/Nightly 版本包含 beta/alpha/rc/nightly
|
|
44
|
+
if [[ "$version" == *"beta"* ]] || [[ "$version" == *"alpha"* ]] || [[ "$version" == *"rc"* ]] || [[ "$version" == *"nightly"* ]]; then
|
|
45
|
+
echo "is_beta=true" >> $GITHUB_OUTPUT
|
|
46
|
+
echo "✅ Beta/Nightly release detected: $version"
|
|
47
|
+
else
|
|
48
|
+
echo "is_beta=false" >> $GITHUB_OUTPUT
|
|
49
|
+
echo "⏭️ Skipping: $version is a stable release (handled by release-desktop-stable.yml)"
|
|
50
|
+
fi
|
|
51
|
+
|
|
16
52
|
test:
|
|
17
53
|
name: Code quality check
|
|
18
|
-
|
|
19
|
-
|
|
54
|
+
needs: [check-beta]
|
|
55
|
+
if: needs.check-beta.outputs.is_beta == 'true'
|
|
56
|
+
runs-on: ubuntu-latest
|
|
20
57
|
steps:
|
|
21
58
|
- name: Checkout base
|
|
22
59
|
uses: actions/checkout@v6
|
|
@@ -26,7 +63,7 @@ jobs:
|
|
|
26
63
|
- name: Setup Node.js
|
|
27
64
|
uses: actions/setup-node@v6
|
|
28
65
|
with:
|
|
29
|
-
node-version:
|
|
66
|
+
node-version: ${{ env.NODE_VERSION }}
|
|
30
67
|
package-manager-cache: false
|
|
31
68
|
|
|
32
69
|
- name: Install bun
|
|
@@ -40,44 +77,9 @@ jobs:
|
|
|
40
77
|
- name: Lint
|
|
41
78
|
run: bun run lint
|
|
42
79
|
|
|
43
|
-
version:
|
|
44
|
-
name: Determine version
|
|
45
|
-
runs-on: ubuntu-latest
|
|
46
|
-
outputs:
|
|
47
|
-
# 输出版本信息,供后续 job 使用
|
|
48
|
-
version: ${{ steps.set_version.outputs.version }}
|
|
49
|
-
is_pr_build: ${{ steps.set_version.outputs.is_pr_build }}
|
|
50
|
-
steps:
|
|
51
|
-
- uses: actions/checkout@v6
|
|
52
|
-
with:
|
|
53
|
-
fetch-depth: 0
|
|
54
|
-
|
|
55
|
-
- name: Setup Node.js
|
|
56
|
-
uses: actions/setup-node@v6
|
|
57
|
-
with:
|
|
58
|
-
node-version: 24.11.1
|
|
59
|
-
package-manager-cache: false
|
|
60
|
-
|
|
61
|
-
# 主要逻辑:确定构建版本号
|
|
62
|
-
- name: Set version
|
|
63
|
-
id: set_version
|
|
64
|
-
run: |
|
|
65
|
-
# 从 apps/desktop/package.json 读取基础版本号
|
|
66
|
-
base_version=$(node -p "require('./apps/desktop/package.json').version")
|
|
67
|
-
|
|
68
|
-
# Release 事件直接使用 release tag 作为版本号,去掉可能的 v 前缀
|
|
69
|
-
version="${{ github.event.release.tag_name }}"
|
|
70
|
-
version="${version#v}"
|
|
71
|
-
echo "version=${version}" >> $GITHUB_OUTPUT
|
|
72
|
-
echo "📦 Release Version: ${version}"
|
|
73
|
-
|
|
74
|
-
# 输出版本信息总结,方便在 GitHub Actions 界面查看
|
|
75
|
-
- name: Version Summary
|
|
76
|
-
run: |
|
|
77
|
-
echo "🚦 Release Version: ${{ steps.set_version.outputs.version }}"
|
|
78
|
-
|
|
79
80
|
build:
|
|
80
|
-
needs: [
|
|
81
|
+
needs: [check-beta]
|
|
82
|
+
if: needs.check-beta.outputs.is_beta == 'true'
|
|
81
83
|
name: Build Desktop App
|
|
82
84
|
runs-on: ${{ matrix.os }}
|
|
83
85
|
strategy:
|
|
@@ -88,117 +90,76 @@ jobs:
|
|
|
88
90
|
with:
|
|
89
91
|
fetch-depth: 0
|
|
90
92
|
|
|
91
|
-
- name:
|
|
92
|
-
uses:
|
|
93
|
+
- name: Setup build environment
|
|
94
|
+
uses: ./.github/actions/desktop-build-setup
|
|
93
95
|
with:
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
- name: Setup Node.js
|
|
97
|
-
uses: actions/setup-node@v6
|
|
98
|
-
with:
|
|
99
|
-
node-version: 24.11.1
|
|
100
|
-
package-manager-cache: false
|
|
101
|
-
|
|
102
|
-
# node-linker=hoisted 模式将可以确保 asar 压缩可用
|
|
103
|
-
- name: Install dependencies
|
|
104
|
-
run: pnpm install --node-linker=hoisted
|
|
96
|
+
node-version: ${{ env.NODE_VERSION }}
|
|
105
97
|
|
|
106
|
-
- name: Install deps on Desktop
|
|
107
|
-
run: npm run install-isolated --prefix=./apps/desktop
|
|
108
|
-
|
|
109
|
-
# 设置 package.json 的版本号
|
|
110
98
|
- name: Set package version
|
|
111
|
-
run: npm run workflow:set-desktop-version ${{ needs.
|
|
99
|
+
run: npm run workflow:set-desktop-version ${{ needs.check-beta.outputs.version }} beta
|
|
112
100
|
|
|
113
|
-
# macOS
|
|
101
|
+
# macOS 构建
|
|
114
102
|
- name: Build artifact on macOS
|
|
115
103
|
if: runner.os == 'macOS'
|
|
116
104
|
run: npm run desktop:build
|
|
117
105
|
env:
|
|
106
|
+
UPDATE_CHANNEL: beta
|
|
118
107
|
APP_URL: http://localhost:3015
|
|
119
|
-
DATABASE_URL:
|
|
120
|
-
|
|
121
|
-
KEY_VAULTS_SECRET: "oLXWIiR/AKF+rWaqy9lHkrYgzpATbW3CtJp3UfkVgpE="
|
|
122
|
-
# macOS 签名和公证配置
|
|
108
|
+
DATABASE_URL: 'postgresql://postgres@localhost:5432/postgres'
|
|
109
|
+
KEY_VAULTS_SECRET: 'oLXWIiR/AKF+rWaqy9lHkrYgzpATbW3CtJp3UfkVgpE='
|
|
123
110
|
CSC_LINK: ${{ secrets.APPLE_CERTIFICATE_BASE64 }}
|
|
124
111
|
CSC_KEY_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
|
|
125
|
-
# allow provisionally
|
|
126
112
|
CSC_FOR_PULL_REQUEST: true
|
|
127
113
|
APPLE_ID: ${{ secrets.APPLE_ID }}
|
|
128
114
|
APPLE_APP_SPECIFIC_PASSWORD: ${{ secrets.APPLE_APP_SPECIFIC_PASSWORD }}
|
|
129
115
|
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
|
|
130
|
-
|
|
131
116
|
NEXT_PUBLIC_DESKTOP_PROJECT_ID: ${{ secrets.UMAMI_BETA_DESKTOP_PROJECT_ID }}
|
|
132
117
|
NEXT_PUBLIC_DESKTOP_UMAMI_BASE_URL: ${{ secrets.UMAMI_BETA_DESKTOP_BASE_URL }}
|
|
133
118
|
|
|
134
|
-
#
|
|
119
|
+
# Windows 构建
|
|
135
120
|
- name: Build artifact on Windows
|
|
136
121
|
if: runner.os == 'Windows'
|
|
137
122
|
run: npm run desktop:build
|
|
138
123
|
env:
|
|
124
|
+
UPDATE_CHANNEL: beta
|
|
139
125
|
APP_URL: http://localhost:3015
|
|
140
|
-
DATABASE_URL:
|
|
141
|
-
KEY_VAULTS_SECRET:
|
|
126
|
+
DATABASE_URL: 'postgresql://postgres@localhost:5432/postgres'
|
|
127
|
+
KEY_VAULTS_SECRET: 'oLXWIiR/AKF+rWaqy9lHkrYgzpATbW3CtJp3UfkVgpE='
|
|
142
128
|
NEXT_PUBLIC_DESKTOP_PROJECT_ID: ${{ secrets.UMAMI_BETA_DESKTOP_PROJECT_ID }}
|
|
143
129
|
NEXT_PUBLIC_DESKTOP_UMAMI_BASE_URL: ${{ secrets.UMAMI_BETA_DESKTOP_BASE_URL }}
|
|
144
|
-
|
|
145
|
-
# 将 TEMP 和 TMP 目录设置到 C 盘
|
|
146
130
|
TEMP: C:\temp
|
|
147
131
|
TMP: C:\temp
|
|
148
132
|
|
|
149
|
-
# Linux
|
|
133
|
+
# Linux 构建
|
|
150
134
|
- name: Build artifact on Linux
|
|
151
135
|
if: runner.os == 'Linux'
|
|
152
136
|
run: npm run desktop:build
|
|
153
137
|
env:
|
|
138
|
+
UPDATE_CHANNEL: beta
|
|
154
139
|
APP_URL: http://localhost:3015
|
|
155
|
-
DATABASE_URL:
|
|
156
|
-
KEY_VAULTS_SECRET:
|
|
140
|
+
DATABASE_URL: 'postgresql://postgres@localhost:5432/postgres'
|
|
141
|
+
KEY_VAULTS_SECRET: 'oLXWIiR/AKF+rWaqy9lHkrYgzpATbW3CtJp3UfkVgpE='
|
|
157
142
|
NEXT_PUBLIC_DESKTOP_PROJECT_ID: ${{ secrets.UMAMI_BETA_DESKTOP_PROJECT_ID }}
|
|
158
143
|
NEXT_PUBLIC_DESKTOP_UMAMI_BASE_URL: ${{ secrets.UMAMI_BETA_DESKTOP_BASE_URL }}
|
|
159
144
|
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
if: runner.os == 'macOS'
|
|
163
|
-
run: |
|
|
164
|
-
cd apps/desktop/release
|
|
165
|
-
if [ -f "latest-mac.yml" ]; then
|
|
166
|
-
# 使用系统架构检测,与 electron-builder 输出保持一致
|
|
167
|
-
SYSTEM_ARCH=$(uname -m)
|
|
168
|
-
if [[ "$SYSTEM_ARCH" == "arm64" ]]; then
|
|
169
|
-
ARCH_SUFFIX="arm64"
|
|
170
|
-
else
|
|
171
|
-
ARCH_SUFFIX="x64"
|
|
172
|
-
fi
|
|
173
|
-
|
|
174
|
-
mv latest-mac.yml "latest-mac-${ARCH_SUFFIX}.yml"
|
|
175
|
-
echo "✅ Renamed latest-mac.yml to latest-mac-${ARCH_SUFFIX}.yml (detected: $SYSTEM_ARCH)"
|
|
176
|
-
ls -la latest-mac-*.yml
|
|
177
|
-
else
|
|
178
|
-
echo "⚠️ latest-mac.yml not found, skipping rename"
|
|
179
|
-
ls -la latest*.yml || echo "No latest*.yml files found"
|
|
180
|
-
fi
|
|
181
|
-
|
|
182
|
-
# 上传构建产物 (工作流处理重命名,不依赖 electron-builder 钩子)
|
|
183
|
-
- name: Upload artifact
|
|
184
|
-
uses: actions/upload-artifact@v6
|
|
145
|
+
- name: Upload artifacts
|
|
146
|
+
uses: ./.github/actions/desktop-upload-artifacts
|
|
185
147
|
with:
|
|
186
|
-
name: release-${{ matrix.os }}
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
retention-days: 5
|
|
148
|
+
artifact-name: release-${{ matrix.os }}
|
|
149
|
+
|
|
150
|
+
# 汇总门禁: test/build 完成后决定是否继续
|
|
151
|
+
gate:
|
|
152
|
+
needs: [check-beta, test, build]
|
|
153
|
+
if: ${{ needs.check-beta.outputs.is_beta == 'true' && needs.test.result == 'success' && needs.build.result == 'success' }}
|
|
154
|
+
name: Gate for publish
|
|
155
|
+
runs-on: ubuntu-latest
|
|
156
|
+
steps:
|
|
157
|
+
- name: Gate passed
|
|
158
|
+
run: echo "Gate passed"
|
|
198
159
|
|
|
199
160
|
# 合并 macOS 多架构 latest-mac.yml 文件
|
|
200
161
|
merge-mac-files:
|
|
201
|
-
needs: [
|
|
162
|
+
needs: [gate]
|
|
202
163
|
name: Merge macOS Release Files
|
|
203
164
|
runs-on: ubuntu-latest
|
|
204
165
|
permissions:
|
|
@@ -210,7 +171,7 @@ jobs:
|
|
|
210
171
|
- name: Setup Node.js
|
|
211
172
|
uses: actions/setup-node@v6
|
|
212
173
|
with:
|
|
213
|
-
node-version:
|
|
174
|
+
node-version: ${{ env.NODE_VERSION }}
|
|
214
175
|
package-manager-cache: false
|
|
215
176
|
|
|
216
177
|
- name: Install bun
|