aboutsummaryrefslogtreecommitdiff
path: root/aux/workflow/dist.sh
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2021-07-27 12:51:36 -0300
committerEuAndreh <eu@euandre.org>2021-07-27 12:51:36 -0300
commit3bceeb4da5ec953309bbc3e61d04f078198966d2 (patch)
treec30ba0fd9485a88f45bdd91d3784630f9e9fa950 /aux/workflow/dist.sh
parentTODOs.md: Dump links on Scratch (diff)
downloadgistatic-3bceeb4da5ec953309bbc3e61d04f078198966d2.tar.gz
gistatic-3bceeb4da5ec953309bbc3e61d04f078198966d2.tar.xz
aux/: Update, adjust Makefile
Diffstat (limited to 'aux/workflow/dist.sh')
-rwxr-xr-xaux/workflow/dist.sh63
1 files changed, 58 insertions, 5 deletions
diff --git a/aux/workflow/dist.sh b/aux/workflow/dist.sh
index c061a04..15593f4 100755
--- a/aux/workflow/dist.sh
+++ b/aux/workflow/dist.sh
@@ -1,15 +1,55 @@
#!/bin/sh
set -eu
-DATE="$1"
-VVERSION="v$2"
-PROJECT="$3"
+PROJECT_UC=
+while getopts 'd:V:n:N:m:' flag; do
+ case "$flag" in
+ d)
+ DATE="$OPTARG"
+ ;;
+ V)
+ VVERSION="v$OPTARG"
+ ;;
+ n)
+ PROJECT="$OPTARG"
+ ;;
+ N)
+ PROJECT_UC="$OPTARG"
+ ;;
+ m)
+ MAILING_LIST="$OPTARG"
+ ;;
+ *)
+ exit 2
+ ;;
+ esac
+done
+shift $((OPTIND - 1))
+
+assert_arg() {
+ if [ -z "$1" ]; then
+ echo "Missing $2" >&2
+ exit 2
+ fi
+}
+
+assert_arg "${DATE:-}" '-d DATE'
+assert_arg "${VVERSION:-}" '-V VERSION'
+assert_arg "${PROJECT:-}" '-n PROJECT'
+assert_arg "${MAILING_LIST:-}" '-m MAILING_LIST'
+
+if [ -z "${PROJECT_UC:-}" ]; then
+ PROJECT_UC="$PROJECT"
+fi
if git show "$VVERSION" 1>/dev/null 2>/dev/null; then
echo "Version '$VVERSION' already exists." >&2
exit 1
fi
+sh aux/workflow/assert-changelog.sh -N "$PROJECT_UC" -n "$PROJECT" "$VVERSION"
+sh aux/workflow/assert-readme.sh -n "$PROJECT" -m "$MAILING_LIST" "$VVERSION"
+
if [ "$DATE" != "$(git log -1 --format=%cd --date=short HEAD)" ]; then
echo "Date '$DATE' is not up-to-date." >&2
exit 1
@@ -20,8 +60,21 @@ if [ "Release $VVERSION" != "$(git log --format=%B -1 HEAD | head -n1)" ]; then
exit 1
fi
-sh aux/workflow/assert-changelog.sh "$PROJECT"
+if ! (git diff --quiet && git diff --quiet --staged); then
+ echo 'Dirty repository.'
+ exit 1
+fi
git tag "$VVERSION"
-sh aux/workflow/sign-tarballs.sh "$PROJECT"
+sh aux/workflow/sign-tarballs.sh -n "$PROJECT"
+
+
+cat <<EOF >&2
+Now push the tag and the signature before pushing the commit:
+
+git push origin refs/notes/signatures/tar.xz -o skip-ci --no-verify
+git push --tags -o skip-ci --no-verify
+git push
+
+EOF