fix: Release 先建说明再单独挂上压缩包

压缩包为空时这次发布失败,避免页面上只有说明没有安装包。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
叫我小杨同学andCursor committed 2026-09-23 17:43:36 +08:00
1 parent 255f4fec5e
commit d1de2cc7c8
1 file changed
+4 -2
+4 -2
View File
@@ -41,13 +41,15 @@ jobs:
if git rev-parse -q --verify "refs/tags/${tag}^{}" >/dev/null; then
commit="$(git rev-parse "refs/tags/${tag}^{}")"
git archive --format=zip --prefix="dsh-purge-${version}/" --output="$zip" "$commit"
gh release create "$tag" "$zip" --title "$tag" --notes-file release-notes.md
gh release create "$tag" --title "$tag" --notes-file release-notes.md
else
git archive --format=zip --prefix="dsh-purge-${version}/" --output="$zip" HEAD
args=(release create "$tag" "$zip" --target "$GITHUB_SHA" --title "$tag" --notes-file release-notes.md)
args=(release create "$tag" --target "$GITHUB_SHA" --title "$tag" --notes-file release-notes.md)
case "$version" in
*beta*|*alpha*|*rc*) args+=(--prerelease) ;;
esac
gh "${args[@]}"
fi
test -s "$zip"
gh release upload "$tag" "$zip" --clobber
echo "published https://github.com/YuJunZhiXue/dsh-purge/releases/tag/${tag}"