github release workflow: work around trailing "---"-line in changelog

The extracted release notes trigger a sphinx warning

	/tmp/tmp.V6RGP92nc2/src/index.rst:6:Document may not end with a transition.

which we don't seem to get on the full CHANGELOG.rst.
Let's work around that for now.
This commit is contained in:
Johannes Altmanninger
2025-09-18 09:54:13 +02:00
parent 1840df96a2
commit 0d46c26988
2 changed files with 9 additions and 6 deletions

View File

@@ -50,15 +50,18 @@ jobs:
mkdir "$relnotes_tmp/src" "$relnotes_tmp/out"
version=$(git describe)
minor_version=${version%.*}
# Delete notes for prior releases.
# Also fix up any relative references to other documentation files.
awk <CHANGELOG.rst '
changelog_for_this_version=$(awk <CHANGELOG.rst '
/^fish/ && $2 != "'"$version"'" { exit }
{ print }
' |
')
# Also fix up any relative references to other documentation files.
# Also remove spurious transitions at the end of the document.
printf %s "$changelog_for_this_version" |
sed >"$relnotes_tmp/src"/index.rst \
-e 's,:doc:`\(.*\) <\([^>]*\)>`,`\1 <https://fishshell.com/docs/'"$minor_version"'/\2.html>`_,g' \
-e 's,:envvar:`\([^`]*\)`,``$\1``,g'
-e 's,:envvar:`\([^`]*\)`,``$\1``,g' \
-e '$s/^----*$//'
# In future, we could reuse doctree from when we made HTML docs.
sphinx-build -j 1 $(: "sphinx-markdown-builder is not marked concurrency-safe") \
-W -E -b markdown -c doc_src \