Skip to content

Commit

Permalink
feat: Add Fix WebView Runtime Bundle
Browse files Browse the repository at this point in the history
  • Loading branch information
Pylogmon committed Nov 25, 2023
1 parent a9f4488 commit 0eb1c61
Show file tree
Hide file tree
Showing 6 changed files with 164 additions and 16 deletions.
68 changes: 68 additions & 0 deletions .github/workflows/package.yml
Expand Up @@ -216,6 +216,74 @@ jobs:
token: ${{ secrets.TOKEN }}
files: src-tauri/target/${{ matrix.target }}/release/bundle/nsis/*setup*

build-for-windows-fix-webview2-runtime:
needs: change-version
strategy:
fail-fast: false
matrix:
platform: [windows-latest]
target: [x86_64-pc-windows-msvc, i686-pc-windows-msvc, aarch64-pc-windows-msvc]
include:
- os: windows-latest
arch: x64
target: x86_64-pc-windows-msvc
toolchain: stable-x86_64-pc-windows-msvc
- os: windows-latest
arch: x86
target: i686-pc-windows-msvc
toolchain: stable-i686-pc-windows-msvc
- os: windows-latest
arch: arm64
target: aarch64-pc-windows-msvc
toolchain: stable-aarch64-pc-windows-msvc
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/download-artifact@v3
with:
name: source
- name: Setup Nodejs
uses: actions/setup-node@v3
with:
node-version: 19
- name: Install Rust Stable
uses: dtolnay/rust-toolchain@stable
- name: install dependencies
run: |
rustup target add ${{ matrix.target }}
rustup toolchain install --force-non-host ${{ matrix.toolchain }}
- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
version: 8
- name: Install Dependencies
run: pnpm install
- name: Code Format
run: pnpm prettier --write .
- name: Download WebView2 Runtime
run: |
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
Expand .\Microsoft.WebView2.FixedVersionRuntime.109.0.1518.78.${{ matrix.arch }}.cab -F:* ./src-tauri
Remove-Item .\src-tauri\tauri.windows.conf.json
Rename-Item .\src-tauri\webview.${{ matrix.arch }}.json .\src-tauri\tauri.windows.conf.json
- name: Build and Package
run: |
$env:TAURI_PRIVATE_KEY="${{ secrets.TAURI_PRIVATE_KEY }}"
$env:TAURI_KEY_PASSWORD="${{ secrets.TAURI_KEY_PASSWORD }}"
pnpm tauri build -b nsis,updater --target ${{ matrix.target }}
- name: Upload Artifacts
uses: actions/upload-artifact@v3
with:
name: windows_${{ matrix.target }}
path: src-tauri/target/${{ matrix.target }}/release/bundle/nsis/*setup*
if-no-files-found: error
- name: Upload Release
if: startsWith(github.ref, 'refs/tags')
uses: softprops/action-gh-release@v1
with:
body_path: CHANGELOG
token: ${{ secrets.TOKEN }}
files: src-tauri/target/${{ matrix.target }}/release/bundle/nsis/*setup*

build-for-linux:
needs: change-version
strategy:
Expand Down
16 changes: 0 additions & 16 deletions src-tauri/tauri.conf.json
Expand Up @@ -73,22 +73,6 @@
"deb": {
"depends": ["libxdo-dev", "libxcb1", "libxrandr2", "tesseract-ocr"]
},
"windows": {
"certificateThumbprint": null,
"digestAlgorithm": "sha256",
"timestampUrl": "",
"webviewInstallMode": {
"silent": true,
"type": "embedBootstrapper"
},
"nsis": {
"displayLanguageSelector": true,
"installerIcon": "icons/icon.ico",
"license": "../LICENSE",
"installMode": "perMachine",
"languages": ["SimpChinese", "TradChinese", "English"]
}
},
"macOS": {
"entitlements": null,
"exceptionDomain": "",
Expand Down
18 changes: 18 additions & 0 deletions src-tauri/tauri.windows.conf.json
Expand Up @@ -3,6 +3,24 @@
"systemTray": {
"iconPath": "icons/icon.ico",
"iconAsTemplate": true
},
"bundle": {
"windows": {
"certificateThumbprint": null,
"digestAlgorithm": "sha256",
"timestampUrl": "",
"webviewInstallMode": {
"silent": true,
"type": "embedBootstrapper"
},
"nsis": {
"displayLanguageSelector": true,
"installerIcon": "icons/icon.ico",
"license": "../LICENSE",
"installMode": "perMachine",
"languages": ["SimpChinese", "TradChinese", "English"]
}
}
}
}
}
26 changes: 26 additions & 0 deletions src-tauri/webview.arm64.json
@@ -0,0 +1,26 @@
{
"tauri": {
"systemTray": {
"iconPath": "icons/icon.ico",
"iconAsTemplate": true
},
"bundle": {
"windows": {
"certificateThumbprint": null,
"digestAlgorithm": "sha256",
"timestampUrl": "",
"webviewInstallMode": {
"type": "fixedRuntime",
"path": "./Microsoft.WebView2.FixedVersionRuntime.109.0.1518.78.arm64/"
},
"nsis": {
"displayLanguageSelector": true,
"installerIcon": "icons/icon.ico",
"license": "../LICENSE",
"installMode": "perMachine",
"languages": ["SimpChinese", "TradChinese", "English"]
}
}
}
}
}
26 changes: 26 additions & 0 deletions src-tauri/webview.x64.json
@@ -0,0 +1,26 @@
{
"tauri": {
"systemTray": {
"iconPath": "icons/icon.ico",
"iconAsTemplate": true
},
"bundle": {
"windows": {
"certificateThumbprint": null,
"digestAlgorithm": "sha256",
"timestampUrl": "",
"webviewInstallMode": {
"type": "fixedRuntime",
"path": "./Microsoft.WebView2.FixedVersionRuntime.109.0.1518.78.x64/"
},
"nsis": {
"displayLanguageSelector": true,
"installerIcon": "icons/icon.ico",
"license": "../LICENSE",
"installMode": "perMachine",
"languages": ["SimpChinese", "TradChinese", "English"]
}
}
}
}
}
26 changes: 26 additions & 0 deletions src-tauri/webview.x86.json
@@ -0,0 +1,26 @@
{
"tauri": {
"systemTray": {
"iconPath": "icons/icon.ico",
"iconAsTemplate": true
},
"bundle": {
"windows": {
"certificateThumbprint": null,
"digestAlgorithm": "sha256",
"timestampUrl": "",
"webviewInstallMode": {
"type": "fixedRuntime",
"path": "./Microsoft.WebView2.FixedVersionRuntime.109.0.1518.78.x86/"
},
"nsis": {
"displayLanguageSelector": true,
"installerIcon": "icons/icon.ico",
"license": "../LICENSE",
"installMode": "perMachine",
"languages": ["SimpChinese", "TradChinese", "English"]
}
}
}
}
}

0 comments on commit 0eb1c61

Please sign in to comment.