Skip to content

Commit abc2484

Browse files
authored
Fix release workflow with proper notes generation (#212)
1 parent 2a5d82a commit abc2484

1 file changed

Lines changed: 10 additions & 16 deletions

File tree

‎.github/workflows/release.yml‎

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ jobs:
3535
echo "xcode_version=$(xcodebuild -version | head -1)" >> $GITHUB_OUTPUT
3636
echo "swift_version=$(swift --version 2>&1 | head -1)" >> $GITHUB_OUTPUT
3737
- name: Generate Release Notes
38-
id: release_notes
3938
run: |
4039
TAG_NAME="${GITHUB_REF#refs/tags/}"
4140
# Find the previous tag
@@ -44,8 +43,6 @@ jobs:
4443
DOWNLOAD_URL="https://github.com/${REPO}/releases/download/${TAG_NAME}/OpenAttributeGraph.xcframework.zip"
4544
4645
{
47-
echo 'body<<RELEASE_NOTES_EOF'
48-
4946
# Binary Target section first
5047
echo "## Binary Target"
5148
echo ""
@@ -65,25 +62,22 @@ jobs:
6562
echo "- ${{ steps.build_info.outputs.swift_version }}"
6663
echo ""
6764
68-
# What's Changed section
65+
# What's Changed section (auto-generated by GitHub)
6966
if [ -n "$PREV_TAG" ]; then
70-
echo "## What's Changed"
71-
git log "${PREV_TAG}..HEAD" --pretty=format:"* %s by @%an in ${GITHUB_SERVER_URL}/${REPO}/commit/%H" --no-merges
72-
echo ""
73-
echo ""
74-
echo "**Full Changelog**: ${GITHUB_SERVER_URL}/${REPO}/compare/${PREV_TAG}...${TAG_NAME}"
67+
gh api "repos/${REPO}/releases/generate-notes" \
68+
-f tag_name="${TAG_NAME}" \
69+
-f previous_tag_name="${PREV_TAG}" \
70+
--jq '.body'
7571
else
76-
echo "## What's Changed"
77-
git log --pretty=format:"* %s by @%an in ${GITHUB_SERVER_URL}/${REPO}/commit/%H" --no-merges
78-
echo ""
72+
gh api "repos/${REPO}/releases/generate-notes" \
73+
-f tag_name="${TAG_NAME}" \
74+
--jq '.body'
7975
fi
80-
81-
echo 'RELEASE_NOTES_EOF'
82-
} >> "$GITHUB_OUTPUT"
76+
} > release_notes.md
8377
- name: Create Release
8478
uses: ncipollo/release-action@v1
8579
with:
86-
body: ${{ steps.release_notes.outputs.body }}
80+
bodyFile: release_notes.md
8781
allowUpdates: true
8882
artifacts: ".build/Xcode/Frameworks/OpenAttributeGraph.xcframework.zip"
8983
token: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)