v1.1.1: 构建修复,优化警告,新增自动脚本

This commit is contained in:
雾启工作室
2026-06-28 09:51:56 +08:00
parent 4b797a982d
commit 6bddb75904
7 changed files with 138 additions and 8 deletions

43
scripts/build-release.ps1 Normal file
View File

@@ -0,0 +1,43 @@
# Better-EN5 自动构建与发布脚本
param(
[string]$Version = "1.1.0",
[switch]$Push
)
$ErrorActionPreference = "Stop"
$dotnet = "C:\Program Files\dotnet\dotnet.exe"
$repoDir = Split-Path -Parent $PSScriptRoot
echo $ENV:output_folder
# 设置 PATH
$env:Path = "C:\Program Files\dotnet;C:\Program Files\Git\bin;$env:Path"
Write-Host "=== Better-EN5 构建脚本 ===" -ForegroundColor Cyan
Write-Host "版本: $Version" -ForegroundColor White
Write-Host ""
# 1. 构建
Write-Host "[1/3] 构建项目..." -ForegroundColor Yellow
& $dotnet build -c Release "$repoDir\Better-EN5"
if (-not $?) { Write-Host "构建失败" -ForegroundColor Red; exit 1 }
Write-Host "构建成功" -ForegroundColor Green
# 2. 安装到希沃白板
Write-Host "[2/3] 安装到希沃白板..." -ForegroundColor Yellow
& "$repoDir\scripts\install.ps1" -BuildConfig Release
if (-not $?) { Write-Host "安装失败" -ForegroundColor Red; exit 1 }
Write-Host "安装成功" -ForegroundColor Green
# 3. Git 提交与推送
if ($Push) {
Write-Host "[3/3] 推送至远程仓库..." -ForegroundColor Yellow
Set-Location $repoDir
git add -A
git commit -m "v$Version: 自动构建发布"
git tag "v$Version"
git push origin main --tags
Write-Host "推送成功" -ForegroundColor Green
}
Write-Host ""
Write-Host "=== 完成 ===" -ForegroundColor Green
Write-Host "安装文件: $repoDir\bin\Release\Better-Seewo 增强插件.$Version.exe" -ForegroundColor Cyan