2020 - name : Checkout code
2121 uses : actions/checkout@v3
2222
23+ - name : Extract release notes
24+ id : extract-release-notes
25+ uses : ffurrer2/extract-release-notes@v1.17.0
26+
2327 - name : Compile and Build JAR
2428 run : |
2529 mkdir ${{ env.OUT_DIR }}
@@ -32,41 +36,17 @@ jobs:
3236 name : ${{ env.FILE_NAME }}-jar-${{ env.VERSION }}
3337 path : ${{ env.OUT_DIR }}/${{ env.FILE_NAME }}-${{ env.VERSION }}.jar
3438
35- - name : Extract Changelog for Current Release
36- id : extract_changelog
37- run : |
38- content=$(sed -n "/^## \[${{ env.VERSION }}\] - /,/^## \[.*\] - /p" CHANGELOG.md | tail -n +2 | head -n -1)
39- encoded_content=$(echo "$content" | jq -R -s -c .)
40- echo "::set-output name=release_notes::$encoded_content"
41-
42-
43- - name : Debugging Release Notes
44- id : debugging_release_notes
45- run : |
46- release_notes="${{ steps.extract_changelog.outputs.release_notes }}"
47- formatted_notes=$(echo -e "$release_notes")
48- echo "$formatted_notes"
49- echo "::set-output name=formatted_notes::$formatted_notes"
50-
51-
52-
53-
54-
5539 - name : Create GitHub Release
5640 id : create_release
5741 uses : actions/create-release@v1
5842 env :
5943 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
60- FORMATTED_NOTES : ${{ steps.debugging_release_notes.outputs.formatted_notes }} # Ensure this is set
6144 with :
6245 tag_name : ${{ github.ref }}
63- release_name : ${{ github.ref }}
64- body : ${{ steps.debugging_release_notes .outputs.formatted_notes }}
46+ release_name : ${{ github.ref_name }}
47+ body : ${{ steps.extract-release-notes .outputs.release_notes }}
6548
6649
67-
68-
69-
7050
7151 - name : Attach JAR to Release
7252 uses : actions/upload-release-asset@v1
0 commit comments