33 workflow_dispatch :
44 inputs :
55 tag :
6- description : " Release tag (e.g. v2 .0.6)"
6+ description : " Release tag (e.g. 2 .0.6)"
77 required : true
88 push :
99 branches :
@@ -39,22 +39,23 @@ jobs:
3939
4040 if [ "$EVENT_NAME" = "workflow_dispatch" ]; then
4141 # manual trigger: use the provided tag, always release
42+ # tolerate an optional leading 'v' in the input for convenience
4243 TAG_VERSION="${INPUT_TAG#v}"
4344 if [ "$TAG_VERSION" != "$CURRENT_VERSION" ]; then
4445 echo "::error::Input tag ($TAG_VERSION) does not match pom.xml version ($CURRENT_VERSION)"
4546 exit 1
4647 fi
47- echo "tag=v ${CURRENT_VERSION}" >> "$GITHUB_OUTPUT"
48+ echo "tag=${CURRENT_VERSION}" >> "$GITHUB_OUTPUT"
4849 echo "should_release=true" >> "$GITHUB_OUTPUT"
49- echo "Manual release requested for v ${CURRENT_VERSION}"
50+ echo "Manual release requested for ${CURRENT_VERSION}"
5051 else
5152 # push to main: only release when the pom version changed vs the previous commit
5253 PREV_VERSION=$(git show HEAD~1:webull-openapi-java-sdk/pom.xml 2>/dev/null \
5354 | grep -oE '<version>[^<]+</version>' | head -1 \
5455 | sed -E 's/<\/?version>//g' || echo "")
5556 echo "current=${CURRENT_VERSION} previous=${PREV_VERSION}"
5657 if [ "$CURRENT_VERSION" != "$PREV_VERSION" ]; then
57- echo "tag=v ${CURRENT_VERSION}" >> "$GITHUB_OUTPUT"
58+ echo "tag=${CURRENT_VERSION}" >> "$GITHUB_OUTPUT"
5859 echo "should_release=true" >> "$GITHUB_OUTPUT"
5960 echo "Version changed ($PREV_VERSION -> $CURRENT_VERSION), will release"
6061 else
8687 VERSION : ${{ steps.decide.outputs.tag }}
8788 run : |
8889 set -euo pipefail
89- POM_VERSION="${VERSION#v }" # jar file names use the bare version, tag has a 'v' prefix
90+ POM_VERSION="${VERSION}" # tag equals the bare pom version (no 'v' prefix)
9091 TARGET="webull-openapi-java-sdk/target"
9192 mkdir -p dist
9293 STAGE="dist/webull-openapi-java-sdk-${VERSION}"
@@ -126,7 +127,15 @@ jobs:
126127 VERSION : ${{ steps.decide.outputs.tag }}
127128 run : |
128129 set -euo pipefail
130+ RELEASE_TITLE="webull openapi-java-sdk ${VERSION}"
131+ # release notes use the latest commit message, with the [ISSUE-KEY] marker stripped
132+ # e.g. "feat[API-1931]: auto-tag" -> "feat: auto-tag"
133+ RELEASE_NOTES="$(git log -1 --pretty=%B | sed -E 's/^([a-z]+)\[[^]]*\]:/\1:/')"
129134 if gh release view "${VERSION}" --repo "${GITHUB_REPOSITORY}" > /dev/null 2>&1; then
135+ gh release edit "${VERSION}" \
136+ --repo "${GITHUB_REPOSITORY}" \
137+ --title "${RELEASE_TITLE}" \
138+ --notes "${RELEASE_NOTES}"
130139 gh release upload "${VERSION}" \
131140 dist/webull-openapi-java-sdk-*.zip \
132141 dist/webull-openapi-java-sdk-*.tar.gz \
@@ -139,6 +148,6 @@ jobs:
139148 dist/webull-openapi-java-sdk-*.tar.gz \
140149 dist/SHA256SUMS \
141150 --repo "${GITHUB_REPOSITORY}" \
142- --title "${VERSION }" \
143- --generate- notes
151+ --title "${RELEASE_TITLE }" \
152+ --notes "${RELEASE_NOTES}"
144153 fi
0 commit comments