diff --git a/scripts/changelog/.gitignore b/scripts/changelog/.gitignore new file mode 100644 index 0000000000..1a13c36382 --- /dev/null +++ b/scripts/changelog/.gitignore @@ -0,0 +1 @@ +changelog.md diff --git a/scripts/changelog/README.md b/scripts/changelog/README.md new file mode 100644 index 0000000000..318e3a32e2 --- /dev/null +++ b/scripts/changelog/README.md @@ -0,0 +1,13 @@ +# Changelog + +Currently, the changelog is built locally. +Run: + +``` +./changelog.sh +``` + +For instance: +``` +./changelog.sh statemine_v4 +``` diff --git a/scripts/changelog/changelog.sh b/scripts/changelog/changelog.sh new file mode 100755 index 0000000000..cf04e21c1f --- /dev/null +++ b/scripts/changelog/changelog.sh @@ -0,0 +1,11 @@ +#!/usr/bin/env bash + +REF1=$1 + +JSON=$(git log $REF1..HEAD \ + --pretty=format:'{ "commit": "%H", "short_sha": "%h", "author": "%an", "date": "%ad", "message": "%s"},' \ + $@ | \ + perl -pe 'BEGIN{print "{ \"since\": \"'${REF1}'\", \"commits\": ["}; END{print "]}"}' | \ + perl -pe 's/},]/}]/') + +echo $JSON | tera --template templates/changelog.md --stdin | tee