Skip to content

Commit 671a65f

Browse files
committed
Merge branch 'dev': 校验发布资产完整性
2 parents 5fe2571 + f01dc6b commit 671a65f

1 file changed

Lines changed: 24 additions & 0 deletions

File tree

‎.github/workflows/release.yml‎

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,3 +240,27 @@ jobs:
240240
--region cn-hangzhou \
241241
--ObjectPath "$OBJECTS" \
242242
--Area domestic
243+
244+
# ---------------------------------------------------------------
245+
# 发布结果校验:“空 Release”已静默发生过两次(v0.27.0 因 macOS 腿
246+
# 拖垮构建、v0.28.7 因 workflow 解析失败),而两次都是事后手工才
247+
# 发现的——此时 electron-updater 拉不到 latest.yml,自动更新静默断链。
248+
# 此步骤使该故障在 CI 中即时暴露。
249+
# ---------------------------------------------------------------
250+
- name: Verify release assets
251+
if: startsWith(github.ref, 'refs/tags/')
252+
env:
253+
GH_TOKEN: ${{ github.token }}
254+
TAG: ${{ github.ref_name }}
255+
run: |
256+
set -eo pipefail
257+
names=$(gh release view "$TAG" --json assets --jq '.assets[].name')
258+
echo "Assets of $TAG:"
259+
echo "$names"
260+
for required in '\.exe$' '\.exe\.blockmap$' '^latest\.yml$'; do
261+
if ! echo "$names" | grep -qE "$required"; then
262+
echo "::error::Release $TAG 缺少匹配 $required 的资产,自动更新将不可用"
263+
exit 1
264+
fi
265+
done
266+
echo "发布资产完整校验通过"

0 commit comments

Comments
 (0)