diff --git a/.github/workflows/release-tauri.yml b/.github/workflows/release-tauri.yml index fab870bd..462635cd 100644 --- a/.github/workflows/release-tauri.yml +++ b/.github/workflows/release-tauri.yml @@ -254,16 +254,32 @@ jobs: # 所以单一 `tauri build` 永远拿不到 NSIS 的 .exe.sig。 # Pass 1:NSIS 独立跑——必须成功,产出 *_x64-setup.exe(.sig) 给 updater。 # Pass 2:MSI 独立跑——允许失败,Repair 步骤兜底 light.exe 重链。 + # Beta 版跳过 MSI:Windows Installer / WiX 无法表示 `1.2.3-Beta.1` + # 这类非纯数字 prerelease 标识,稳定版仍然照常产出 MSI。 if [ -n "${TAURI_SIGNING_PRIVATE_KEY:-}" ]; then npm run tauri -- build --bundles nsis --config '{"bundle":{"createUpdaterArtifacts":true}}' nsis_exit=$? - npm run tauri -- build --bundles msi --config '{"bundle":{"createUpdaterArtifacts":true}}' - msi_exit=$? + if [ "${OPENLESS_RELEASE_CHANNEL:-stable}" = "beta" ]; then + echo "OPENLESS_SKIP_WINDOWS_MSI=1" >> "$GITHUB_ENV" + echo "[info] Skipping MSI bundle for beta release channel." + msi_exit=0 + else + echo "OPENLESS_SKIP_WINDOWS_MSI=0" >> "$GITHUB_ENV" + npm run tauri -- build --bundles msi --config '{"bundle":{"createUpdaterArtifacts":true}}' + msi_exit=$? + fi else npm run tauri -- build --bundles nsis nsis_exit=$? - npm run tauri -- build --bundles msi - msi_exit=$? + if [ "${OPENLESS_RELEASE_CHANNEL:-stable}" = "beta" ]; then + echo "OPENLESS_SKIP_WINDOWS_MSI=1" >> "$GITHUB_ENV" + echo "[info] Skipping MSI bundle for beta release channel." + msi_exit=0 + else + echo "OPENLESS_SKIP_WINDOWS_MSI=0" >> "$GITHUB_ENV" + npm run tauri -- build --bundles msi + msi_exit=$? + fi fi echo "TAURI_BUILD_EXIT=$msi_exit" >> "$GITHUB_ENV" # NSIS 是 updater 的硬依赖,挂了就直接 fail step。 @@ -283,6 +299,10 @@ jobs: working-directory: 'openless-all/app' run: | $exitCode = $env:TAURI_BUILD_EXIT + if ($env:OPENLESS_SKIP_WINDOWS_MSI -eq '1') { + Write-Host "[ok] Skipping MSI repair for beta release channel." + return + } $appRoot = (Resolve-Path .).Path $msi = Get-ChildItem "src-tauri\target\release\bundle\msi\*.msi" -ErrorAction SilentlyContinue | Select-Object -First 1 if ($msi) { @@ -329,13 +349,17 @@ jobs: working-directory: 'openless-all/app' run: | $nsis = Get-ChildItem "src-tauri\target\release\bundle\nsis\*.exe" -ErrorAction Stop | Select-Object -First 1 - $msi = Get-ChildItem "src-tauri\target\release\bundle\msi\*.msi" -ErrorAction Stop | Select-Object -First 1 if (-not $nsis) { throw "NSIS installer not found." } - if (-not $msi) { throw "MSI installer not found." } powershell.exe -NoProfile -ExecutionPolicy Bypass -File .\scripts\windows-ime-install-smoke.ps1 -InstallerPath $nsis.FullName -InstallerKind nsis if ($LASTEXITCODE -ne 0) { throw "NSIS installer smoke failed with exit $LASTEXITCODE" } + if ($env:OPENLESS_SKIP_WINDOWS_MSI -eq '1') { + Write-Host "[ok] Skipping MSI smoke for beta release channel." + return + } + $msi = Get-ChildItem "src-tauri\target\release\bundle\msi\*.msi" -ErrorAction Stop | Select-Object -First 1 + if (-not $msi) { throw "MSI installer not found." } powershell.exe -NoProfile -ExecutionPolicy Bypass -File .\scripts\windows-ime-install-smoke.ps1 -InstallerPath $msi.FullName -InstallerKind msi if ($LASTEXITCODE -ne 0) { throw "MSI installer smoke failed with exit $LASTEXITCODE"