Skip to content

Commit 5030123

Browse files
authored
Feature/update release notes (#20)
* new format for release notes * update changelog with commit messages
1 parent f739eda commit 5030123

File tree

2 files changed

+29
-16
lines changed

2 files changed

+29
-16
lines changed

.github/release.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
changelog:
2+
categories:
3+
- title: New Features
4+
labels:
5+
- feature
6+
- enhancement
7+
- title: Bug Fixes
8+
labels:
9+
- bug
10+
- fix
11+
- bugfix
12+
- title: Other Changes
13+
labels:
14+
- '*'
15+
exclude:
16+
labels:
17+
- dependencies
18+
- automation

.github/workflows/deploy.yml

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
- name: Checkout git repo
1717
uses: actions/checkout@v4
1818
with:
19-
fetch-depth: 0 # Fetch all history for proper release notes
19+
fetch-depth: 0 # Fetch all history for release notes
2020

2121
- name: Install Node and NPM
2222
uses: actions/setup-node@v4
@@ -51,23 +51,18 @@ jobs:
5151
- name: Create Release
5252
if: steps.version_check.outputs.versionChanged == 'true'
5353
run: |
54-
# Get the previous version tag
55-
PREV_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "")
54+
# Get the previous version tag or initial commit
55+
PREV_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo $(git rev-list --max-parents=0 HEAD))
56+
CURR_TAG="v${{ steps.version_check.outputs.rawVersion }}"
5657
57-
if [ -z "$PREV_TAG" ]; then
58-
# If no previous tag exists, use the first commit
59-
PREV_COMMIT=$(git rev-list --max-parents=0 HEAD)
60-
COMMIT_RANGE="$PREV_COMMIT..HEAD"
61-
else
62-
COMMIT_RANGE="$PREV_TAG..HEAD"
63-
fi
58+
# Generate simple release notes with commit messages
59+
NOTES=$(git log --pretty=format:"* %s" $PREV_TAG..HEAD --no-merges)
60+
echo "## What's Changed" > release_notes.md
61+
echo "" >> release_notes.md
62+
echo "$NOTES" >> release_notes.md
6463
65-
# Generate release notes with commit messages
66-
RELEASE_NOTES=$(echo -e "## What's Changed\n\n")
67-
RELEASE_NOTES+=$(git log $COMMIT_RANGE --pretty=format:"* %s" --no-merges)
68-
69-
# Create release with the generated notes
70-
gh release create "v${{ steps.version_check.outputs.rawVersion }}" --notes "$RELEASE_NOTES"
64+
# Create the release with notes
65+
gh release create "$CURR_TAG" --notes-file release_notes.md
7166
env:
7267
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7368

0 commit comments

Comments
 (0)