本次发布聚焦降低误报风险、规范发布产物和重构仓库文档。 主要变更: - 删除开机自启功能,移除 Windows 启动项注册表写入逻辑。 - 新增标准应用清单,声明应用以普通用户权限运行。 - 新增 framework-dependent 发布脚本,保持发布包不内置 .NET 运行时。 - 禁用单文件、自解压、裁剪和 ReadyToRun 发布方式,保持产物结构透明。 - 将发布资产命名规范化为 omni-notify-v0.2.0-win-x64.zip。 - 重写文档结构:README.md 面向用户,docs/development.md 面向开发者。 - 删除过时且内容重复的 PRD.md 与 docs/usage.md。 验证: - dotnet build .\OmniNotify.csproj -c Release 构建通过。 - 发布脚本成功生成 v0.2.0 win-x64 压缩包。 - 发布目录未包含 coreclr.dll、hostfxr.dll、hostpolicy.dll 等 .NET 运行时文件。
61 lines
1.7 KiB
PowerShell
61 lines
1.7 KiB
PowerShell
param(
|
|
[string]$Configuration = "Release",
|
|
[string]$Version = "0.2.0",
|
|
[string]$RuntimeIdentifier = "win-x64"
|
|
)
|
|
|
|
$ErrorActionPreference = "Stop"
|
|
|
|
$repoRoot = Split-Path -Parent $PSScriptRoot
|
|
$publishProfile = "FolderProfile"
|
|
$publishDir = Join-Path $repoRoot "bin\$Configuration\net8.0-windows\$RuntimeIdentifier\publish"
|
|
$artifactsDir = Join-Path $repoRoot "artifacts"
|
|
$zipPath = Join-Path $artifactsDir "omni-notify-v$Version-$RuntimeIdentifier.zip"
|
|
|
|
Set-Location $repoRoot
|
|
|
|
function Invoke-DotNet {
|
|
param([string[]]$Arguments)
|
|
|
|
& dotnet @Arguments
|
|
if ($LASTEXITCODE -ne 0) {
|
|
throw "dotnet $($Arguments -join ' ') failed with exit code $LASTEXITCODE"
|
|
}
|
|
}
|
|
|
|
Invoke-DotNet @("restore", ".\OmniNotify.csproj")
|
|
Invoke-DotNet @("clean", ".\OmniNotify.csproj", "-c", $Configuration)
|
|
Invoke-DotNet @(
|
|
"publish",
|
|
".\OmniNotify.csproj",
|
|
"-c",
|
|
$Configuration,
|
|
"-r",
|
|
$RuntimeIdentifier,
|
|
"--self-contained",
|
|
"false",
|
|
"-p:PublishProfile=$publishProfile",
|
|
"-p:Version=$Version"
|
|
)
|
|
|
|
$runtimeFiles = @("coreclr.dll", "clrjit.dll", "hostfxr.dll", "hostpolicy.dll")
|
|
$bundledRuntime = Get-ChildItem -Path $publishDir -Recurse -File |
|
|
Where-Object { $runtimeFiles -contains $_.Name }
|
|
|
|
if ($bundledRuntime) {
|
|
$names = ($bundledRuntime | Select-Object -ExpandProperty Name) -join ", "
|
|
throw "Publish output appears to include .NET runtime files: $names"
|
|
}
|
|
|
|
if (!(Test-Path $artifactsDir)) {
|
|
New-Item -ItemType Directory -Path $artifactsDir | Out-Null
|
|
}
|
|
|
|
if (Test-Path $zipPath) {
|
|
Remove-Item $zipPath
|
|
}
|
|
|
|
Compress-Archive -Path (Join-Path $publishDir "*") -DestinationPath $zipPath -CompressionLevel Optimal
|
|
|
|
Write-Host "Created $zipPath"
|