uses: tauri-apps/tauri-action@v0 # ❌ 使用过时版本问题:
@v0是一个非常老的版本(可能是 Tauri 1.x 时代)- 最新版本应该是
@v0.5.x或更高 - 旧版本可能不支持 Tauri 2.x 的新特性和配置
修复:
uses: tauri-apps/tauri-action@v0.5 # ✅ 更新到稳定版本从 prebuild.mjs 看到需要下载多个关键组件:
verge-mihomo(核心代理引擎)verge-mihomo-alphaclash-verge-service(系统服务)sysproxy.exe(系统代理设置)enableLoopback.exe(UWP 工具)- 其他地理位置数据文件
潜在问题:
- 网络下载失败:GitHub Actions 环境可能无法访问某些下载地址
- 下载超时:大文件下载可能超时失败
- 文件损坏:下载的二进制文件可能不完整
- 权限问题:下载的文件可能没有执行权限
# release.yml 和 autobuild.yml 中:
- name: Download WebView2 Runtime
run: |
# 下载 WebView2 运行时
invoke-webrequest -uri https://github.com/westinyang/WebView2RuntimeArchive/releases/download/109.0.1518.78/Microsoft.WebView2.FixedVersionRuntime.109.0.1518.78.${{ matrix.arch }}.cab
# ❌ 问题:替换配置文件
Remove-Item .\src-tauri\tauri.windows.conf.json
Rename-Item .\src-tauri\webview2.${{ matrix.arch }}.json tauri.windows.conf.json问题:动态替换配置文件可能导致配置不一致
# windows-personal.yml 没有签名配置
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# ❌ 缺少签名相关环境变量
# 而 release.yml 有完整签名配置
env:
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }}
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }}# windows-personal.yml
args: --target x86_64-pc-windows-msvc -b nsis --config src-tauri/tauri.personal.conf.json
# autobuild.yml
args: --target ${{ matrix.target }} # ❌ 没有指定配置文件path: |
src-tauri/target/x86_64-pc-windows-msvc/release/bundle/nsis/*.exe
src-tauri/target/x86_64-pc-windows-msvc/release/bundle/msi/*.msi潜在问题:如果构建失败或文件名不匹配,上传的 artifacts 可能为空
- 更新 Tauri Action 版本
- name: Build app (x64 NSIS)
uses: tauri-apps/tauri-action@v0.5 # 更新版本- 添加 prebuild 验证步骤
- name: Verify sidecar binaries
run: |
Get-ChildItem -Path "src-tauri/sidecar/" -Recurse
Get-ChildItem -Path "src-tauri/resources/" -Recurse- 统一构建配置
- name: Build app (x64 NSIS)
uses: tauri-apps/tauri-action@v0.5
with:
tauriScript: pnpm
args: --target x86_64-pc-windows-msvc -b nsis --config src-tauri/tauri.personal.conf.json
# 添加调试输出
includeDebug: true- 改进错误处理
- name: Download sidecar binaries (x64)
run: |
pnpm run prebuild x86_64-pc-windows-msvc
# 验证关键文件存在
if (!(Test-Path "src-tauri/sidecar/verge-mihomo-*")) {
throw "Critical sidecar binary missing"
}- 添加构建后验证
- name: Verify build artifacts
run: |
$artifacts = Get-ChildItem -Path "src-tauri/target/" -Recurse -Include "*.exe" | Where-Object { $_.Name -like "*setup*" }
if ($artifacts.Count -eq 0) {
throw "No setup executable found"
}
foreach ($artifact in $artifacts) {
Write-Host "Found: $($artifact.FullName) ($(($artifact.Length/1MB).ToString('F1')) MB)"
}在 GitHub Actions 中查找:
- ❌
prebuild步骤是否有下载失败 - ❌
Tauri build步骤是否有编译错误 - ❌
List artifacts是否显示空结果
# 1. 清理环境
rm -rf src-tauri/target/
rm -rf src-tauri/sidecar/
rm -rf src-tauri/resources/
# 2. 重新下载依赖
pnpm run prebuild x86_64-pc-windows-msvc
# 3. 本地构建
pnpm build --target x86_64-pc-windows-msvc
# 4. 检查输出
ls -la src-tauri/target/x86_64-pc-windows-msvc/release/bundle/nsis/基于分析,最可能的原因是:
- Sidecar 二进制文件下载失败 - 应用程序缺少核心组件
- Tauri Action 版本过旧 - 不兼容当前配置
- 构建过程中的静默失败 - 没有适当的错误检查
建议优先级:
- 🔥 检查 GitHub Actions 构建日志中的
prebuild步骤 - 🔥 更新
tauri-action到最新稳定版本 - 🔥 添加构建验证步骤
⚠️ 统一所有 workflow 的配置