Skip to content

Commit 9f3aa72

Browse files
committed
fix: Fix release drafter config and use drafted notes in release workflow
- Fix master drafter: use $NEXT_PATCH_VERSION instead of hardcoded 4.0.0, remove incorrect jline- tag prefix - Fix 3.x drafter: add jline- prefix to tag template to match actual tags - Release workflow now publishes existing draft release if available, falls back to --generate-notes otherwise
1 parent beabe4e commit 9f3aa72

File tree

3 files changed

+17
-7
lines changed

3 files changed

+17
-7
lines changed

.github/release-drafter-3x.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717

1818
# Configuration for Release Drafter for jline-3.x branch
1919
# This configuration is specifically for the 3.x maintenance branch
20-
name-template: $NEXT_PATCH_VERSION
21-
tag-template: $NEXT_PATCH_VERSION
20+
name-template: JLine $NEXT_PATCH_VERSION
21+
tag-template: jline-$NEXT_PATCH_VERSION
2222
version-template: $MAJOR.$MINOR.$PATCH
2323
commitish: jline-3.x
2424

.github/release-drafter.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
# under the License.
1717

1818
# Configuration for Release Drafter: https://github.com/toolmantim/release-drafter
19-
name-template: 4.0.0
20-
tag-template: jline-4.0.0
19+
name-template: JLine $NEXT_PATCH_VERSION
20+
tag-template: $NEXT_PATCH_VERSION
2121
version-template: $MAJOR.$MINOR.$PATCH
2222
commitish: master
2323

.github/workflows/release.yml

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,17 @@ jobs:
108108
exit 1
109109
fi
110110

111-
name=$(./mvx mvn -B -q -DforceStdout --raw-streams help:evaluate -N -Dexpression=project.name)
112111
version=${{ steps.version.outputs.version }}
113-
echo "Creating release \"$name $version\" from tag"
114-
gh release create $version --verify-tag --notes-from-tag --title "$name $version"
112+
113+
# Check if release drafter already created a draft release for this version
114+
draft_tag=$(gh api repos/${{ github.repository }}/releases \
115+
--jq ".[] | select(.draft == true and .tag_name == \"${version}\") | .tag_name" \
116+
2>/dev/null || true)
117+
118+
if [ -n "$draft_tag" ]; then
119+
echo "Publishing existing draft release for $version"
120+
gh release edit "$version" --draft=false --verify-tag --title "JLine $version"
121+
else
122+
echo "No draft release found, creating release for $version"
123+
gh release create "$version" --verify-tag --generate-notes --title "JLine $version"
124+
fi

0 commit comments

Comments
 (0)