@@ -137,79 +137,6 @@ jobs:
137137 echo "mod_jar=$MOD_JAR" >> "$GITHUB_OUTPUT"
138138 ls -lh "$MOD_JAR"
139139
140- - name : 生成更新日志
141- id : changelog
142- shell : bash
143- run : |
144- set -euo pipefail
145- TAG="${{ steps.version.outputs.tag }}"
146- PREV_TAG="$(git describe --tags --abbrev=0 2>/dev/null || true)"
147-
148- {
149- echo "## 更新内容"
150- echo
151-
152- if [[ -n "$PREV_TAG" ]]; then
153- echo "自 \`$PREV_TAG\` 以来的变更:"
154- echo
155- RANGE="${PREV_TAG}..HEAD"
156- else
157- echo "初始版本发布说明:"
158- echo
159- RANGE="HEAD"
160- fi
161-
162- mapfile -t COMMITS < <(git log $RANGE --pretty=format:'%s|%h' --no-merges)
163-
164- if [[ ${#COMMITS[@]} -eq 0 || -z "${COMMITS[0]:-}" ]]; then
165- echo "_此版本无提交记录。_"
166- else
167- declare -A SECTIONS
168- SECTIONS[feat]="### 新功能"
169- SECTIONS[fix]="### Bug 修复"
170- SECTIONS[refactor]="### 重构"
171- SECTIONS[perf]="### 性能优化"
172- SECTIONS[docs]="### 文档"
173- SECTIONS[chore]="### 杂项"
174- SECTIONS[other]="### 其他变更"
175-
176- declare -A BUCKETS
177- for key in feat fix refactor perf docs chore other; do
178- BUCKETS[$key]=""
179- done
180-
181- for line in "${COMMITS[@]}"; do
182- subject="${line%%|*}"
183- hash="${line##*|}"
184- if [[ "$subject" =~ ^(feat|fix|refactor|perf|docs|chore|ver|update)(\([^)]+\))?(!)?:[[:space:]]*(.+)$ ]]; then
185- type="${BASH_REMATCH[1]}"
186- body="${BASH_REMATCH[4]}"
187- case "$type" in
188- ver|update) type="chore" ;;
189- esac
190- BUCKETS[$type]+="- ${body}(\`${hash}\`)"$'\n'
191- else
192- BUCKETS[other]+="- ${subject}(\`${hash}\`)"$'\n'
193- fi
194- done
195-
196- for key in feat fix refactor perf docs chore other; do
197- if [[ -n "${BUCKETS[$key]}" ]]; then
198- echo "${SECTIONS[$key]}"
199- echo
200- printf '%s' "${BUCKETS[$key]}"
201- echo
202- fi
203- done
204- fi
205-
206- echo
207- echo "**完整变更日志**: https://github.com/${{ github.repository }}/compare/${PREV_TAG:-$(git rev-list --max-parents=0 HEAD)}...${TAG}"
208- } > release_notes.md
209-
210- echo "----- 更新日志 -----"
211- cat release_notes.md
212-
213140 - name : 创建标签
214141 shell : bash
215142 run : |
@@ -225,7 +152,7 @@ jobs:
225152 with :
226153 tag_name : ${{ steps.version.outputs.tag }}
227154 name : AccountsX ${{ steps.version.outputs.version }}
228- body_path : release_notes.md
155+ body : Action构建。
229156 draft : ${{ inputs.draft }}
230157 prerelease : ${{ inputs.prerelease }}
231158 files : |
0 commit comments