|
4 | 4 | # |
5 | 5 | # VelaShell.PluginSdk 契约程序集(插件与宿主唯一共享的类型) |
6 | 6 | # VelaShell.PluginSdk.Testing 测试替身(TestPluginContext 与各能力内存实现) |
7 | | -# VelaShell.PluginSdk.Build 插件工程**只需引用的那一个包**(targets + 打包器 + 依赖锁) |
| 7 | +# VelaShell.PluginSdk.Build 插件构建支持(targets + 打包器 + 宿主 UI 版本校验) |
8 | 8 | # |
9 | 9 | # .Build 于 2026-09-11 从 velashell-plugin-cli 搬来。它对契约包是 ProjectReference, |
10 | 10 | # 因此传给插件工程的那份契约永远就是本仓库这一版 —— 原先"引用哪一版契约"那个跨仓库 |
|
27 | 27 | # 下面的 Stamp 步骤只改 runner 上的工作区,**不回写仓库**:产物版本号因此永远等于 |
28 | 28 | # Release 标签,与仓库里当时提交了什么无关。忘了第 ② 步的兜底是 CI 的版本同步体检。 |
29 | 29 | # |
30 | | -# ⚠️ Avalonia 版本锁:本仓库是整个插件生态里这个版本号的**权威**。改 VelaAvaloniaVersion |
31 | | -# 等于改插件生态的 Avalonia 版本 —— 必须与宿主同一波发布,并且**同一个提交里**把 |
32 | | -# src/VelaShell.PluginSdk.Build 的两处副本(csproj 上那条精确区间、build/*.props 里的 |
33 | | -# 同名默认值)一起改掉,否则构建期的 VELA1000 / VELA1006 会红。 |
34 | | -# |
35 | 30 | # 推送用 **NuGet Trusted Publishing(OIDC)**,不存 API Key: |
36 | 31 | # NuGet/login 拿本次运行的 GitHub OIDC 令牌去 nuget.org 换一把**短时效**的推送密钥, |
37 | 32 | # 用完即弃。密钥不落仓库机密,也就没有"泄漏了要轮换"这件事。 |
@@ -156,37 +151,6 @@ jobs: |
156 | 151 | } |
157 | 152 | Get-ChildItem artifacts/nuget | Select-Object -ExpandProperty Name |
158 | 153 |
|
159 | | - # 本仓库是 Avalonia 版本锁的**权威**,而这个事实传给**宿主**的唯一通道就是包里那一个 |
160 | | - # buildTransitive props 文件(宿主的 VerifyAvaloniaMatchesSdk 读它)。它没打进包也不会 |
161 | | - # 让 pack 失败,所以拆开核对一遍。 |
162 | | - # (.Build 现在同仓库,直接读 $(VelaAvaloniaVersion),不走这条通道 —— 见其 |
163 | | - # VerifyAvaloniaVersionPin。所以这一步守的是宿主那一侧。) |
164 | | - - name: Verify the pin props shipped in the package |
165 | | - shell: pwsh |
166 | | - run: | |
167 | | - $version = '${{ steps.version.outputs.version }}' |
168 | | - $nupkg = "artifacts/nuget/VelaShell.PluginSdk.$version.nupkg" |
169 | | - if (-not (Test-Path $nupkg)) { throw "Package not found: $nupkg" } |
170 | | - $work = Join-Path $env:RUNNER_TEMP 'pinprops' |
171 | | - Remove-Item -Recurse -Force $work -ErrorAction SilentlyContinue |
172 | | - New-Item -ItemType Directory -Force $work | Out-Null |
173 | | - # Expand-Archive 只认 .zip 扩展名,.nupkg 直接喂给它会被拒;先复制一份改名。 |
174 | | - $zip = Join-Path $work 'pkg.zip' |
175 | | - Copy-Item $nupkg $zip |
176 | | - Expand-Archive -Path $zip -DestinationPath (Join-Path $work 'x') |
177 | | - $props = Join-Path $work 'x/buildTransitive/VelaShell.PluginSdk.props' |
178 | | - if (-not (Test-Path $props)) { |
179 | | - throw "buildTransitive/VelaShell.PluginSdk.props is missing from the package. The VelaShell host reads the pinned Avalonia version from it; without it the host loses its only consistency check against this SDK." |
180 | | - } |
181 | | - $text = Get-Content -Raw $props |
182 | | - $expected = [regex]::Match((Get-Content -Raw Directory.Build.props), '<VelaAvaloniaVersion>([^<]+)</VelaAvaloniaVersion>').Groups[1].Value |
183 | | - $shipped = [regex]::Match($text, '<VelaSdkPinnedAvaloniaVersion>([^<]+)</VelaSdkPinnedAvaloniaVersion>').Groups[1].Value |
184 | | - if ($shipped -ne $expected) { |
185 | | - throw "Package ships VelaSdkPinnedAvaloniaVersion '$shipped' but Directory.Build.props says '$expected'." |
186 | | - } |
187 | | - Write-Host "Pinned Avalonia = $shipped, SDK package version = $version" |
188 | | - Write-Host $text |
189 | | -
|
190 | 154 | # 端到端冒烟:拿刚打出的包,站在插件作者的位置上走一遍 |
191 | 155 | # (最小插件工程 → 还原 → 构建 → 出 .vpx → 读回容器 → 查共享程序集有没有漏)。 |
192 | 156 | # 夹具在 tests/smoke/,细节见 scripts/Invoke-Smoke.ps1 的注释。 |
|
0 commit comments