Skip to content

Commit bf1b2c8

Browse files
committed
[ci] Extract release notes during release
1 parent 5755fe5 commit bf1b2c8

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

.travis/release.sh

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,20 @@ echo "TRAVIS_ALLOW_FAILURE: $TRAVIS_ALLOW_FAILURE"
2222
GITHUB_URL="https://api.github.com/repos/pmd/pmd-eclipse-plugin/releases"
2323
RELEASE_ID=$(curl -s -H "Authorization: token ${GITHUB_OAUTH_TOKEN}" ${GITHUB_URL}/tags/${TRAVIS_TAG}|jq ".id")
2424
RELEASE_NAME="PMD For Eclipse ${RELEASE_VERSION} ($(date -u +%d-%B-%Y))"
25+
26+
# extract the release notes
27+
BEGIN_LINE=$(grep -n "^## " ReleaseNotes.md|head -1|cut -d ":" -f 1)
28+
END_LINE=$(grep -n "^## " ReleaseNotes.md|head -2|tail -1|cut -d ":" -f 1)
29+
END_LINE=$((END_LINE - 1))
30+
2531
RELEASE_BODY="A new PMD for Eclipse plugin version has been released.
2632
It is available via the update site: https://dl.bintray.com/pmd/pmd-eclipse-plugin/updates/
2733
28-
Release notes: https://github.com/pmd/pmd-eclipse-plugin/blob/${TRAVIS_TAG}/ReleaseNotes.md
34+
$(cat ReleaseNotes.md|head -$END_LINE|tail -$BEGIN_LINE)
2935
"
3036

37+
38+
3139
RELEASE_BODY="${RELEASE_BODY//'\'/\\\\}"
3240
RELEASE_BODY="${RELEASE_BODY//$'\r'/}"
3341
RELEASE_BODY="${RELEASE_BODY//$'\n'/\\r\\n}"

0 commit comments

Comments
 (0)