Skip to content

Commit f11dfec

Browse files
committed
perf: change build action for win
1 parent ce7447d commit f11dfec

2 files changed

Lines changed: 118 additions & 84 deletions

File tree

.github/workflows/build.yml

Lines changed: 50 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88
branches:
99
- master
1010
tags:
11-
- 'v*' # 只有正式版本标签才触发构建
11+
- "v*" # 只有正式版本标签才触发构建
1212

1313
env:
1414
# Tauri 自动更新签名密钥
@@ -30,15 +30,15 @@ jobs:
3030
runs-on: ubuntu-latest
3131
outputs:
3232
go-client-artifacts: ${{ steps.upload-go-client.outputs.artifact-name }}
33-
33+
3434
steps:
3535
- name: Check out git repository
3636
uses: actions/checkout@v4
3737

3838
- name: Setup Go
3939
uses: actions/setup-go@v4
4040
with:
41-
go-version: '1.21'
41+
go-version: "1.21"
4242

4343
- name: Build Go client for all platforms
4444
run: make build-all
@@ -75,7 +75,7 @@ jobs:
7575
- name: Setup Go
7676
uses: actions/setup-go@v4
7777
with:
78-
go-version: '1.25'
78+
go-version: "1.25"
7979

8080
- name: Install Go client for current platform
8181
run: make install
@@ -87,8 +87,8 @@ jobs:
8787
- name: Setup Node.js
8888
uses: actions/setup-node@v4
8989
with:
90-
node-version: '23'
91-
cache: 'pnpm'
90+
node-version: "23"
91+
cache: "pnpm"
9292

9393
- name: Install system dependencies (Ubuntu)
9494
if: matrix.os == 'ubuntu-latest'
@@ -101,6 +101,18 @@ jobs:
101101
run: |
102102
brew install create-dmg
103103
104+
- name: Install WiX Toolset (Windows)
105+
if: matrix.os == 'windows-latest'
106+
run: |
107+
# Download and install WiX Toolset
108+
Invoke-WebRequest -Uri "https://github.com/wixtoolset/wix3/releases/download/wix3141rtm/wix314-binaries.zip" -OutFile "wix.zip"
109+
Expand-Archive -Path "wix.zip" -DestinationPath "C:\WixTools"
110+
# Add WiX to PATH
111+
echo "C:\WixTools" | Out-File -FilePath $env:GITHUB_PATH -Append
112+
# Set WIX environment variable
113+
echo "WIX=C:\WixTools" | Out-File -FilePath $env:GITHUB_ENV -Append
114+
# Verify installation
115+
C:\WixTools\candle.exe -?
104116
105117
- name: Install Rust
106118
uses: dtolnay/rust-toolchain@stable
@@ -122,15 +134,37 @@ jobs:
122134
123135
- name: Install Tauri CLI
124136
run: cargo install tauri-cli@^2.0
137+
env:
138+
# Ensure WiX is available for Tauri CLI
139+
WIX: C:\WixTools
140+
WIX_ROOT: C:\WixTools
125141

126142
- name: Install frontend dependencies
127143
run: pnpm install
128144

129145
- name: Build frontend
130146
run: pnpm generate
131147

148+
- name: Verify WiX installation (Windows)
149+
if: matrix.os == 'windows-latest'
150+
run: |
151+
echo "Verifying WiX installation..."
152+
C:\WixTools\candle.exe -?
153+
C:\WixTools\light.exe -?
154+
echo "WiX tools are working correctly"
155+
132156
- name: Build Tauri app
133-
run: pnpm tauri:build
157+
run: |
158+
# Set additional environment variables for Windows build
159+
if (Test-Path "C:\WixTools") {
160+
$env:WIX = "C:\WixTools"
161+
$env:WIX_ROOT = "C:\WixTools"
162+
$env:PATH = "C:\WixTools;$env:PATH"
163+
echo "WiX environment variables set"
164+
echo "WIX: $env:WIX"
165+
echo "PATH includes WiX: $($env:PATH -like '*WixTools*')"
166+
}
167+
pnpm tauri:build
134168
env:
135169
TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }}
136170
TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }}
@@ -141,6 +175,9 @@ jobs:
141175
P12_PASSWORD: ${{ secrets.CSC_KEY_PASSWORD }}
142176
CSC_LINK: ${{ secrets.CSC_LINK }}
143177
CSC_KEY_PASSWORD: ${{ secrets.CSC_KEY_PASSWORD }}
178+
# Windows-specific environment variables
179+
WIX: C:\WixTools
180+
WIX_ROOT: C:\WixTools
144181

