Skip to content

Commit 5f67641

Browse files
authored
Merge pull request #173 from wsp1911/release
fix(build): stabilize Windows desktop packaging flow
2 parents 87b4c0a + cded1b6 commit 5f67641

6 files changed

Lines changed: 82 additions & 20 deletions

File tree

.github/workflows/desktop-package.yml

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
name: Desktop Package
22

33
on:
4-
# Triggered automatically when Release Please publishes a release
5-
release:
6-
types: [published]
7-
# Manual trigger for ad-hoc builds
4+
# Triggered explicitly by release workflows to avoid duplicate packaging.
85
workflow_dispatch:
96
inputs:
107
tag_name:
@@ -41,11 +38,7 @@ jobs:
4138
run: |
4239
set -euo pipefail
4340
44-
if [[ "${{ github.event_name }}" == "release" ]]; then
45-
TAG="${{ github.event.release.tag_name }}"
46-
VERSION="${TAG#v}"
47-
UPLOAD="true"
48-
elif [[ -n "${INPUT_TAG_NAME}" ]]; then
41+
if [[ -n "${INPUT_TAG_NAME}" ]]; then
4942
TAG="${INPUT_TAG_NAME}"
5043
VERSION="${TAG#v}"
5144
if [[ "${INPUT_UPLOAD_TO_RELEASE}" == "true" ]]; then

BitFun-Installer/src/i18n/locales/en.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,14 @@
100100
"volcengine": {
101101
"name": "Volcano Engine",
102102
"description": "ByteDance Volcano Engine Doubao large language models"
103+
},
104+
"openbitfun": {
105+
"name": "OpenBitFun",
106+
"description": "OpenBitFun Model Service"
107+
},
108+
"gemini": {
109+
"name": "Google Gemini",
110+
"description": "Google Gemini 2.5 series multimodal models"
103111
}
104112
},
105113
"modelNameSelectPlaceholder": "Select a model...",

BitFun-Installer/src/i18n/locales/zh.json

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
"selectProvider": "选择模型服务商...",
4646
"customProvider": "自定义",
4747
"getApiKey": "如何获取 API Key?",
48-
"modelNamePlaceholder": "输入模型名称...",
48+
"modelNamePlaceholder": "输入自定义模型名称...",
4949
"baseUrlPlaceholder": "示例:https://open.bigmodel.cn/api/paas/v4/chat/completions",
5050
"customRequestBodyPlaceholder": "{\n \"temperature\": 0.8,\n \"top_p\": 0.9\n}",
5151
"jsonValid": "JSON 格式有效",
@@ -100,6 +100,14 @@
100100
"volcengine": {
101101
"name": "火山引擎",
102102
"description": "字节跳动火山引擎豆包大模型"
103+
},
104+
"openbitfun": {
105+
"name": "OpenBitFun",
106+
"description": "OpenBitFun 模型服务"
107+
},
108+
"gemini": {
109+
"name": "Google Gemini",
110+
"description": "Google Gemini 2.5 系列多模态模型"
103111
}
104112
},
105113
"modelNameSelectPlaceholder": "选择模型...",

