chore(build): 更新.gitignore配置和清理Wails临时文件
- 添加dist/目录到.gitignore,用于排除打包输出的绿色免安装版 - 添加Wails打包过程中的临时文件和自动生成文件到.gitignore - 删除build/windows/installer/wails_tools.nsh自动生成文件 - 添加Windows安装器临时目录和Webview2安装文件到忽略列表 feat(docs): 添加万川平台对接文档和产品素材 - 创建万川平台登录到获取模型信息的流程说明文档 - 添加万川平台对接实施计划文档 - 新增产品图片、公司简介图、宣传海报、教程截图、案例展示等素材文件 refactor(runtime): 扩展通知功能类型定义 - 添加NotificationOptions接口定义 - 添加NotificationAction接口定义 - 添加NotificationCategory接口定义 - 扩展通知相关的运行时API类型声明,包括初始化、发送、注册分类等功能
This commit is contained in:
@@ -112,7 +112,20 @@ $env:GOCACHE = (Resolve-Path (Join-Path $repoRoot ".gocache")).Path
|
||||
|
||||
$wailsFallback = if ($WailsPath) { $WailsPath } else { Join-Path $env:USERPROFILE "go\bin\wails.exe" }
|
||||
$wails = Resolve-RequiredTool -Name "wails.exe" -FallbackPath $wailsFallback -InstallHint "Install Wails CLI on the build machine first."
|
||||
$makensis = Resolve-RequiredTool -Name "makensis.exe" -FallbackPath $MakensisPath -InstallHint "Install NSIS on the build machine first, e.g. run as Administrator: choco install nsis -y; or pass -MakensisPath."
|
||||
|
||||
# 自动探测 NSIS 标准安装路径(未在 PATH 时也能找到),优先使用显式传入的 -MakensisPath
|
||||
$makensisFallback = $null
|
||||
$makensisCandidates = @()
|
||||
if ($MakensisPath) { $makensisCandidates += $MakensisPath }
|
||||
$makensisCandidates += @(
|
||||
(Join-Path ${env:ProgramFiles(x86)} "NSIS\makensis.exe"),
|
||||
(Join-Path $env:ProgramFiles "NSIS\makensis.exe"),
|
||||
(Join-Path $env:LOCALAPPDATA "Programs\NSIS\makensis.exe")
|
||||
)
|
||||
foreach ($candidate in $makensisCandidates) {
|
||||
if ($candidate -and (Test-Path -LiteralPath $candidate)) { $makensisFallback = $candidate; break }
|
||||
}
|
||||
$makensis = Resolve-RequiredTool -Name "makensis.exe" -FallbackPath $makensisFallback -InstallHint "Install NSIS on the build machine first, e.g. run as Administrator: choco install nsis -y; or pass -MakensisPath."
|
||||
$npm = Resolve-RequiredTool -Name "npm.cmd" -InstallHint "Install Node.js on the build machine first."
|
||||
$go = Resolve-RequiredTool -Name "go.exe" -InstallHint "Install Go on the build machine first."
|
||||
$pdftoppm = Get-Command "pdftoppm.exe" -ErrorAction SilentlyContinue
|
||||
@@ -149,12 +162,20 @@ try {
|
||||
|
||||
Write-Host "==> Building bundled silk decoder"
|
||||
$silkDecoderOut = Join-Path $binDir "tools\audio\silkdecode.exe"
|
||||
New-Item -ItemType Directory -Force -Path (Split-Path $silkDecoderOut) | Out-Null
|
||||
Push-Location (Join-Path $repoRoot "tools\audio\silkdecode")
|
||||
try {
|
||||
& $go build -trimpath -ldflags "-s -w" -o $silkDecoderOut .
|
||||
} finally {
|
||||
Pop-Location
|
||||
$silkBuilt = $false
|
||||
if (-not (Get-Command gcc -ErrorAction SilentlyContinue)) {
|
||||
Write-Warning "gcc not found; silkdecode requires cgo and will be skipped. Voice message transcoding will be unavailable."
|
||||
} else {
|
||||
New-Item -ItemType Directory -Force -Path (Split-Path $silkDecoderOut) | Out-Null
|
||||
Push-Location (Join-Path $repoRoot "tools\audio\silkdecode")
|
||||
try {
|
||||
$oldCgo = $env:CGO_ENABLED; $env:CGO_ENABLED = "1"
|
||||
& $go build -trimpath -ldflags "-s -w" -o $silkDecoderOut .
|
||||
if ($LASTEXITCODE -eq 0) { $silkBuilt = $true } else { Write-Warning "silkdecode build failed, skipping." }
|
||||
} finally {
|
||||
Pop-Location
|
||||
if ($null -eq $oldCgo) { Remove-Item Env:CGO_ENABLED -ErrorAction SilentlyContinue } else { $env:CGO_ENABLED = $oldCgo }
|
||||
}
|
||||
}
|
||||
|
||||
if ($pdftoppm) {
|
||||
@@ -185,7 +206,11 @@ if (-not $SkipFrontendBuild) {
|
||||
Write-Host "==> Building frontend"
|
||||
Push-Location (Join-Path $repoRoot "frontend")
|
||||
try {
|
||||
& $npm run build
|
||||
# 原生命令往 stderr 写警告会在 Stop 策略下被误判为失败,这里改按退出码判断
|
||||
$oldEap = $ErrorActionPreference; $ErrorActionPreference = "Continue"
|
||||
& $npm run build 2>&1 | ForEach-Object { "$_" }
|
||||
$ErrorActionPreference = $oldEap
|
||||
if ($LASTEXITCODE -ne 0) { throw "frontend build failed (exit $LASTEXITCODE)" }
|
||||
} finally {
|
||||
Pop-Location
|
||||
}
|
||||
@@ -197,7 +222,11 @@ New-Item -ItemType Directory -Force -Path (Join-Path $runtimeDir "config\knowled
|
||||
New-Item -ItemType Directory -Force -Path (Join-Path $runtimeDir "config\materials") | Out-Null
|
||||
|
||||
Copy-RequiredFile -Source $helperOut -Destination (Join-Path $runtimeDir "helper.exe")
|
||||
Copy-RequiredFile -Source $silkDecoderOut -Destination (Join-Path $runtimeDir "tools\audio\silkdecode.exe")
|
||||
if ($silkBuilt -and (Test-Path -LiteralPath $silkDecoderOut)) {
|
||||
Copy-RequiredFile -Source $silkDecoderOut -Destination (Join-Path $runtimeDir "tools\audio\silkdecode.exe")
|
||||
} else {
|
||||
Write-Warning "silkdecode.exe not bundled (gcc unavailable); voice transcoding disabled in this installer."
|
||||
}
|
||||
if (Test-Path -LiteralPath (Join-Path $binDir "tools\pdf\pdftoppm.exe")) {
|
||||
Copy-RequiredFile -Source (Join-Path $binDir "tools\pdf\pdftoppm.exe") -Destination (Join-Path $runtimeDir "tools\pdf\pdftoppm.exe")
|
||||
}
|
||||
@@ -239,11 +268,17 @@ if (Test-Path -LiteralPath $materialsIndex) {
|
||||
}
|
||||
|
||||
Write-Host "==> Building Wails NSIS installer"
|
||||
& $wails build --nsis -webview2 embed -trimpath
|
||||
$oldEap = $ErrorActionPreference; $ErrorActionPreference = "Continue"
|
||||
& $wails build --nsis -webview2 embed -trimpath 2>&1 | ForEach-Object { "$_" }
|
||||
$ErrorActionPreference = $oldEap
|
||||
|
||||
$installer = Join-Path $binDir "qiweimanager-amd64-installer.exe"
|
||||
if (-not (Test-Path -LiteralPath $installer)) {
|
||||
throw "Installer was not generated: $installer"
|
||||
}
|
||||
|
||||
Write-Host "==> Release complete: $installer"
|
||||
# 添加时间戳到安装包文件名
|
||||
$timestamp = Get-Date -Format "yyyyMMdd_HHmmss"
|
||||
$installerWithTime = Join-Path $binDir "qiweimanager-amd64-installer_$timestamp.exe"
|
||||
Move-Item -LiteralPath $installer -Destination $installerWithTime -Force
|
||||
Write-Host "==> Release complete: $installerWithTime"
|
||||
|
||||
Reference in New Issue
Block a user