145182
- name: Upload artifacts
146183
uses: actions/upload-artifact@v4
@@ -160,7 +197,7 @@ jobs:
160197
runs-on: ubuntu-latest
161198
needs: [pre-build, build]
162199
if: startsWith(github.ref, 'refs/tags/')
163-
200+
164201
steps:
165202
- name: Check out git repository
166203
uses: actions/checkout@v4
@@ -186,6 +223,10 @@ jobs:
186223
"url": "https://github.com/jumpserver/clients/releases/download/${{ github.ref_name }}/JumpServerClient_${{ github.ref_name }}_aarch64.dmg"
187224
},
188225
"windows-x86_64": {
226+
"signature": "",
227+
"url": "https://github.com/jumpserver/clients/releases/download/${{ github.ref_name }}/JumpServerClient_${{ github.ref_name }}_x64.exe"
228+
},
229+
"windows-x86_64-msi": {
189230
"signature": "",
190231
"url": "https://github.com/jumpserver/clients/releases/download/${{ github.ref_name }}/JumpServerClient_${{ github.ref_name }}_x64.msi"
191232
}
@@ -201,6 +242,6 @@ jobs:
201242
artifacts/macos-14-app/*.dmg
202243
artifacts/macos-14-app/*.app
203244
artifacts/windows-latest-app/*.msi
245+
artifacts/windows-latest-app/*.exe
204246
env:
205247
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
206-

src-tauri/tauri.conf.json

Lines changed: 68 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -1,77 +1,70 @@
11
{
2-
"bundle": {
3-
"active": true,
4-
"targets": ["dmg", "msi"],
5-
"icon": [
6-
"icons/icon.ico",
7-
"icons/icon.icns"
8-
],
9-
"resources": [
10-
"resources/bin/"
11-
],
12-
"externalBin": [],
13-
"copyright": "",
14-
"category": "DeveloperTool",
15-
"shortDescription": "",
16-
"longDescription": "",
17-
"macOS": {},
18-
"windows": {
19-
"certificateThumbprint": null,
20-
"digestAlgorithm": "sha256",
21-
"timestampUrl": "",
22-
"webviewInstallMode": {
23-
"type": "embedBootstrapper"
24-
},
25-
"nsis": {
26-
"installMode": "both"
27-
}
28-
},
29-
"linux": {
30-
"deb": {},
31-
"rpm": {}
32-
}
33-
},
34-
"build": {
35-
"beforeBuildCommand": "pnpm generate",
36-
"frontendDist": "../dist",
37-
"beforeDevCommand": "pnpm dev",
38-
"devUrl": "http://localhost:3000"
39-
},
40-
"productName": "JumpServerClient",
41-
"version": "3.1.0",
42-
"identifier": "",
43-
"plugins": {
44-
"updater": {
45-
"pubkey": "dW50cnVzdGVkIGNvbW1lbnQ6IG1pbmlzaWduIHB1YmxpYyBrZXk6IDQ0NDhCRUVCN0Y5M0UwMTcKUldRWDRKTi82NzVJUkh2cW5xeUtKYTRZYkErU1ZPZkNramNXMjlRQWVmdnVtVEY0dk5RcDIvZ2IK",
46-
"endpoints": [
47-
"https://github.com/jumpserver/clients/releases/latest/download/latest.json"
48-
]
49-
}
50-
},
51-
"app": {
52-
"macOSPrivateApi": true,
53-
"windows": [
54-
{
55-
"title": "",
56-
"width": 1000,
57-
"height": 600,
58-
"minWidth": 800,
59-
"minHeight": 480,
60-
"resizable": true,
61-
"fullscreen": false,
62-
"transparent": true,
63-
"decorations": true,
64-
"titleBarStyle": "Overlay",
65-
"trafficLightPosition": {
66-
"x": 10,
67-
"y": 27
68-
}
69-
}
70-
],
71-
"security": {
72-
"csp": null,
73-
"dangerousDisableAssetCspModification": true
74-
},
75-
"withGlobalTauri": false
76-
}
2+
"bundle": {
3+
"active": true,
4+
"targets": ["dmg", "msi", "nsis"],
5+
"icon": ["icons/icon.ico", "icons/icon.icns"],
6+
"resources": ["resources/bin/"],
7+
"externalBin": [],
8+
"copyright": "",
9+
"category": "DeveloperTool",
10+
"shortDescription": "",
11+
"longDescription": "",
12+
"macOS": {},
13+
"windows": {
14+
"certificateThumbprint": null,
15+
"digestAlgorithm": "sha256",
16+
"timestampUrl": "",
17+
"webviewInstallMode": {
18+
"type": "embedBootstrapper"
19+
},
20+
"nsis": {
21+
"installMode": "both"
22+
}
23+
},
24+
"linux": {
25+
"deb": {},
26+
"rpm": {}
27+
}
28+
},
29+
"build": {
30+
"beforeBuildCommand": "pnpm generate",
31+
"frontendDist": "../dist",
32+
"beforeDevCommand": "pnpm dev",
33+
"devUrl": "http://localhost:3000"
34+
},
35+
"productName": "JumpServerClient",
36+
"version": "3.1.0",
37+
"identifier": "",
38+
"plugins": {
39+
"updater": {
40+
"pubkey": "dW50cnVzdGVkIGNvbW1lbnQ6IG1pbmlzaWduIHB1YmxpYyBrZXk6IDQ0NDhCRUVCN0Y5M0UwMTcKUldRWDRKTi82NzVJUkh2cW5xeUtKYTRZYkErU1ZPZkNramNXMjlRQWVmdnVtVEY0dk5RcDIvZ2IK",
41+
"endpoints": ["https://github.com/jumpserver/clients/releases/latest/download/latest.json"]
42+
}
43+
},
44+
"app": {
45+
"macOSPrivateApi": true,
46+
"windows": [
47+
{
48+
"title": "",
49+
"width": 1000,
50+
"height": 600,
51+
"minWidth": 800,
52+
"minHeight": 480,
53+
"resizable": true,
54+
"fullscreen": false,
55+
"transparent": true,
56+
"decorations": true,
57+
"titleBarStyle": "Overlay",
58+
"trafficLightPosition": {
59+
"x": 10,
60+
"y": 27
61+
}
62+
}
63+
],
64+
"security": {
65+
"csp": null,
66+
"dangerousDisableAssetCspModification": true
67+
},
68+
"withGlobalTauri": false
69+
}
7770
}

0 commit comments

Comments
 (0)