Skip to content

Commit 759cb18

Browse files
committed
ci: 在 GitHub Release 页面显示 changelog 内容
1 parent 62cf883 commit 759cb18

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

.github/workflows/release.yml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,13 +124,25 @@ jobs:
124124

125125
- run: pnpm install
126126

127+
- name: Extract changelog for current version
128+
id: changelog
129+
run: |
130+
VERSION="${{ steps.get-tag.outputs.tag }}"
131+
VERSION="${VERSION#v}" # Remove 'v' prefix
132+
# Extract content between current version and next version header
133+
CHANGELOG=$(awk "/^## ${VERSION}$/,/^## [0-9]/" CHANGELOG.md | sed '1d;$d')
134+
# Handle multi-line output
135+
echo "content<<EOF" >> $GITHUB_OUTPUT
136+
echo "$CHANGELOG" >> $GITHUB_OUTPUT
137+
echo "EOF" >> $GITHUB_OUTPUT
138+
127139
- uses: tauri-apps/tauri-action@v0
128140
env:
129141
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
130142
with:
131143
tagName: ${{ steps.get-tag.outputs.tag }}
132144
releaseName: ${{ steps.get-tag.outputs.tag }}
133-
releaseBody: "See [CHANGELOG](https://github.com/${{ github.repository }}/blob/main/CHANGELOG.md) for details."
145+
releaseBody: ${{ steps.changelog.outputs.content }}
134146
releaseDraft: false
135147
prerelease: false
136148
args: --target ${{ matrix.target }}

0 commit comments

Comments
 (0)