@@ -209,6 +209,74 @@ jobs:
209209 needs : [build-arm64, build-armv7, build-universal]
210210
211211 steps :
212+ - name : Checkout repository
213+ uses : actions/checkout@v4
214+ with :
215+ fetch-depth : 0
216+
217+ - name : Get previous tag
218+ id : prev_tag
219+ run : |
220+ PREV_TAG=$(git describe --tags --abbrev=0 HEAD^ 2>/dev/null || echo "")
221+ echo "prev_tag=$PREV_TAG" >> $GITHUB_OUTPUT
222+ echo "Previous tag: $PREV_TAG"
223+
224+ - name : Generate Release Notes from PRs
225+ id : release_notes
226+ env :
227+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
228+ run : |
229+ PREV_TAG="${{ steps.prev_tag.outputs.prev_tag }}"
230+ REPO="${{ github.repository }}"
231+
232+ # Get commits since last tag (or all if no previous tag)
233+ if [ -n "$PREV_TAG" ]; then
234+ COMMITS=$(git log ${PREV_TAG}..HEAD --pretty=format:"%H" 2>/dev/null || echo "")
235+ else
236+ COMMITS=$(git log --pretty=format:"%H" 2>/dev/null || echo "")
237+ fi
238+
239+ # Find merged PRs from commits
240+ echo "## What's Changed" > release_notes.md
241+ echo "" >> release_notes.md
242+
243+ PR_FOUND=false
244+ for COMMIT in $COMMITS; do
245+ # Get PR number from commit (if merged via PR)
246+ PR_DATA=$(gh api "repos/${REPO}/commits/${COMMIT}/pulls" --jq '.[0] | {number, title, user: .user.login, html_url}' 2>/dev/null || echo "")
247+
248+ if [ -n "$PR_DATA" ] && [ "$PR_DATA" != "null" ]; then
249+ PR_NUM=$(echo "$PR_DATA" | jq -r '.number')
250+ PR_TITLE=$(echo "$PR_DATA" | jq -r '.title')
251+ PR_USER=$(echo "$PR_DATA" | jq -r '.user')
252+ PR_URL=$(echo "$PR_DATA" | jq -r '.html_url')
253+
254+ # Check if already added (avoid duplicates)
255+ if ! grep -q "#${PR_NUM}" release_notes.md 2>/dev/null; then
256+ echo "* ${PR_TITLE} by @${PR_USER} in [#${PR_NUM}](${PR_URL})" >> release_notes.md
257+ PR_FOUND=true
258+ fi
259+ fi
260+ done
261+
262+ if [ "$PR_FOUND" = false ]; then
263+ echo "* Various improvements and bug fixes" >> release_notes.md
264+ fi
265+
266+ echo "" >> release_notes.md
267+
268+ # Add full changelog link
269+ if [ -n "$PREV_TAG" ]; then
270+ echo "**Full Changelog**: https://github.com/${REPO}/compare/${PREV_TAG}...v${{ needs.build-arm64.outputs.version }}" >> release_notes.md
271+ fi
272+
273+ # Output for use in release body
274+ {
275+ echo 'notes<<EOF'
276+ cat release_notes.md
277+ echo 'EOF'
278+ } >> $GITHUB_OUTPUT
279+
212280 - name : Download all APKs
213281 uses : actions/download-artifact@v4
214282 with :
@@ -226,6 +294,10 @@ jobs:
226294 body : |
227295 ## Huawei Manager v${{ needs.build-arm64.outputs.version }}
228296
297+ ${{ steps.release_notes.outputs.notes }}
298+
299+ ---
300+
229301 ### Downloads
230302 - **arm64-v8a** - For modern 64-bit devices (recommended)
231303 - **armeabi-v7a** - For older 32-bit devices
@@ -250,6 +322,10 @@ jobs:
250322 body : |
251323 ## Huawei Manager ${{ github.event.inputs.version }}
252324
325+ ${{ steps.release_notes.outputs.notes }}
326+
327+ ---
328+
253329 ### Downloads
254330 - **arm64-v8a** - For modern 64-bit devices (recommended)
255331 - **armeabi-v7a** - For older 32-bit devices
0 commit comments