|
8 | 8 | permissions: |
9 | 9 | contents: write |
10 | 10 |
|
| 11 | +# WebView2 Fixed Version Runtime — bundled into the Windows zip for |
| 12 | +# machines without Edge / WebView2 Runtime installed. |
| 13 | +# Archive source: https://github.com/westinyang/WebView2RuntimeArchive |
| 14 | +# To update: pick a newer release tag and change the version below. |
| 15 | +env: |
| 16 | + WEBVIEW2_VERSION: "133.0.3065.92" |
| 17 | + |
11 | 18 | jobs: |
12 | 19 | build: |
13 | 20 | strategy: |
@@ -39,20 +46,37 @@ jobs: |
39 | 46 |
|
40 | 47 | - name: Build Tauri app (Windows) |
41 | 48 | if: matrix.os == 'windows-latest' |
42 | | - run: npx tauri build --target ${{ matrix.target }} --bundles nsis |
| 49 | + run: npx tauri build --target ${{ matrix.target }} |
43 | 50 |
|
44 | 51 | - name: Build Tauri app (macOS) |
45 | 52 | if: matrix.os == 'macos-latest' |
46 | 53 | run: npx tauri build --target ${{ matrix.target }} --bundles app |
47 | 54 |
|
| 55 | + - name: Download WebView2 Fixed Version Runtime |
| 56 | + if: matrix.os == 'windows-latest' |
| 57 | + shell: pwsh |
| 58 | + run: | |
| 59 | + $cabUrl = "https://github.com/westinyang/WebView2RuntimeArchive/releases/download/${{ env.WEBVIEW2_VERSION }}/Microsoft.WebView2.FixedVersionRuntime.${{ env.WEBVIEW2_VERSION }}.x64.cab" |
| 60 | + Invoke-WebRequest -Uri $cabUrl -OutFile webview2.cab |
| 61 | + mkdir runtime-extract |
| 62 | + expand webview2.cab -F:* runtime-extract |
| 63 | + # The cab extracts to a versioned subfolder — rename to "runtime" |
| 64 | + $subdir = Get-ChildItem runtime-extract -Directory | Select-Object -First 1 |
| 65 | + if ($subdir) { |
| 66 | + Move-Item $subdir.FullName "runtime" |
| 67 | + } else { |
| 68 | + Rename-Item "runtime-extract" "runtime" |
| 69 | + } |
| 70 | +
|
48 | 71 | - name: Prepare Windows artifact |
49 | 72 | if: matrix.os == 'windows-latest' |
50 | | - shell: bash |
| 73 | + shell: pwsh |
51 | 74 | run: | |
52 | | - cp "src-tauri/target/${{ matrix.target }}/release/yauz.exe" "YAUZ-windows-x64.exe" |
53 | | - NSIS_DIR="src-tauri/target/${{ matrix.target }}/release/bundle/nsis" |
54 | | - SETUP_FILE=$(ls "$NSIS_DIR"/*-setup.exe 2>/dev/null | head -1) |
55 | | - cp "$SETUP_FILE" "YAUZ-windows-x64-setup.exe" |
| 75 | + $stageDir = "YAUZ-windows-x64" |
| 76 | + mkdir $stageDir |
| 77 | + Copy-Item "src-tauri/target/${{ matrix.target }}/release/yauz.exe" "$stageDir/yauz.exe" |
| 78 | + Copy-Item -Recurse "runtime" "$stageDir/runtime" |
| 79 | + Compress-Archive -Path "$stageDir/*" -DestinationPath "YAUZ-windows-x64.zip" |
56 | 80 |
|
57 | 81 | - name: Prepare macOS artifact |
58 | 82 | if: matrix.os == 'macos-latest' |
|
64 | 88 | uses: softprops/action-gh-release@v2.6.1 |
65 | 89 | with: |
66 | 90 | files: | |
67 | | - YAUZ-windows-x64.exe |
68 | | - YAUZ-windows-x64-setup.exe |
| 91 | + YAUZ-windows-x64.zip |
69 | 92 | YAUZ-macos-arm64.zip |
0 commit comments