package.json

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"node": ">=18.0.0"
88
},
99
"scripts": {
10-
"copy-monaco": "copyfiles -u 3 \"src/web-ui/node_modules/monaco-editor/min/vs/**/*\" src/web-ui/public/monaco-editor",
10+
"copy-monaco": "copyfiles -u 5 \"src/web-ui/node_modules/monaco-editor/min/vs/**/*\" src/web-ui/public/monaco-editor",
1111
"copy-icons": "copyfiles -f \"src/apps/desktop/icons/Logo-ICON.png\" \"src/web-ui/public/\"",
1212
"copy-assets": "pnpm run copy-monaco && pnpm run copy-icons",
1313
"generate-version": "node scripts/generate-version.cjs",
@@ -19,19 +19,20 @@
1919
"prebuild:web": "pnpm run copy-assets --silent && pnpm run generate-all --silent",
2020
"type-check:web": "pnpm --dir src/web-ui run type-check",
2121
"build": "pnpm run build:web",
22-
"build:web": "pnpm run type-check:web && pnpm --dir src/web-ui build",
22+
"verify:monaco-assets": "node scripts/verify-monaco-assets.cjs",
23+
"build:web": "pnpm run type-check:web && pnpm --dir src/web-ui build && pnpm run verify:monaco-assets",
2324
"build:mobile-web": "pnpm --dir src/mobile-web build",
2425
"prepare:mobile-web": "node scripts/mobile-web-build.cjs",
2526
"preview": "pnpm --dir src/web-ui preview",
2627
"desktop:dev": "node scripts/dev.cjs desktop",
27-
"desktop:dev:raw": "cd src/apps/desktop && env CI=true npx tauri dev",
28-
"desktop:build": "cd src/apps/desktop && env CI=true npx tauri build",
29-
"desktop:build:fast": "cd src/apps/desktop && env CI=true npx tauri build --debug --no-bundle",
30-
"desktop:build:release-fast": "cd src/apps/desktop && env CI=true npx tauri build --no-bundle -- --profile release-fast",
31-
"desktop:build:exe": "cd src/apps/desktop && env CI=true npx tauri build --no-bundle",
32-
"desktop:build:nsis": "cd src/apps/desktop && env CI=true npx tauri build --bundles nsis",
33-
"desktop:build:arm64": "cd src/apps/desktop && env CI=true npx tauri build --target aarch64-apple-darwin --bundles dmg",
34-
"desktop:build:x86_64": "cd src/apps/desktop && env CI=true npx tauri build --target x86_64-apple-darwin --bundles dmg",
28+
"desktop:dev:raw": "cross-env-shell CI=true \"cd src/apps/desktop && tauri dev\"",
29+
"desktop:build": "cross-env-shell CI=true \"cd src/apps/desktop && tauri build\"",
30+
"desktop:build:fast": "cross-env-shell CI=true \"cd src/apps/desktop && tauri build --debug --no-bundle\"",
31+
"desktop:build:release-fast": "cross-env-shell CI=true \"cd src/apps/desktop && tauri build --no-bundle -- --profile release-fast\"",
32+
"desktop:build:exe": "cross-env-shell CI=true \"cd src/apps/desktop && tauri build --no-bundle\"",
33+
"desktop:build:nsis": "cross-env-shell CI=true \"cd src/apps/desktop && tauri build --bundles nsis\"",
34+
"desktop:build:arm64": "cross-env-shell CI=true \"cd src/apps/desktop && tauri build --target aarch64-apple-darwin --bundles dmg\"",
35+
"desktop:build:x86_64": "cross-env-shell CI=true \"cd src/apps/desktop && tauri build --target x86_64-apple-darwin --bundles dmg\"",
3536
"installer:build": "pnpm --dir BitFun-Installer run installer:build",
3637
"installer:build:fast": "pnpm --dir BitFun-Installer run installer:build:fast",
3738
"installer:build:only": "pnpm --dir BitFun-Installer run installer:build:only",
@@ -61,6 +62,7 @@
6162
"@tauri-apps/cli": "^2.10.0",
6263
"@vitejs/plugin-react": "^4.6.0",
6364
"copyfiles": "^2.4.1",
65+
"cross-env": "^10.1.0",
6466
"sass": "^1.93.2",
6567
"sharp": "^0.34.3",
6668
"typescript": "~5.8.3",

pnpm-lock.yaml

Lines changed: 18 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

scripts/verify-monaco-assets.cjs

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#!/usr/bin/env node
2+
3+
const fs = require('fs');
4+
const path = require('path');
5+
6+
const ROOT_DIR = path.resolve(__dirname, '..');
7+
const DIST_DIR = path.join(ROOT_DIR, 'dist', 'monaco-editor', 'vs');
8+
9+
const requiredFiles = [
10+
'loader.js',
11+
path.join('base', 'worker', 'workerMain.js'),
12+
path.join('language', 'json', 'jsonWorker.js'),
13+
path.join('language', 'html', 'htmlWorker.js'),
14+
path.join('language', 'css', 'cssWorker.js'),
15+
path.join('language', 'typescript', 'tsWorker.js'),
16+
];
17+
18+
const missingFiles = requiredFiles.filter((relativePath) => {
19+
return !fs.existsSync(path.join(DIST_DIR, relativePath));
20+
});
21+
22+
if (missingFiles.length > 0) {
23+
console.error('[verify-monaco-assets] Missing Monaco production assets:');
24+
for (const relativePath of missingFiles) {
25+
console.error(` - dist/monaco-editor/vs/${relativePath.replace(/\\/g, '/')}`);
26+
}
27+
console.error(
28+
'[verify-monaco-assets] Build output is incomplete. Check the copy-monaco script and Monaco public asset layout.'
29+
);
30+
process.exit(1);
31+
}
32+
33+
console.log('[verify-monaco-assets] Monaco production assets verified.');

0 commit comments

Comments
 (0)