Skip to content

Commit 9c691b2

Browse files
authored
chore: remove Electron desktop pipeline and switch to tauri repo (#5226)
* ci: remove Electron desktop build from release pipeline * chore: remove electron desktop and switch to tauri release trigger * ci: remove desktop workflow dispatch trigger * refactor: migrate data paths to astrbot_path helpers * fix: point desktop update prompt to AstrBot-desktop releases
1 parent 3597726 commit 9c691b2

33 files changed

Lines changed: 45 additions & 4969 deletions

.github/workflows/release.yml

Lines changed: 0 additions & 165 deletions
Original file line numberDiff line numberDiff line change
@@ -102,170 +102,11 @@ jobs:
102102
cp "dashboard/AstrBot-${VERSION_TAG}-dashboard.zip" "dashboard/astrbot-webui-${VERSION_TAG}.zip"
103103
rclone copy "dashboard/astrbot-webui-${VERSION_TAG}.zip" "r2:${R2_BUCKET_NAME}" --progress
104104
105-
build-desktop:
106-
name: Build ${{ matrix.name }}
107-
runs-on: ${{ matrix.runner }}
108-
strategy:
109-
fail-fast: false
110-
matrix:
111-
include:
112-
- name: linux-x64
113-
runner: ubuntu-24.04
114-
os: linux
115-
arch: amd64
116-
- name: linux-arm64
117-
runner: ubuntu-24.04-arm
118-
os: linux
119-
arch: arm64
120-
- name: windows-x64
121-
runner: windows-2022
122-
os: win
123-
arch: amd64
124-
- name: windows-arm64
125-
runner: windows-11-arm
126-
os: win
127-
arch: arm64
128-
- name: macos-x64
129-
runner: macos-15-intel
130-
os: mac
131-
arch: amd64
132-
- name: macos-arm64
133-
runner: macos-15
134-
os: mac
135-
arch: arm64
136-
env:
137-
CSC_IDENTITY_AUTO_DISCOVERY: "false"
138-
steps:
139-
- name: Checkout repository
140-
uses: actions/checkout@v6
141-
with:
142-
fetch-depth: 0
143-
ref: ${{ inputs.ref || github.ref }}
144-
145-
- name: Resolve tag
146-
id: tag
147-
shell: bash
148-
run: |
149-
if [ "${{ github.event_name }}" = "push" ]; then
150-
tag="${GITHUB_REF_NAME}"
151-
elif [ -n "${{ inputs.tag }}" ]; then
152-
tag="${{ inputs.tag }}"
153-
else
154-
tag="$(git describe --tags --abbrev=0)"
155-
fi
156-
if [ -z "$tag" ]; then
157-
echo "Failed to resolve tag." >&2
158-
exit 1
159-
fi
160-
echo "tag=$tag" >> "$GITHUB_OUTPUT"
161-
162-
- name: Setup uv
163-
uses: astral-sh/setup-uv@v7
164-
165-
- name: Setup Python
166-
uses: actions/setup-python@v6
167-
with:
168-
python-version: "3.12"
169-
170-
- name: Setup pnpm
171-
uses: pnpm/action-setup@v4
172-
with:
173-
version: 10.28.2
174-
175-
- name: Setup Node.js
176-
uses: actions/setup-node@v6
177-
with:
178-
node-version: '24.13.0'
179-
cache: "pnpm"
180-
cache-dependency-path: |
181-
dashboard/pnpm-lock.yaml
182-
desktop/pnpm-lock.yaml
183-
184-
- name: Prepare OpenSSL for Windows ARM64
185-
if: ${{ matrix.os == 'win' && matrix.arch == 'arm64' }}
186-
shell: pwsh
187-
run: |
188-
git clone https://github.com/microsoft/vcpkg.git C:\vcpkg
189-
& C:\vcpkg\bootstrap-vcpkg.bat -disableMetrics
190-
& C:\vcpkg\vcpkg.exe install openssl:arm64-windows
191-
192-
"VCPKG_ROOT=C:\vcpkg" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
193-
"VCPKGRS_TRIPLET=arm64-windows" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
194-
"OPENSSL_DIR=C:\vcpkg\installed\arm64-windows" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
195-
"OPENSSL_ROOT_DIR=C:\vcpkg\installed\arm64-windows" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
196-
"OPENSSL_LIB_DIR=C:\vcpkg\installed\arm64-windows\lib" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
197-
"OPENSSL_INCLUDE_DIR=C:\vcpkg\installed\arm64-windows\include" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
198-
199-
- name: Install dependencies
200-
shell: bash
201-
run: |
202-
uv sync
203-
pnpm --dir dashboard install --frozen-lockfile
204-
pnpm --dir desktop install --frozen-lockfile
205-
206-
- name: Build desktop package
207-
shell: bash
208-
run: |
209-
pnpm --dir dashboard run build
210-
pnpm --dir desktop run build:webui
211-
pnpm --dir desktop run build:backend
212-
pnpm --dir desktop run sync:version
213-
pnpm --dir desktop exec electron-builder --publish never
214-
215-
- name: Normalize artifact names
216-
shell: bash
217-
env:
218-
NAME_PREFIX: AstrBot-${{ steps.tag.outputs.tag }}-${{ matrix.arch }}-${{ matrix.os }}
219-
run: |
220-
shopt -s nullglob
221-
out_dir="desktop/dist/release"
222-
mkdir -p "$out_dir"
223-
files=(
224-
desktop/dist/*.AppImage
225-
desktop/dist/*.dmg
226-
desktop/dist/*.zip
227-
desktop/dist/*.exe
228-
)
229-
if [ ${#files[@]} -eq 0 ]; then
230-
echo "No desktop artifacts found to rename." >&2
231-
exit 1
232-
fi
233-
for src in "${files[@]}"; do
234-
file="$(basename "$src")"
235-
case "$file" in
236-
*.AppImage)
237-
dest="$out_dir/${NAME_PREFIX}.AppImage"
238-
;;
239-
*.dmg)
240-
dest="$out_dir/${NAME_PREFIX}.dmg"
241-
;;
242-
*.exe)
243-
dest="$out_dir/${NAME_PREFIX}.exe"
244-
;;
245-
*.zip)
246-
dest="$out_dir/${NAME_PREFIX}.zip"
247-
;;
248-
*)
249-
continue
250-
;;
251-
esac
252-
cp "$src" "$dest"
253-
done
254-
ls -la "$out_dir"
255-
256-
- name: Upload desktop artifacts
257-
uses: actions/upload-artifact@v6
258-
with:
259-
name: AstrBot-${{ steps.tag.outputs.tag }}-${{ matrix.arch }}-${{ matrix.os }}
260-
if-no-files-found: error
261-
path: desktop/dist/release/*
262-
263105
publish-release:
264106
name: Publish GitHub Release
265107
runs-on: ubuntu-24.04
266108
needs:
267109
- build-dashboard
268-
- build-desktop
269110
steps:
270111
- name: Checkout repository
271112
uses: actions/checkout@v6
@@ -296,12 +137,6 @@ jobs:
296137
name: Dashboard-${{ steps.tag.outputs.tag }}
297138
path: release-assets
298139

299-
- name: Download desktop artifacts
300-
uses: actions/download-artifact@v7
301-
with:
302-
pattern: AstrBot-${{ steps.tag.outputs.tag }}-*
303-
path: release-assets
304-
merge-multiple: true
305140

306141
- name: Resolve release notes
307142
id: notes

.gitignore

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,6 @@ tests/astrbot_plugin_openai
3333
dashboard/node_modules/
3434
dashboard/dist/
3535
.pnpm-store/
36-
desktop/node_modules/
37-
desktop/dist/
38-
desktop/out/
39-
desktop/resources/backend/astrbot-backend*
40-
desktop/resources/backend/*.exe
41-
desktop/resources/webui/*
42-
desktop/resources/.pyinstaller/
4336
package-lock.json
4437
yarn.lock
4538

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,9 +146,9 @@ yay -S astrbot-git
146146
paru -S astrbot-git
147147
```
148148

149-
#### 桌面端 Electron 打包
149+
#### 桌面端(Tauri)
150150

151-
桌面端(Electron 打包,`pnpm` 工作流)构建流程请参阅:[`desktop/README.md`](desktop/README.md)
151+
桌面端已迁移为独立仓库(Tauri):[https://github.com/AstrBotDevs/AstrBot-desktop](https://github.com/AstrBotDevs/AstrBot-desktop)
152152

153153
## 支持的消息平台
154154

README_en.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,9 +154,9 @@ yay -S astrbot-git
154154
paru -S astrbot-git
155155
```
156156

157-
#### Desktop Electron Build
157+
#### Desktop (Tauri)
158158

159-
For desktop build steps (Electron packaging, `pnpm` workflow), see [`desktop/README.md`](desktop/README.md).
159+
Desktop packaging has moved to a standalone Tauri repository: [https://github.com/AstrBotDevs/AstrBot-desktop](https://github.com/AstrBotDevs/AstrBot-desktop).
160160

161161
## Supported Messaging Platforms
162162

astrbot/core/knowledge_base/kb_db_sqlite.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,19 @@
1313
KBMedia,
1414
KnowledgeBase,
1515
)
16+
from astrbot.core.utils.astrbot_path import get_astrbot_knowledge_base_path
1617

1718

1819
class KBSQLiteDatabase:
19-
def __init__(self, db_path: str = "data/knowledge_base/kb.db") -> None:
20+
def __init__(self, db_path: str | None = None) -> None:
2021
"""初始化知识库数据库
2122
2223
Args:
23-
db_path: 数据库文件路径, 默认为 data/knowledge_base/kb.db
24+
db_path: 数据库文件路径, 默认位于 AstrBot 数据目录下的 knowledge_base/kb.db
2425
2526
"""
27+
if db_path is None:
28+
db_path = str(Path(get_astrbot_knowledge_base_path()) / "kb.db")
2629
self.db_path = db_path
2730
self.DATABASE_URL = f"sqlite+aiosqlite:///{db_path}"
2831
self.inited = False

astrbot/core/knowledge_base/kb_mgr.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
from astrbot.core import logger
55
from astrbot.core.provider.manager import ProviderManager
6+
from astrbot.core.utils.astrbot_path import get_astrbot_knowledge_base_path
67

78
# from .chunking.fixed_size import FixedSizeChunker
89
from .chunking.recursive import RecursiveCharacterChunker
@@ -13,7 +14,7 @@
1314
from .retrieval.rank_fusion import RankFusion
1415
from .retrieval.sparse_retriever import SparseRetriever
1516

16-
FILES_PATH = "data/knowledge_base"
17+
FILES_PATH = get_astrbot_knowledge_base_path()
1718
DB_PATH = Path(FILES_PATH) / "kb.db"
1819
"""Knowledge Base storage root directory"""
1920
CHUNKER = RecursiveCharacterChunker()
@@ -27,7 +28,7 @@ def __init__(
2728
self,
2829
provider_manager: ProviderManager,
2930
) -> None:
30-
Path(DB_PATH).parent.mkdir(parents=True, exist_ok=True)
31+
DB_PATH.parent.mkdir(parents=True, exist_ok=True)
3132
self.provider_manager = provider_manager
3233
self._session_deleted_callback_registered = False
3334

astrbot/core/provider/sources/sensevoice_selfhosted_source.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,14 @@
77
import os
88
import re
99
from datetime import datetime
10+
from pathlib import Path
1011
from typing import cast
1112

1213
from funasr_onnx import SenseVoiceSmall
1314
from funasr_onnx.utils.postprocess_utils import rich_transcription_postprocess
1415

1516
from astrbot.core import logger
17+
from astrbot.core.utils.astrbot_path import get_astrbot_temp_path
1618
from astrbot.core.utils.io import download_file
1719
from astrbot.core.utils.tencent_record_helper import tencent_silk_to_wav
1820

@@ -50,7 +52,9 @@ async def initialize(self) -> None:
5052

5153
async def get_timestamped_path(self) -> str:
5254
timestamp = datetime.now().strftime("%Y%m%d_%H%M%S")
53-
return os.path.join("data", "temp", f"{timestamp}")
55+
temp_dir = Path(get_astrbot_temp_path())
56+
temp_dir.mkdir(parents=True, exist_ok=True)
57+
return str(temp_dir / timestamp)
5458

5559
async def _is_silk_file(self, file_path) -> bool:
5660
silk_header = b"SILK"

astrbot/core/utils/astrbot_path.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
import os
1717

18-
from astrbot.core.utils.runtime_env import is_packaged_electron_runtime
18+
from astrbot.core.utils.runtime_env import is_packaged_desktop_runtime
1919

2020

2121
def get_astrbot_path() -> str:
@@ -29,7 +29,7 @@ def get_astrbot_root() -> str:
2929
"""获取Astrbot根目录路径"""
3030
if path := os.environ.get("ASTRBOT_ROOT"):
3131
return os.path.realpath(path)
32-
if is_packaged_electron_runtime():
32+
if is_packaged_desktop_runtime():
3333
return os.path.realpath(os.path.join(os.path.expanduser("~"), ".astrbot"))
3434
return os.path.realpath(os.getcwd())
3535

astrbot/core/utils/pip_installer.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
from collections import deque
1313

1414
from astrbot.core.utils.astrbot_path import get_astrbot_site_packages_path
15-
from astrbot.core.utils.runtime_env import is_packaged_electron_runtime
15+
from astrbot.core.utils.runtime_env import is_packaged_desktop_runtime
1616

1717
logger = logging.getLogger("astrbot")
1818

@@ -35,7 +35,7 @@ def _get_pip_main():
3535
"pip module is unavailable "
3636
f"(sys.executable={sys.executable}, "
3737
f"frozen={getattr(sys, 'frozen', False)}, "
38-
f"ASTRBOT_ELECTRON_CLIENT={os.environ.get('ASTRBOT_ELECTRON_CLIENT')})"
38+
f"ASTRBOT_DESKTOP_CLIENT={os.environ.get('ASTRBOT_DESKTOP_CLIENT')})"
3939
) from exc
4040

4141
return pip_main
@@ -556,7 +556,7 @@ async def install(
556556
args.extend(["--trusted-host", "mirrors.aliyun.com", "-i", index_url])
557557

558558
target_site_packages = None
559-
if is_packaged_electron_runtime():
559+
if is_packaged_desktop_runtime():
560560
target_site_packages = get_astrbot_site_packages_path()
561561
os.makedirs(target_site_packages, exist_ok=True)
562562
_prepend_sys_path(target_site_packages)
@@ -582,7 +582,7 @@ async def install(
582582

583583
def prefer_installed_dependencies(self, requirements_path: str) -> None:
584584
"""优先使用已安装在插件 site-packages 中的依赖,不执行安装。"""
585-
if not is_packaged_electron_runtime():
585+
if not is_packaged_desktop_runtime():
586586
return
587587

588588
target_site_packages = get_astrbot_site_packages_path()

astrbot/core/utils/runtime_env.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ def is_frozen_runtime() -> bool:
66
return bool(getattr(sys, "frozen", False))
77

88

9-
def is_packaged_electron_runtime() -> bool:
10-
return is_frozen_runtime() and os.environ.get("ASTRBOT_ELECTRON_CLIENT") == "1"
9+
def is_packaged_desktop_runtime() -> bool:
10+
return is_frozen_runtime() and os.environ.get("ASTRBOT_DESKTOP_CLIENT") == "1"

0 commit comments

Comments
 (0)