From a95a0bbdd8b73a949fd1a10ef7a595b6686aa424 Mon Sep 17 00:00:00 2001 From: rockbenben Date: Tue, 20 Oct 2026 17:45:39 +0800 Subject: [PATCH] fix(ci): fail the release when a publish step fails The two publish steps were not checked for a non-zero exit code. A native command that fails does not abort a pwsh script, so a failed first publish followed by a successful second one ended the step green, and the release went out without the self-contained build. The updater only accepts the self-contained build, so that release is one no installed app could ever update from, and nothing in the pipeline says so. The missing asset is something a person has to notice by hand. The check is the same one 033-windowshuttle already has. --- .github/workflows/ci.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e93449b..850efb3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -72,11 +72,18 @@ jobs: shell: pwsh run: | $v = "${{ github.ref_name }}" -replace '^v', '' # tag v1.0.0 -> assembly version 1.0.0 + # ⚠️ **原生命令的非零退出不会中断 pwsh**,所以每次 publish 之后都要显式判一次。 + # 少了这个判断,「第一个 publish 失败 + 第二个成功」会以绿灯收场, + # release 里就少了自包含那份 zip —— 而更新器只认自包含那份, + # 装好的应用于是永远拿不到更新,只能靠人看出来少了资产。 + # 同一条判据见 033-windowshuttle 的 ci.yml。 dotnet publish src/QuickText.App -c Release -p:PublishProfile=win-x64 -p:Version=$v --nologo + if ($LASTEXITCODE) { exit $LASTEXITCODE } # Both profiles share bin/obj and differ in runtimeconfig.json (self-contained pins the # framework); publishing the second straight after the first regenerates it correctly — # verified by running the framework-dependent exe with --smoke, so no rebuild is needed. dotnet publish src/QuickText.App -c Release -p:PublishProfile=win-x64-needs-dotnet10 -p:Version=$v --nologo + if ($LASTEXITCODE) { exit $LASTEXITCODE } - name: Package + SHA256 shell: pwsh run: |