Skip to content

Commit

Permalink
Update the release scripts to include the breaking changes section
Browse files Browse the repository at this point in the history
  • Loading branch information
bblanchon committed Dec 29, 2024
1 parent de05814 commit 254fa57
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 16 deletions.
8 changes: 7 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,13 @@ jobs:
id: body
run: |
FILENAME=RELEASE.md
extras/scripts/get-release-body.sh ${{ steps.init.outputs.tag }} CHANGELOG.md | tee $FILENAME
tee $FILENAME <<END
## Changes
$(extras/scripts/extract_changes.awk CHANGELOG.md)
[View version history](https://github.com/bblanchon/ArduinoJson/blob/${{ steps.init.outputs.tag }}/CHANGELOG.md)
END
echo "filename=$FILENAME" >> $GITHUB_OUTPUT
- name: Amalgamate ArduinoJson.h
id: amalgamate_h
Expand Down
29 changes: 29 additions & 0 deletions extras/scripts/extract_changes.awk
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/usr/bin/awk -f

# Start echoing after the first list item
/\* / {
STARTED=1
EMPTY_LINE=0
}

# Remember if we have seen an empty line
/^[[:space:]]*$/ {
EMPTY_LINE=1
}

# Exit when seeing a new version number
/^v[[:digit:]]/ {
if (STARTED) exit
}

# Print if the line is not empty
# and restore the empty line we have skipped
!/^[[:space:]]*$/ {
if (STARTED) {
if (EMPTY_LINE) {
print ""
EMPTY_LINE=0
}
print
}
}
14 changes: 0 additions & 14 deletions extras/scripts/get-release-body.sh

This file was deleted.

2 changes: 1 addition & 1 deletion extras/scripts/get-release-page.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ date: '$(date +'%Y-%m-%d')'
$(extras/scripts/wandbox/publish.sh "$ARDUINOJSON_H")
---
$(awk '/\* /{ FOUND=1; print; next } { if (FOUND) exit}' "$CHANGELOG")
$(extras/scripts/extract_changes.awk "$CHANGELOG")
END

0 comments on commit 254fa57

Please sign in to comment.