Skip to content

Commit 6b19c8d

Browse files
committed
chore: extract WebView2 runtime directly to src-tauri directory
1 parent 16bac84 commit 6b19c8d

1 file changed

Lines changed: 8 additions & 19 deletions

File tree

.github/workflows/release.yml

Lines changed: 8 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -163,14 +163,20 @@ jobs:
163163
- name: Prepare WebView2 Fixed Runtime
164164
shell: pwsh
165165
run: |
166-
# Create WebView2 configuration file
166+
# Download WebView2 Runtime
167+
invoke-webrequest -uri https://github.com/westinyang/WebView2RuntimeArchive/releases/download/109.0.1518.78/Microsoft.WebView2.FixedVersionRuntime.109.0.1518.78.${{ matrix.arch }}.cab -outfile Microsoft.WebView2.FixedVersionRuntime.109.0.1518.78.${{ matrix.arch }}.cab
168+
169+
# Extract WebView2 Runtime to src-tauri directory
170+
Expand .\Microsoft.WebView2.FixedVersionRuntime.109.0.1518.78.${{ matrix.arch }}.cab -F:* ./src-tauri
171+
172+
# Create WebView2 configuration file
167173
$webviewConfigContent = @"
168174
{
169175
"bundle": {
170176
"windows": {
171177
"webviewInstallMode": {
172178
"type": "fixedRuntime",
173-
"path": "./webview2-runtime/${{ matrix.arch }}/"
179+
"path": "./Microsoft.WebView2.FixedVersionRuntime.109.0.1518.78.${{ matrix.arch }}/"
174180
}
175181
}
176182
},
@@ -193,23 +199,6 @@ jobs:
193199
194200
# Save configuration file
195201
New-Item -Path "src-tauri" -Name "tauri.windows.conf.json" -ItemType "file" -Value $webviewConfigContent -Force
196-
197-
# Download WebView2 runtime
198-
mkdir -p src-tauri/webview2-runtime/${{ matrix.arch }}
199-
200-
# Choose download link based on architecture
201-
if ("${{ matrix.arch }}" -eq "x64") {
202-
Invoke-WebRequest -Uri "https://github.com/westinyang/WebView2RuntimeArchive/releases/download/109.0.1518.78/Microsoft.WebView2.FixedVersionRuntime.109.0.1518.78.x64.cab" -OutFile "webview2-runtime.cab"
203-
} else {
204-
Invoke-WebRequest -Uri "https://github.com/westinyang/WebView2RuntimeArchive/releases/download/109.0.1518.78/Microsoft.WebView2.FixedVersionRuntime.109.0.1518.78.arm64.cab" -OutFile "webview2-runtime.cab"
205-
}
206-
207-
cmd /c "expand webview2-runtime.cab -F:* .\src-tauri\webview2-runtime\${{ matrix.arch }}\"
208-
209-
# Verify files existence
210-
if (Test-Path -Path "src-tauri/webview2-runtime/${{ matrix.arch }}") {
211-
Write-Host "WebView2 Runtime directory created successfully"
212-
}
213202
214203
# Build with tauri action but without uploading artifacts
215204
- name: Build Tauri App

0 commit comments

Comments
 (0)