make: Release pipeline

This commit adds new make targets for rpm, deb, and pacman packages.
It also adds a phony target that uploads tarballs of the packages,
along with their signed (and unsigned) checksums to the github release
page. Once the current commit is tagged as a release, run `make release`
to build the packages and upload them to github.
This commit is contained in:
Jonathan Gold
2018-11-27 09:15:43 -05:00
parent cc02e96a13
commit 80931e1cb4
7 changed files with 243 additions and 90 deletions

46
misc/make-deb-changelog.sh Executable file
View File

@@ -0,0 +1,46 @@
#!/bin/bash
# This script generates a deb changelog from the project's git history.
# path to store the changelog
CHANGELOG="releases/deb/changelog"
# input to format flag for git tag
TAG_FORMAT="-- %(creator) %(creatordate:format:%a, %d %b %Y %H:%M:%S %z) %(refname:lstrip=2)"
# a list of tags to be parsed in the loop
TAGS=$(git tag --sort=-creatordate --format="$TAG_FORMAT" | sed -r 's/[0-9]+ -[0-9]+ //')
# placeholder for the next line of the list
THIS_TAGLINE=
# parse the list
while read -r LAST_TAGLINE; do
# read ahead one tag
if [ "$THIS_TAGLINE" == "" ]; then
# store the tag for the next iteration
THIS_TAGLINE="$LAST_TAGLINE"
continue
fi
# grab the tags from the last column of the taglines
THIS_TAG=$(echo "$THIS_TAGLINE" | awk '{print $NF}')
LAST_TAG=$(echo "$LAST_TAGLINE" | awk '{print $NF}')
# print the release description
printf "mgmt (%s) unstable; priority=low\n\n" "$THIS_TAG" >> "$CHANGELOG"
# print all the commits between the tags
git shortlog -n "${LAST_TAG}...${THIS_TAG}" | sed -r '/\):/s/^/ * /' >> "$CHANGELOG"
# print the release signature
printf "%s\n\n\n" "$THIS_TAGLINE" | sed -r 's/[0-9]\.[0-9]\.[0-9]+//'>> "$CHANGELOG"
# first tag is special since there's no previous one
if [ "$LAST_TAG" == "0.0.1" ]; then
# print all the commits before the first tag
git shortlog -n "$LAST_TAG" | sed -r '/\):/s/^/ * /' >> "$CHANGELOG"
# print the release signature
printf "%s\n" "$LAST_TAGLINE" | sed -r 's/[0-9]\.[0-9]\.[0-9]+//'>> "$CHANGELOG"
fi
# store the tag for the next iteration
THIS_TAGLINE="$LAST_TAGLINE"
done <<< "$TAGS"