aboutsummaryrefslogtreecommitdiff
path: root/aux/workflow/README.sh
blob: e30344fbc4bf277c675955058ca65c777ffca730 (about) (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/bin/sh
set -eu

mkdir -p public

PROJECT_UC="$1"
PROJECT="$2"
MAILING_LIST="$3"

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

RELEASES="$(mktemp)"
if [ -s "$RELEASES_LIST" ]; then
  printf '\n# Releases\n\n' >> "$RELEASES"
  cat "$RELEASES_LIST" >> "$RELEASES"
fi

LINKS="$(mktemp)"
cat <<EOF > "$LINKS"

# Links

- [home page](https://$PROJECT.euandreh.xyz)
- [source code](https://git.euandreh.xyz/$PROJECT/about/)
- [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

cat "README.md" "$LINKS" "$RELEASES" | \
  pandoc --toc                                   \
         --highlight-style pygments              \
         --toc-depth=2                           \
         -s                                      \
         --metadata title="$PROJECT_UC - README" \
         --metadata lang=en                      \
         -r commonmark                           \
         -w html                                 \
         > public/index.html