aboutsummaryrefslogtreecommitdiff
path: root/build-aux/workflow/README.sh
blob: 1aa25930b2878a2f133dd98ebeda016ee0cd3397 (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
#!/bin/sh
set -eu

mkdir -p public

PROJECT_UC="$1"
PROJECT="$2"

RELEASES_LIST="$(mktemp)"
for version in $(git tag); do
  echo "- version [$version](https://git.euandreh.xyz/$PROJECT/snapshot/$PROJECT-$version.tar.gz), released in $(git log -1 --format=%cd --date=short "$version")" >> "$RELEASES_LIST"
done

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

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