aboutsummaryrefslogtreecommitdiff
path: root/aux/workflow/dist.sh
diff options
context:
space:
mode:
Diffstat (limited to 'aux/workflow/dist.sh')
-rwxr-xr-xaux/workflow/dist.sh27
1 files changed, 23 insertions, 4 deletions
diff --git a/aux/workflow/dist.sh b/aux/workflow/dist.sh
index 69c0173..a433478 100755
--- a/aux/workflow/dist.sh
+++ b/aux/workflow/dist.sh
@@ -42,13 +42,21 @@ if [ -z "${PROJECT_UC:-}" ]; then
PROJECT_UC="$PROJECT"
fi
+
+if [ "$(git rev-parse --abbrev-ref HEAD)" != 'main' ]; then
+ echo 'Not on branch "main".' >&2
+ exit 1
+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 ! printf '%s\n%s\n' "$(git tag)" "$VVERSION" | sort -nct. -k1 -k2 -k3; then
+ echo 'New tag is not bigger than existing ones.' >&2
+ exit 1
+fi
if [ "$DATE" != "$(git log -1 --format=%cd --date=short HEAD)" ]; then
echo "Date '$DATE' is not up-to-date." >&2
@@ -60,17 +68,23 @@ if [ "Release $VVERSION" != "$(git log --format=%B -1 HEAD | head -n1)" ]; then
exit 1
fi
+make clean public dev-check EXTRA_VERSION="$VVERSION"
+
if ! (git diff --quiet && git diff --quiet --staged); then
echo 'Dirty repository.'
exit 1
fi
-git tag "$VVERSION"
+git tag "$VVERSION"
sh aux/workflow/sign-tarballs.sh -n "$PROJECT"
-cat <<EOF >&2
+printf 'Publish version? [Y/n]: ' >&2
+read -r publish
+
+if [ "$publish" = 'n' ]; then
+ cat <<EOF >&2
Now push the tag and the signature before pushing the commit:
git push origin refs/notes/signatures/tar.gz -o skip-ci --no-verify
@@ -78,3 +92,8 @@ git push --tags -o skip-ci --no-verify
git push
EOF
+else
+ git push origin refs/notes/signatures/tar.gz -o skip-ci --no-verify
+ git push --tags -o skip-ci --no-verify
+ git push
+fi