-
Notifications
You must be signed in to change notification settings - Fork 712
257 lines (223 loc) 路 9.2 KB
/
Copy pathbuild.yml
File metadata and controls
257 lines (223 loc) 路 9.2 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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
name: Build Application
on:
workflow_dispatch:
inputs:
platform:
description: '閫夋嫨鏋勫缓骞冲彴'
required: true
default: 'all'
type: choice
options:
- all
- windows
- linux
- mac
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: 'true'
RTK_INSTALL_GITHUB_TOKEN: ${{ secrets.RTK_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
RTK_INSTALL_GITHUB_TOKEN_SOURCE: ${{ secrets.RTK_GITHUB_TOKEN != '' && 'RTK_GITHUB_TOKEN' || 'GITHUB_TOKEN' }}
jobs:
build-windows:
name: build-windows(${{ matrix.arch }})
if: github.event.inputs.platform == 'all' || contains(github.event.inputs.platform, 'windows')
runs-on: ${{ matrix.runner }}
strategy:
matrix:
include:
- arch: x64
platform: win-x64
runner: windows-2025-vs2026
unpacked: win-unpacked
- arch: arm64
platform: win-arm64
runner: windows-11-arm
unpacked: win-arm64-unpacked
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Setup Node.js
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: '24.14.1'
package-manager-cache: false
- name: Setup pnpm
uses: pnpm/action-setup@0e279bb959325dab635dd2c09392533439d90093 # v6.0.8
- name: Install dependencies
run: pnpm install
- name: Configure pnpm workspace for Windows ${{ matrix.arch }}
run: pnpm run install:sharp
env:
TARGET_OS: win32
TARGET_ARCH: ${{ matrix.arch }}
- name: Install dependencies
run: pnpm install
env:
npm_config_build_from_source: true
npm_config_platform: win32
npm_config_arch: ${{ matrix.arch }}
- name: Report RTK install token source
if: matrix.arch == 'x64'
shell: bash
run: |
echo "RTK runtime install token source: ${RTK_INSTALL_GITHUB_TOKEN_SOURCE}"
- name: Install Windows runtimes
run: pnpm run installRuntime:win:${{ matrix.arch }}
env:
GITHUB_TOKEN: ${{ env.RTK_INSTALL_GITHUB_TOKEN }}
- name: Build Windows
shell: bash
run: |
pnpm run build
pnpm run plugin:bundle -- --name cua --platform win32 --arch ${{ matrix.arch }}
pnpm run plugin:bundle -- --name feishu --platform win32 --arch ${{ matrix.arch }}
pnpm exec electron-builder --win --${{ matrix.arch }} --publish=never
env:
VITE_GITHUB_CLIENT_ID: ${{ secrets.DC_GITHUB_CLIENT_ID }}
VITE_GITHUB_CLIENT_SECRET: ${{ secrets.DC_GITHUB_CLIENT_SECRET }}
VITE_GITHUB_REDIRECT_URI: ${{ secrets.DC_GITHUB_REDIRECT_URI }}
VITE_PROVIDER_DB_URL: ${{ secrets.CDN_PROVIDER_DB_URL }}
- name: Verify bundled plugins
shell: bash
run: |
pnpm run plugin:verify -- --name cua --platform win32 --arch ${{ matrix.arch }} --plugin-root dist/${{ matrix.unpacked }}/resources/app.asar.unpacked/plugins
pnpm run plugin:verify -- --name feishu --platform win32 --arch ${{ matrix.arch }} --plugin-root dist/${{ matrix.unpacked }}/resources/app.asar.unpacked/plugins
- name: Upload artifacts
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
with:
name: deepchat-${{ matrix.platform }}
path: |
dist/*
!dist/win-unpacked
!dist/win-arm64-unpacked
build-linux:
if: github.event.inputs.platform == 'all' || contains(github.event.inputs.platform, 'linux')
runs-on: ubuntu-22.04
strategy:
matrix:
arch: [x64]
include:
- arch: x64
platform: linux-x64
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Setup Node.js
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: '24.14.1'
package-manager-cache: false
- name: Setup pnpm
uses: pnpm/action-setup@0e279bb959325dab635dd2c09392533439d90093 # v6.0.8
- name: Install dependencies
run: pnpm install
- name: Configure pnpm workspace for Linux ${{ matrix.arch }}
run: pnpm run install:sharp
env:
TARGET_OS: linux
TARGET_ARCH: ${{ matrix.arch }}
- name: Install dependencies
run: pnpm install
# - name: Install Node Runtime
# run: pnpm run installRuntime:linux:${{ matrix.arch }}
- name: Build Linux
run: |
pnpm run build
pnpm run plugin:bundle -- --name cua --platform linux --arch ${{ matrix.arch }}
pnpm run plugin:bundle -- --name feishu --platform linux --arch ${{ matrix.arch }}
pnpm exec electron-builder --linux --${{ matrix.arch }} --publish=never
env:
VITE_GITHUB_CLIENT_ID: ${{ secrets.DC_GITHUB_CLIENT_ID }}
VITE_GITHUB_CLIENT_SECRET: ${{ secrets.DC_GITHUB_CLIENT_SECRET }}
VITE_GITHUB_REDIRECT_URI: ${{ secrets.DC_GITHUB_REDIRECT_URI }}
VITE_PROVIDER_DB_URL: ${{ secrets.CDN_PROVIDER_DB_URL }}
- name: Verify bundled plugins
shell: bash
run: |
pnpm run plugin:verify -- --name cua --platform linux --arch ${{ matrix.arch }} --plugin-root dist/linux-unpacked/resources/app.asar.unpacked/plugins
pnpm run plugin:verify -- --name feishu --platform linux --arch ${{ matrix.arch }} --plugin-root dist/linux-unpacked/resources/app.asar.unpacked/plugins
- name: Upload artifacts
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
with:
name: deepchat-${{ matrix.platform }}
path: |
dist/*
!dist/linux-unpacked
build-mac:
if: github.event.inputs.platform == 'all' || contains(github.event.inputs.platform, 'mac')
runs-on: macos-15
strategy:
matrix:
arch: [x64, arm64]
include:
- arch: x64
platform: mac-x64
- arch: arm64
platform: mac-arm64
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Setup Node.js
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: '24.14.1'
package-manager-cache: false
- name: Setup pnpm
uses: pnpm/action-setup@0e279bb959325dab635dd2c09392533439d90093 # v6.0.8
- name: Install dependencies
run: pnpm install
- name: Configure pnpm workspace for macOS ${{ matrix.arch }}
run: pnpm run install:sharp
env:
TARGET_OS: darwin
TARGET_ARCH: ${{ matrix.arch }}
- name: Install dependencies
run: pnpm install
- name: Report RTK install token source
shell: bash
run: |
echo "RTK runtime install token source: ${RTK_INSTALL_GITHUB_TOKEN_SOURCE}"
- name: Install Node Runtime
run: pnpm run installRuntime:mac:${{ matrix.arch }}
env:
GITHUB_TOKEN: ${{ env.RTK_INSTALL_GITHUB_TOKEN }}
- name: Build Mac
run: |
pnpm run build
pnpm run plugin:bundle -- --name cua --platform darwin --arch ${{ matrix.arch }}
pnpm run plugin:bundle -- --name feishu --platform darwin --arch ${{ matrix.arch }}
pnpm exec electron-builder --mac --${{ matrix.arch }} --publish=never
env:
CSC_LINK: ${{ secrets.DEEPCHAT_CSC_LINK }}
CSC_KEY_PASSWORD: ${{ secrets.DEEPCHAT_CSC_KEY_PASS }}
DEEPCHAT_APPLE_NOTARY_USERNAME: ${{ secrets.DEEPCHAT_APPLE_NOTARY_USERNAME }}
DEEPCHAT_APPLE_NOTARY_TEAM_ID: ${{ secrets.DEEPCHAT_APPLE_NOTARY_TEAM_ID }}
DEEPCHAT_APPLE_NOTARY_PASSWORD: ${{ secrets.DEEPCHAT_APPLE_NOTARY_PASSWORD }}
build_for_release: '2'
VITE_GITHUB_CLIENT_ID: ${{ secrets.DC_GITHUB_CLIENT_ID }}
VITE_GITHUB_CLIENT_SECRET: ${{ secrets.DC_GITHUB_CLIENT_SECRET }}
VITE_GITHUB_REDIRECT_URI: ${{ secrets.DC_GITHUB_REDIRECT_URI }}
NODE_OPTIONS: '--max-old-space-size=4096'
VITE_PROVIDER_DB_URL: ${{ secrets.CDN_PROVIDER_DB_URL }}
- name: Verify bundled plugins
shell: bash
env:
TARGET_ARCH: ${{ matrix.arch }}
run: |
APP_DIR="dist/mac/DeepChat.app"
if [ "$TARGET_ARCH" = "arm64" ]; then
APP_DIR="dist/mac-arm64/DeepChat.app"
fi
PLUGIN_ROOT="${APP_DIR}/Contents/Resources/app.asar.unpacked/plugins"
pnpm run plugin:verify -- --name cua --platform darwin --arch "$TARGET_ARCH" --plugin-root "$PLUGIN_ROOT"
pnpm run plugin:verify -- --name feishu --platform darwin --arch "$TARGET_ARCH" --plugin-root "$PLUGIN_ROOT"
- name: Upload artifacts
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
with:
name: deepchat-${{ matrix.platform }}
path: |
dist/*
!dist/mac/*
!dist/mac-arm64/*