diff --git a/.github/workflows/release-tauri.yml b/.github/workflows/release-tauri.yml index bd4124d5..a452a714 100644 --- a/.github/workflows/release-tauri.yml +++ b/.github/workflows/release-tauri.yml @@ -214,20 +214,55 @@ jobs: Write-Host "[ok] built $dll (exported $($t.EnvName))" } - # ── Windows:仅 Windows 跑通用 tauri build(Linux 用下方专用 step,避免重复构建)── + # ── Windows:跑 tauri build;如果失败,从 appRoot 手动调 light.exe 重链 + # (mirror 本地 windows-package-msvc.ps1::Repair-TauriMsiBundle)。 + # 根因:openless-ime.wxs 用相对路径 src-tauri\target\... 引 IME DLL, + # Tauri wix bundler 内部 cwd 不固定,light 找不到文件;本地脚本通过把 + # light 从 openless-all/app/ 跑一遍来 resolve。issue: rounds 1-3 reaches + # same dead end via Tauri-only bundling. - name: Build (Windows) if: matrix.platform == 'windows-latest' - shell: bash + shell: pwsh working-directory: 'openless-all/app' env: TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }} TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }} run: | - if [ -n "${TAURI_SIGNING_PRIVATE_KEY:-}" ]; then - npm run tauri -- build --config '{"bundle":{"createUpdaterArtifacts":true}}' - else - npm run tauri build - fi + $appRoot = (Resolve-Path .).Path + if ($env:TAURI_SIGNING_PRIVATE_KEY) { + & npm run tauri -- build --config '{"bundle":{"createUpdaterArtifacts":true}}' + } else { + & npm run tauri build + } + $tauriExit = $LASTEXITCODE + + $msi = Get-ChildItem "src-tauri\target\release\bundle\msi\*.msi" -ErrorAction SilentlyContinue | Select-Object -First 1 + if (-not $msi -and $tauriExit -ne 0) { + Write-Warning "Tauri MSI failed (exit $tauriExit). Trying manual light.exe relink from app root." + $wixRoot = Join-Path $appRoot "src-tauri\target\release\wix\x64" + $mainObj = Join-Path $wixRoot "main.wixobj" + $imeObj = Join-Path $wixRoot "openless-ime.wixobj" + $locale = Join-Path $wixRoot "locale.wxl" + foreach ($p in @($mainObj, $imeObj, $locale)) { + if (-not (Test-Path $p)) { throw "Required WiX object missing: $p" } + } + $light = (Get-ChildItem "$env:LOCALAPPDATA\tauri\WixTools314\light.exe" -ErrorAction SilentlyContinue | Select-Object -First 1).FullName + if (-not $light) { throw "WiX light.exe not found in $env:LOCALAPPDATA\tauri\WixTools314" } + $version = (Get-Content src-tauri\tauri.conf.json -Raw | ConvertFrom-Json).version + $bundleDir = Join-Path $appRoot "src-tauri\target\release\bundle\msi" + New-Item -ItemType Directory -Force -Path $bundleDir | Out-Null + $msiPath = Join-Path $bundleDir "OpenLess_${version}_x64_en-US.msi" + Push-Location $appRoot + try { + & $light -nologo -ext WixUIExtension -ext WixUtilExtension -loc $locale -out $msiPath $mainObj $imeObj + if ($LASTEXITCODE -ne 0) { throw "light.exe relink failed with exit $LASTEXITCODE" } + } finally { + Pop-Location + } + Write-Host "[ok] MSI rebuilt at $msiPath" + } elseif ($tauriExit -ne 0) { + throw "Tauri build failed with exit $tauriExit and no recoverable wixobj." + } # ── Linux:产 deb / rpm / AppImage ── - name: Build (Linux) diff --git a/openless-all/app/package-lock.json b/openless-all/app/package-lock.json index d082a3b9..19aec24c 100644 --- a/openless-all/app/package-lock.json +++ b/openless-all/app/package-lock.json @@ -1,12 +1,12 @@ { "name": "openless-app", - "version": "1.2.14", + "version": "1.2.15", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "openless-app", - "version": "1.2.14", + "version": "1.2.15", "dependencies": { "@tauri-apps/api": "^2.1.1", "@tauri-apps/plugin-autostart": "^2.5.1", diff --git a/openless-all/app/package.json b/openless-all/app/package.json index efab67f3..71cb8905 100644 --- a/openless-all/app/package.json +++ b/openless-all/app/package.json @@ -1,7 +1,7 @@ { "name": "openless-app", "private": true, - "version": "1.2.14", + "version": "1.2.15", "type": "module", "scripts": { "dev": "vite", diff --git a/openless-all/app/src-tauri/Cargo.lock b/openless-all/app/src-tauri/Cargo.lock index 9e4ca497..f96af718 100644 --- a/openless-all/app/src-tauri/Cargo.lock +++ b/openless-all/app/src-tauri/Cargo.lock @@ -3281,7 +3281,7 @@ dependencies = [ [[package]] name = "openless" -version = "1.2.14" +version = "1.2.15" dependencies = [ "anyhow", "arboard", diff --git a/openless-all/app/src-tauri/Cargo.toml b/openless-all/app/src-tauri/Cargo.toml index 5983378e..a2892206 100644 --- a/openless-all/app/src-tauri/Cargo.toml +++ b/openless-all/app/src-tauri/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "openless" -version = "1.2.14" +version = "1.2.15" description = "OpenLess — local voice input that types where your cursor is" authors = ["OpenLess"] edition = "2021" diff --git a/openless-all/app/src-tauri/tauri.conf.json b/openless-all/app/src-tauri/tauri.conf.json index 30cff677..16a81215 100644 --- a/openless-all/app/src-tauri/tauri.conf.json +++ b/openless-all/app/src-tauri/tauri.conf.json @@ -1,7 +1,7 @@ { "$schema": "https://schema.tauri.app/config/2", "productName": "OpenLess", - "version": "1.2.14", + "version": "1.2.15", "identifier": "com.openless.app", "build": { "beforeDevCommand": "npm run dev", diff --git a/openless-all/app/src-tauri/wix/openless-ime.wxs b/openless-all/app/src-tauri/wix/openless-ime.wxs index 027c22b1..f7571a1b 100644 --- a/openless-all/app/src-tauri/wix/openless-ime.wxs +++ b/openless-all/app/src-tauri/wix/openless-ime.wxs @@ -5,12 +5,12 @@ - + - +