Files
LanMountainDesktop/.github/VERSION_SYNC_INFO.md
2026-08-11 19:41:54 +08:00

1.7 KiB
Raw Permalink Blame History

版本同步说明

目标

发布版的用户可见版本必须统一指向“应用版本”,不能再出现:

  • Launcher UI 显示 1.0.0
  • 应用设置页显示 0.8.x
  • version.json、安装包、Release 资产名称各写各的

默认仓库状态

仓库内的静态版本现在故意保留为开发占位值:

  • Directory.Build.props
  • desktop/LanMountainDesktop/LanMountainDesktop.csproj
  • desktop/LanMountainDesktop.Launcher/LanMountainDesktop.Launcher.csproj
  • core/LanMountainDesktop.Core/LanMountainDesktop.Core.csproj
  • desktop/LanMountainDesktop/app.manifest
  • desktop/LanMountainDesktop.Launcher/app.manifest

这些值只是提醒“当前不是正式注入构建”,不能代表发布版本。

Release 工作流怎么做

Release 工作流会先从 tag 提取版本:

  • v0.8.5.2 -> 0.8.5.2
  • 程序集四段版本 -> 0.8.5.2

随后显式执行:

  • scripts/Set-ReleaseVersion.ps1

这个步骤会同步更新:

  • 主程序 .csprojVersion
  • Launcher .csprojVersion
  • Core .csprojVersion
  • Directory.Build.props
  • 主程序 app.manifest
  • Launcher app.manifest

之后构建和发布阶段继续通过 MSBuild 属性注入:

  • Version
  • AssemblyVersion
  • FileVersion
  • InformationalVersion

因此最终会统一落到:

  • Launcher UI 读取到的应用版本
  • 应用设置页显示的版本
  • version.json
  • 程序集文件版本
  • Windows manifest
  • 安装包版本
  • GitHub Release 资产名称

维护规则

  • 日常开发不要手动把仓库默认版本改成正式版本号。
  • 正式发版只需要打 tag版本同步交给工作流。
  • 如果新增新的版本承载点,必须同时补到 Set-ReleaseVersion.ps1 和 Release 工作流里。