Skip to content

Commit 0455c10

Browse files
committed
feat: add configuration for automatically generated release notes and enhance GitHub release command
1 parent c57fde3 commit 0455c10

2 files changed

Lines changed: 47 additions & 5 deletions

File tree

.github/release.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Configuration for automatically generated release notes
2+
# https://docs.github.com/en/repositories/releasing-projects-on-github/automatically-generated-release-notes
3+
4+
changelog:
5+
exclude:
6+
labels:
7+
- ignore-for-release
8+
authors:
9+
- dependabot
10+
- github-actions[bot]
11+
categories:
12+
- title: 🚀 Features
13+
labels:
14+
- enhancement
15+
- feature
16+
- title: 🐛 Bug Fixes
17+
labels:
18+
- bug
19+
- fix
20+
- title: 📚 Documentation
21+
labels:
22+
- documentation
23+
- docs
24+
- title: 🔧 Maintenance
25+
labels:
26+
- chore
27+
- maintenance
28+
- dependencies
29+
- title: 📦 Other Changes
30+
labels:
31+
- "*"

.github/workflows/publish-maven.yml

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -153,10 +153,21 @@ jobs:
153153
export VERSION GROUP_ID ARTIFACT_ID
154154
RELEASE_NOTES=$(envsubst < .github/workflows/notes.template)
155155
156-
gh release create "v${VERSION}" \
157-
${{ inputs.prerelease == true && '--prerelease' || '' }} \
158-
--title "Copilot Java SDK ${VERSION}" \
159-
--notes "${RELEASE_NOTES}" \
160-
--generate-notes
156+
# Get the previous tag for generating notes
157+
PREV_TAG=$(git describe --tags --abbrev=0 HEAD^ 2>/dev/null || echo "")
158+
159+
# Build the gh release command
160+
GH_ARGS=("v${VERSION}")
161+
GH_ARGS+=("--title" "Copilot Java SDK ${VERSION}")
162+
GH_ARGS+=("--notes" "${RELEASE_NOTES}")
163+
GH_ARGS+=("--generate-notes")
164+
165+
if [ -n "$PREV_TAG" ]; then
166+
GH_ARGS+=("--notes-start-tag" "$PREV_TAG")
167+
fi
168+
169+
${{ inputs.prerelease == true && 'GH_ARGS+=("--prerelease")' || '' }}
170+
171+
gh release create "${GH_ARGS[@]}"
161172
env:
162173
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)