-
Notifications
You must be signed in to change notification settings - Fork 49
366 lines (309 loc) · 12.8 KB
/
pre-release.yml
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
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
name: Alpha Build
on: workflow_dispatch
permissions: write-all
env:
CARGO_INCREMENTAL: 0
RUST_BACKTRACE: short
jobs:
alpha:
strategy:
fail-fast: false
matrix:
include:
- os: windows-latest
target: x86_64-pc-windows-msvc
- os: windows-latest
target: aarch64-pc-windows-msvc
- os: macos-15
target: aarch64-apple-darwin
- os: macos-15
target: x86_64-apple-darwin
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
runs-on: ${{ matrix.os }}
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Install Rust Stable
uses: dtolnay/rust-toolchain@stable
- name: Add Rust Target
run: rustup target add ${{ matrix.target }}
- name: Rust Cache
uses: Swatinem/rust-cache@v2
with:
workspaces: src-tauri
cache-all-crates: true
- name: Install dependencies (ubuntu only)
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y libwebkit2gtk-4.0-dev libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf
- name: Install Node
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
run_install: false
- name: Pnpm install and check
env:
NVMD_RELEASE_URL: 'https://github.com/1111mp/nvmd-command/releases/download/alpha'
run: |
pnpm i
pnpm check ${{ matrix.target }}
- name: Tauri Build
uses: tauri-apps/tauri-action@v0
env:
NODE_OPTIONS: '--max_old_space_size=4096'
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }}
with:
tagName: alpha
releaseName: 'NVM Desktop Alpha'
releaseBody: 'More new features are now supported.'
releaseDraft: false
prerelease: true
tauriScript: pnpm
args: --target ${{ matrix.target }}
alpha-for-linux-arm64:
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
target: aarch64-unknown-linux-gnu
runs-on: ${{ matrix.os }}
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Install Rust Stable
uses: dtolnay/rust-toolchain@stable
- name: Add Rust Target
run: rustup target add ${{ matrix.target }}
- name: Rust Cache
uses: Swatinem/rust-cache@v2
with:
workspaces: src-tauri
cache-all-crates: true
- name: Install Node
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
run_install: false
- name: Pnpm install and check
env:
NVMD_RELEASE_URL: 'https://github.com/1111mp/nvmd-command/releases/download/alpha'
run: |
pnpm i
pnpm check ${{ matrix.target }}
- name: 'Setup for linux'
run: |-
sudo ls -lR /etc/apt/
echo -------------
# sudo sed 's/mirror+file:\/etc\/apt\/apt-mirrors.txt/[arch-=amd64,i386] http:\/\/ports.ubuntu.com\/ubuntu-ports\//g' /etc/apt/sources.list | sudo tee /etc/apt/sources.list.d/ports.list
# echo -------------
# sudo sed -i 's/mirror+file:\/etc\/apt\/apt-mirrors.txt/[arch=amd64,i386] http:\/\/archive.ubuntu.com\/ubuntu\//g' /etc/apt/sources.list
cat > /tmp/sources.list << EOF
deb [arch=amd64,i386] http://archive.ubuntu.com/ubuntu jammy main multiverse universe restricted
deb [arch=amd64,i386] http://archive.ubuntu.com/ubuntu jammy-security main multiverse universe restricted
deb [arch=amd64,i386] http://archive.ubuntu.com/ubuntu jammy-updates main multiverse universe restricted
deb [arch=amd64,i386] http://archive.ubuntu.com/ubuntu jammy-backports main multiverse universe restricted
deb [arch-=amd64,i386] http://ports.ubuntu.com/ubuntu-ports jammy main multiverse universe restricted
deb [arch-=amd64,i386] http://ports.ubuntu.com/ubuntu-ports jammy-security main multiverse universe restricted
deb [arch-=amd64,i386] http://ports.ubuntu.com/ubuntu-ports jammy-updates main multiverse universe restricted
deb [arch-=amd64,i386] http://ports.ubuntu.com/ubuntu-ports jammy-backports main multiverse universe restricted
EOF
sudo mv /etc/apt/sources.list /etc/apt/sources.list.default
sudo mv /tmp/sources.list /etc/apt/sources.list
echo -------------
echo /etc/apt/sources.list && cat /etc/apt/sources.list
echo -------------
echo /etc/apt/apt-mirrors.txt && cat /etc/apt/apt-mirrors.txt
echo -------------
echo /etc/apt/sources.list.d/ports.list && cat /etc/apt/sources.list.d/ports.list || true
echo -------------
sudo dpkg --add-architecture arm64
sudo apt update
sudo apt install -y \
gcc-multilib \
g++-multilib
echo -------------
echo install arm64 dependences ...
sudo apt install -y \
gcc-aarch64-linux-gnu \
g++-aarch64-linux-gnu \
libc6-dev-arm64-cross \
libgtk-3-dev \
patchelf:arm64 \
libwebkit2gtk-4.1-dev:arm64 \
libappindicator3-dev:arm64 \
libssl-dev:arm64 \
libssl3:arm64 \
libgtk-3-dev:arm64 \
librsvg2-dev:arm64
echo 'ok'
- name: Build for Linux
run: |
echo "build native binarys..."
export PKG_CONFIG_PATH=/usr/lib/aarch64-linux-gnu/pkgconfig/:$PKG_CONFIG_PATH
export PKG_CONFIG_SYSROOT_DIR=/usr/aarch64-linux-gnu/
export PKG_CONFIG_ALLOW_CROSS=1
pnpm build --target aarch64-unknown-linux-gnu
echo "build native binarys finished"
env:
NODE_OPTIONS: '--max_old_space_size=4096'
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }}
- name: Get Version
run: |
sudo apt-get update
sudo apt-get install jq
echo "VERSION=$(cat package.json | jq '.version' | tr -d '"')" >> $GITHUB_ENV
- name: Upload Release
uses: softprops/action-gh-release@v2
with:
tag_name: alpha
name: 'NVM Desktop Alpha'
body: 'More new features are now supported.'
draft: false
prerelease: true
token: ${{ secrets.GITHUB_TOKEN }}
files: |
src-tauri/target/${{ matrix.target }}/release/bundle/deb/*.deb
src-tauri/target/${{ matrix.target }}/release/bundle/rpm/*.rpm
alpha-for-fixed-webview2:
strategy:
fail-fast: false
matrix:
include:
- os: windows-latest
target: x86_64-pc-windows-msvc
arch: x64
- os: windows-latest
target: aarch64-pc-windows-msvc
arch: arm64
runs-on: ${{ matrix.os }}
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Add Rust Target
run: rustup target add ${{ matrix.target }}
- name: Rust Cache
uses: Swatinem/rust-cache@v2
with:
workspaces: src-tauri
- name: Install Node
uses: actions/setup-node@v4
with:
node-version: '20'
- uses: pnpm/action-setup@v4
name: Install pnpm
with:
run_install: false
- name: Pnpm install and check
env:
NVMD_RELEASE_URL: 'https://github.com/1111mp/nvmd-command/releases/download/alpha'
run: |
pnpm i
pnpm check ${{ matrix.target }}
- name: Download WebView2 Runtime
run: |
invoke-webrequest -uri https://github.com/westinyang/WebView2RuntimeArchive/releases/download/127.0.2651.105/Microsoft.WebView2.FixedVersionRuntime.127.0.2651.105.${{ matrix.arch }}.cab -outfile Microsoft.WebView2.FixedVersionRuntime.127.0.2651.105.${{ matrix.arch }}.cab
Expand .\Microsoft.WebView2.FixedVersionRuntime.127.0.2651.105.${{ matrix.arch }}.cab -F:* ./src-tauri
Remove-Item .\src-tauri\tauri.windows.conf.json
Rename-Item .\src-tauri\webview2.${{ matrix.arch }}.json tauri.windows.conf.json
- name: Tauri build
id: build
uses: tauri-apps/tauri-action@v0
env:
NODE_OPTIONS: '--max_old_space_size=4096'
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }}
with:
tauriScript: pnpm
args: --target ${{ matrix.target }}
- name: Rename
run: |
Rename-Item '.\src-tauri\target\${{ matrix.target }}\release\bundle\nsis\NVM Desktop_${{steps.build.outputs.appVersion}}_${{ matrix.arch }}-setup.exe' 'NVM Desktop_${{steps.build.outputs.appVersion}}_${{ matrix.arch }}_fixed_webview2-setup.exe'
Rename-Item '.\src-tauri\target\${{ matrix.target }}\release\bundle\nsis\NVM Desktop_${{steps.build.outputs.appVersion}}_${{ matrix.arch }}-setup.exe.sig' 'NVM Desktop_${{steps.build.outputs.appVersion}}_${{ matrix.arch }}_fixed_webview2-setup.exe.sig'
- name: Upload Release
uses: softprops/action-gh-release@v2
with:
tag_name: alpha
name: 'NVM Desktop Alpha'
body: 'More new features are now supported.'
draft: false
prerelease: true
token: ${{ secrets.GITHUB_TOKEN }}
files: src-tauri/target/${{ matrix.target }}/release/bundle/nsis/*setup*
update_alpha_notes:
name: Update alpha notes
runs-on: ubuntu-latest
needs: [alpha, alpha-for-linux-arm64, alpha-for-fixed-webview2]
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set Env
run: |
echo "BUILDTIME=$(TZ=Asia/Shanghai date)" >> $GITHUB_ENV
shell: bash
- name: Get Version
run: |
sudo apt-get update
sudo apt-get install jq
echo "VERSION=$(cat package.json | jq '.version' | tr -d '"')" >> $GITHUB_ENV
- name: Update Tag
uses: richardsimko/update-tag@v1
with:
tag_name: alpha
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- run: |
cat > release.txt << 'EOF'
## Which version should I download?
### MacOS (Prompts that the file is damaged or the developer cannot verify it. Please check [MacOS issues](https://github.com/1111mp/nvm-desktop?tab=readme-ov-file#macos-issues))
- MacOS Intel chip: x64.dmg
- MacOS apple M chip: aarch64.dmg
### Linux
- Linux 64-bit: amd64.deb/amd64.rpm
- Linux arm64 architecture: arm64.deb/aarch64.rpm
### Windows (Win7 users please make sure to install and enable webview2)
#### Normal version (recommended)
- 64-bit: x64-setup.exe
- arm64 architecture: arm64-setup.exe
#### Built-in Webview2 version (large in size, only used when the enterprise version system or Win7 cannot install webview2)
- 64-bit: x64_fixed_webview2-setup.exe
- arm64 architecture: arm64_fixed_webview2-setup.exe
---
## 我应该下载哪个版本?
### MacOS (提示文件损坏或开发者无法验证请查看 [MacOS issues](https://github.com/1111mp/nvm-desktop/blob/tauri/README-zh_CN.md#MacOS%E5%B8%B8%E8%A7%81%E9%97%AE%E9%A2%98))
- MacOS intel芯片: x64.dmg
- MacOS apple M芯片: aarch64.dmg
### Linux
- Linux 64位: amd64.deb/amd64.rpm
- Linux arm64架构: arm64.deb/aarch64.rpm
### Windows (Win7 用户请确保安装并启用webview2)
#### 正常版本(推荐)
- 64位: x64-setup.exe
- arm64架构: arm64-setup.exe
#### 内置Webview2版(体积较大,仅在企业版系统或Win7无法安装webview2时使用)
- 64位: x64_fixed_webview2-setup.exe
- arm64架构: arm64_fixed_webview2-setup.exe
Created at ${{ env.BUILDTIME }}.
EOF
- name: Upload Release
uses: softprops/action-gh-release@v2
with:
tag_name: alpha
name: 'NVM Desktop Alpha'
body_path: release.txt
draft: false
prerelease: true
token: ${{ secrets.GITHUB_TOKEN }}
generate_release_notes: true