mirror of
https://github.com/troglobit/finit.git
synced 2026-12-05 22:08:20 +00:00
.github: unwrap ChangeLog paragraphs in release notes
The ChangeLog is hard-wrapped at 72 columns, which the GitHub releases page renders verbatim as a ragged right edge. Join the continuation lines of each paragraph and list item, as already done in Infix, and let the browser do the wrapping. Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
1 parent
4c16190831
commit
bad7c5c99a
2 files changed
+30
-2
No files matched your search
Executable
+29
@@ -0,0 +1,29 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
#
|
||||||
|
# Extract the topmost release entry from doc/ChangeLog.md and unwrap
|
||||||
|
# its paragraphs, so the GitHub releases page can wrap them to the
|
||||||
|
# browser width instead of showing the hard 72-column breaks.
|
||||||
|
#
|
||||||
|
# Usage: .github/scripts/extract-changelog.sh < doc/ChangeLog.md > release.md
|
||||||
|
#
|
||||||
|
set -e
|
||||||
|
|
||||||
|
# The entry sits between the first two underlines, minus the blank
|
||||||
|
# line separating it from the next heading.
|
||||||
|
awk '/^-----*$/{if (x == 1) exit; x=1;next}x' | head -n -1 |
|
||||||
|
|
||||||
|
# Blank lines, headings, blockquotes, tables, and list items (at any
|
||||||
|
# indent) start a new block, everything else continues the current one.
|
||||||
|
awk '
|
||||||
|
function flush() { if (buf) print buf; buf = "" }
|
||||||
|
{
|
||||||
|
if (/^$/) { flush(); print; blank = 1; next }
|
||||||
|
if (/^ *([-*] |[0-9]+\. |[>#|])/ || blank || !buf || brk)
|
||||||
|
{ flush(); buf = $0 }
|
||||||
|
else
|
||||||
|
{ sub(/^ +/, ""); buf = buf " " $0 }
|
||||||
|
blank = 0
|
||||||
|
brk = / $/
|
||||||
|
}
|
||||||
|
END { flush() }
|
||||||
|
'
|
||||||
@@ -69,8 +69,7 @@ jobs:
|
|||||||
path: finit-*/_build/sub/test/*.log
|
path: finit-*/_build/sub/test/*.log
|
||||||
- name: Extract ChangeLog entry ...
|
- name: Extract ChangeLog entry ...
|
||||||
run: |
|
run: |
|
||||||
awk '/-----*/{if (x == 1) exit; x=1;next}x' doc/ChangeLog.md \
|
.github/scripts/extract-changelog.sh < doc/ChangeLog.md > release.md
|
||||||
|head -n -1 > release.md
|
|
||||||
cat release.md
|
cat release.md
|
||||||
- uses: ncipollo/release-action@v1
|
- uses: ncipollo/release-action@v1
|
||||||
with:
|
with:
|
||||||
|
|||||||
Reference in new issue
Block a user