@@ -56,39 +56,36 @@ jobs:
5656 go run scripts/bench_analyzer.go >> $GITHUB_ENV
5757 echo "EOF" >> $GITHUB_ENV
5858
59- - name : Create GitHub Release
59+ # Prepare combined release notes
60+ - name : Prepare Release Notes
6061 if : startsWith(github.ref, 'refs/tags/v')
61- id : create_release
62- uses : softprops/action-gh-release@v1
63- with :
64- name : ${{ github.ref_name }}
65- generate_release_notes : true
62+ run : |
63+ # 1. Generate standard GitHub release notes (What's Changed, Contributors, etc.)
64+ GEN_NOTES=$(gh api repos/${{ github.repository }}/releases/generate-notes -f tag_name=${{ github.ref_name }} --jq .body)
65+
66+ # 2. Build the final body
67+ echo "RELEASE_BODY<<EOF" >> $GITHUB_ENV
68+ echo "$GEN_NOTES" >> $GITHUB_ENV
69+ echo "" >> $GITHUB_ENV
70+ echo "## Installation" >> $GITHUB_ENV
71+ echo "\`\`\`bash" >> $GITHUB_ENV
72+ echo "go get github.com/${{ github.repository }}@${{ github.ref_name }}" >> $GITHUB_ENV
73+ echo "\`\`\`" >> $GITHUB_ENV
74+ echo "" >> $GITHUB_ENV
75+ echo "## Performance Benchmarks" >> $GITHUB_ENV
76+ echo "\`\`\`text" >> $GITHUB_ENV
77+ echo "${{ env.BENCH_REPORT }}" >> $GITHUB_ENV
78+ echo "\`\`\`" >> $GITHUB_ENV
79+ echo "EOF" >> $GITHUB_ENV
6680 env :
6781 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
6882
69- - name : Append Details to Release
83+ - name : Create GitHub Release
7084 if : startsWith(github.ref, 'refs/tags/v')
71- run : |
72- # Get the current release body (auto-generated notes)
73- CURRENT_BODY=$(gh release view ${{ github.ref_name }} --json body -q .body)
74-
75- # Construct the new body: Notes -> Installation -> Benchmarks
76- NEW_BODY=$(cat <<EOF
77- $CURRENT_BODY
78-
79- ## Installation
80- \`\`\`bash
81- go get github.com/${{ github.repository }}@${{ github.ref_name }}
82- \`\`\`
83-
84- ## Performance Benchmarks
85- \`\`\`text
86- ${{ env.BENCH_REPORT }}
87- \`\`\`
88- EOF
89- )
90-
91- # Update the release
92- gh release edit ${{ github.ref_name }} --notes "$NEW_BODY"
85+ uses : softprops/action-gh-release@v1
86+ with :
87+ name : ${{ github.ref_name }}
88+ body : ${{ env.RELEASE_BODY }}
89+ generate_release_notes : false
9390 env :
9491 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
0 commit comments