;tools: just changelogs-finalise, changelogs-catchup

This commit is contained in:
Simon Michael 2024-12-09 10:44:10 -10:00
parent b572d6b1ca
commit 2d1d3ac006

View File

@ -812,17 +812,29 @@ changelogs *OPTS:
changelogs-reset: changelogs-reset:
git checkout CHANGES.md */CHANGES.md git checkout CHANGES.md */CHANGES.md
# Finalise changelogs for a full release today. Run on release branch. # Set changelog headings to the specified commit, or HEAD. Run on release branch.
changelogs-catchup *COMMIT:
#!/usr/bin/env bash
set -euo pipefail
just _on-release-branch
C={{ if COMMIT == '' { `git log -1 --pretty=%h --abbrev=8` } else { COMMIT } }}
for p in $PACKAGES; do \
sed -i "0,/^# /s/^# .*$/# $C/" $p/CHANGES.md; \
done
sed -i "0,/^# /s/^# .*$/# $C/" CHANGES.md
echo "Changelog headings have been set to $C"
# Set changelog headings for a full release today. Run on release branch.
changelogs-finalise: changelogs-finalise:
#!/usr/bin/env bash #!/usr/bin/env bash
set -euo pipefail set -euo pipefail
just _on-release-branch just _on-release-branch
date=`gdate -I`
for p in $PACKAGES; do \ for p in $PACKAGES; do \
sed -i "0,/^# /s/^# .*$/# `gdate -I` `cat $p/.version`/" $p/CHANGES.md; \ sed -i "0,/^# /s/^# .*$/# $date `cat $p/.version`/" $p/CHANGES.md; \
done done
sed -i "0,/^# /s/^# .*$/# `gdate -I` `cat .version`/" CHANGES.md sed -i "0,/^# /s/^# .*$/# $date `cat .version`/" CHANGES.md
git commit -m ";doc: finalise changelogs for `cat .version`" CHANGES.md */CHANGES.md git commit -m ";doc: finalise changelogs for `cat .version` on $date" CHANGES.md */CHANGES.md
echo "Changelogs are finalised for release!"
# see also Shake.hs # see also Shake.hs
# http://www.haskell.org/haddock/doc/html/invoking.html # http://www.haskell.org/haddock/doc/html/invoking.html