From 336b7dd8e0b76536b343274a5f9daed45d26c6be Mon Sep 17 00:00:00 2001 From: liyp Date: Sat, 12 Apr 2025 17:08:09 +0800 Subject: [PATCH] =?UTF-8?q?Release=20v1.4.5=20=E6=B5=8B=E8=AF=95=E7=94=9F?= =?UTF-8?q?=E6=88=90readme.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/AutoRelease.yaml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/.gitea/workflows/AutoRelease.yaml b/.gitea/workflows/AutoRelease.yaml index 74f3989..124787a 100644 --- a/.gitea/workflows/AutoRelease.yaml +++ b/.gitea/workflows/AutoRelease.yaml @@ -206,6 +206,34 @@ jobs: echo "$REPO_NAME" > README.md fi + - name: 获取版本发布时间线 + id: timeline + run: | + # 获取提交记录 + COMMITS=$(git log --pretty=format:"- %ad - Commit: %s (%h)" --date=iso-strict) + # 获取版本发布记录 + RELEASES=$(curl -s "https:///api/v1/repos/${{ github.repository }}/releases" | jq -r '.[] | "- \(.published_at) - Release: \(.name) (\(.tag_name))"') + # 合并并按时间排序 + COMBINED_TIMELINE=$(echo -e "$COMMITS\n$RELEASES" | sort -r) + echo "::set-output name=timeline::$COMBINED_TIMELINE" + + - name: 将提交记录和release记录输出到readme + run: | + if [ -f "README.md" ]; then + TEMP=$(cat README.md) + { + echo "### Repository Timeline" + echo "${{ steps.timeline.outputs.timeline }}" + echo "" + echo "$TEMP" + } > README.md + else + { + echo "### Repository Timeline" + echo "${{ steps.timeline.outputs.timeline }}" + } > README.md + fi + - name: 提交和推送代码 run: | git add README.md