aboutsummaryrefslogtreecommitdiff
path: root/aux/workflow/assert-readme.sh
diff options
context:
space:
mode:
Diffstat (limited to 'aux/workflow/assert-readme.sh')
-rwxr-xr-xaux/workflow/assert-readme.sh36
1 files changed, 36 insertions, 0 deletions
diff --git a/aux/workflow/assert-readme.sh b/aux/workflow/assert-readme.sh
new file mode 100755
index 0000000..47f7e25
--- /dev/null
+++ b/aux/workflow/assert-readme.sh
@@ -0,0 +1,36 @@
+#!/bin/sh
+set -eu
+
+mkdir -p public
+
+PROJECT="$1"
+MAILING_LIST="$2"
+
+EXPECTED="$(mktemp)"
+cat <<EOF >> "$EXPECTED"
+
+
+# Links
+
+- [home page](https://$PROJECT.euandreh.xyz)
+- [source code](https://git.euandreh.xyz/$PROJECT/)
+- [bug tracking](https://$PROJECT.euandreh.xyz/TODOs.html)
+- [mailing list](https://lists.sr.ht/~euandreh/$MAILING_LIST?search=%5B$PROJECT%5D)
+- [CI logs](https://$PROJECT.euandreh.xyz/ci.html)
+- [CHANGELOG](https://$PROJECT.euandreh.xyz/CHANGELOG.html)
+EOF
+
+RELEASES_LIST="$(mktemp)"
+for version in $(git tag | perl -e 'print reverse <>'); do
+ echo "- version [$version](https://git.euandreh.xyz/$PROJECT/snapshot/$PROJECT-$version.tar.gz) ([sig](https://git.euandreh.xyz/$PROJECT/snapshot/$PROJECT-$version.tar.gz.asc)), released in $(git log -1 --format=%cd --date=short "$version")" >> "$RELEASES_LIST"
+done
+
+if [ -s "$RELEASES_LIST" ]; then
+ printf '\n\n# Releases\n\n' >> "$EXPECTED"
+ cat "$RELEASES_LIST" >> "$EXPECTED"
+fi
+
+if ! tail -n "$(wc -l < "$EXPECTED")" README.md | diff - "$EXPECTED"; then
+ echo 'Missing metadata at the end of README.md file'
+ exit 1
+fi