-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathelectron-builder.ts
More file actions
137 lines (136 loc) · 3.97 KB
/
Copy pathelectron-builder.ts
File metadata and controls
137 lines (136 loc) · 3.97 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
import { branding } from "./electron/branding.ts"
// @see - https://www.electron.build/configuration/configuration
// 阶段 0:未签名本地包。图标 / extraResources(oo + opencode 二进制)/ 签名公证
// 在后续阶段补齐;品牌标识从 electron/branding.ts 派生(R1)。
export default {
$schema:
"https://raw.githubusercontent.com/electron-userland/electron-builder/master/packages/app-builder-lib/scheme.json",
appId: branding.appId,
asar: true,
asarUnpack: ["node_modules/sqlite3/**"],
productName: branding.appName,
directories: {
buildResources: "resources",
output: "release/${version}",
},
publish: {
provider: "generic",
url: "",
},
// 双渠道(stable/beta):generic provider 由版本号 prerelease 段自动推导渠道
// (1.2.3-beta.1 → beta*.yml;detectUpdateChannel 默认开启)。此开关让 stable 构建
// 同时刷新 beta*.yml,beta 用户在正式版发布后立即收敛到 stable,无需等下一个 beta。
// 多产出的 alpha*.yml 不在 CI 上传清单内,自然丢弃。
generateUpdatesFilesForAllChannels: true,
protocols: [
{
name: branding.protocolScheme,
schemes: [branding.protocolScheme],
},
],
files: ["dist", "dist-electron", "!**/*.{map,d.ts}"],
afterPack: "scripts/electron-builder-after-pack.cjs",
// 内置 oo + opencode + rg + Direct CLI 平台二进制(由 prepare-binaries 在构建前复制)。
// 运行时 app.isPackaged 走 process.resourcesPath/bin。
// resources/skills 是 oo 自带的 4 个内置 skill(同由 prepare-binaries.ts 导出);运行时拷进 OpenCode
// workspace 的 .opencode/skill/,使 Wanta agent 直接读到。
extraResources: [
{ from: "resources/licenses/wiki-graph-LICENSE", to: "licenses/wiki-graph-LICENSE" },
{
from: "LICENSE",
to: "licenses/Wanta-LICENSE",
},
{
from: "NOTICE",
to: "NOTICE",
},
{
from: "THIRD_PARTY_NOTICES.md",
to: "THIRD_PARTY_NOTICES.md",
},
{
from: "TRADEMARKS.md",
to: "TRADEMARKS.md",
},
{
from: "resources/branding/icon.png",
to: "icon.png",
},
{
from: "resources/branding/icon.ico",
to: "icon.ico",
},
{
from: "resources/bin",
to: "bin",
},
{
from: "resources/skills",
to: "skills",
},
{
from: "resources/lark-skills",
to: "lark-skills",
},
{
from: "resources/wecom-skills",
to: "wecom-skills",
},
{
from: "resources/dingtalk-skills",
to: "dingtalk-skills",
},
{
from: "resources/agent-tool-runtime",
to: "agent-tool-runtime",
},
],
mac: {
icon: "branding/icon.icns",
electronLanguages: ["en", "zh_CN"],
extendInfo: {
NSMicrophoneUsageDescription: `${branding.appName} uses the microphone to record voice messages for chat input.`,
},
entitlements: "electron/entitlements.mac.plist",
entitlementsInherit: "electron/entitlements.mac.plist",
target: [
{
target: "dmg",
arch: ["arm64"],
},
{
target: "zip",
arch: ["arm64"],
},
],
artifactName: "${productName}-${version}.${ext}",
},
win: {
icon: "branding/icon.ico",
electronLanguages: ["en-US", "zh-CN"],
target: [
{
target: "nsis",
arch: ["x64"],
},
],
// Windows 代码签名(CI 自托管 runner + USB 证书;指纹为 CI 配置,本地不签名)。
signExts: [".exe", ".dll", ".node"],
signtoolOptions: {
certificateSha1: "9F84845385AA9282C764044D307EF4044B47E966",
signingHashAlgorithms: ["sha256"],
},
artifactName: "${productName}-${version}-Setup.${ext}",
},
nsis: {
oneClick: false,
perMachine: false,
allowToChangeInstallationDirectory: true,
deleteAppDataOnUninstall: false,
},
linux: {
icon: "branding/icon.png",
target: ["AppImage"],
artifactName: "${productName}-${version}.${ext}",
},
}