From 05c3d0270bd8ce837c67e9be32ebcd21b988d954 Mon Sep 17 00:00:00 2001
From: liyp <liyp@jarue.com>
Date: Thu, 10 Apr 2025 16:49:32 +0800
Subject: [PATCH] =?UTF-8?q?=E8=87=AA=E5=8A=A8=E7=89=88=E6=9C=AC=E5=8F=91?=
 =?UTF-8?q?=E5=B8=83?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 .gitea/workflows/AutoGenerateREADME.yaml | 39 ++++++------------------
 1 file changed, 10 insertions(+), 29 deletions(-)

diff --git a/.gitea/workflows/AutoGenerateREADME.yaml b/.gitea/workflows/AutoGenerateREADME.yaml
index 6a2661a..b09122c 100644
--- a/.gitea/workflows/AutoGenerateREADME.yaml
+++ b/.gitea/workflows/AutoGenerateREADME.yaml
@@ -1,4 +1,4 @@
-name: 自动生成README.md文件
+name: 自动版本发布
 
 on:
   push:
@@ -9,7 +9,7 @@ jobs:
   create-readme:
     runs-on: ubuntu-latest
 
-    if: "!contains(github.event.head_commit.message, 'AutoGenerateREADME.md')"
+    if: "!contains(github.event.head_commit.message, 'AutoRelease.md')"
     
     steps:
       - name: 删除本地仓库副本
@@ -29,35 +29,16 @@ jobs:
           CLEAN_REPO_URL="${CLEAN_REPO_URL#https://}"
           git clone "https://${GITEA_TOKEN}@${CLEAN_REPO_URL}" .
 
-      - name: 创建README.md
+      - name: 生成版本号
+        id: version
         run: |
-          if [ -f README.md ]; then
-            rm README.md
-          fi
+          VERSION=$(date +'%Y%m%d%H%M%S')
+          echo "version=$VERSION" >> $GITHUB_OUTPUT
 
-      - name: 生成提交历史记录
-        id: commit-history
+      - name: 创建 Release
         run: |
-          COMMIT_HISTORY=$(git log --pretty=format:"- %cd %h %an: %s" --date=short)
-          echo "::set-output name=commit_history::$COMMIT_HISTORY"
-
-      - name: 生成Release历史记录
-        id: release-history
-        run: |
-          RELEASE_HISTORY=$(gh release list --limit 100 --json tagName,publishedAt,body --template '{{range .}}- {{.publishedAt}} {{.tagName}}: {{.body}}{{"\n"}}{{end}}')
-          echo "::set-output name=release_history::$RELEASE_HISTORY"
-
-      - name: 将提交和Release记录添加到README.md
-        run: |
-          {
-            echo
-            echo "# 提交历史记录"
-            echo "${{ steps.commit-history.outputs.commit_history }}"
-            echo
-            echo "# Release历史记录"
-            echo "${{ steps.release-history.outputs.release_history }}"
-          } >> README.md
-
+          gh release create v${{ steps.version.outputs.version }} --generate-notes
+          
       - name: 重新提交仓库
         env:
           GITEA_TOKEN: ${{ secrets.AUTOGENERATE }}
@@ -71,6 +52,6 @@ jobs:
           if git diff --staged --quiet; then
             echo "No changes to commit."
           else
-            git commit -m "AutoGenerateREADME.md"
+            git commit -m "AutoRelease.md"
             git push "https://${GITEA_TOKEN}@${CLEAN_REPO_URL}"
           fi
\ No newline at end of file