diff options
author | EuAndreh <eu@euandre.org> | 2021-08-28 09:08:15 -0300 |
---|---|---|
committer | EuAndreh <eu@euandre.org> | 2021-08-28 09:56:45 -0300 |
commit | 59effe0a37ed132f7576ccecc25f6ca75098906d (patch) | |
tree | 7aca6c9e48ed7a47eba99d0fa5e852574a91e08e | |
parent | src/lib.c: Mark local FILE* variable as const (diff) | |
download | gistatic-59effe0a37ed132f7576ccecc25f6ca75098906d.tar.gz gistatic-59effe0a37ed132f7576ccecc25f6ca75098906d.tar.xz |
aux/workflow/dist.sh: Be stricter with release pre-requisites
-rw-r--r-- | Makefile | 5 | ||||
-rwxr-xr-x | aux/workflow/dist.sh | 27 |
2 files changed, 26 insertions, 6 deletions
@@ -112,8 +112,9 @@ dev-check: check public sh tests/dev-integration.sh sh aux/assert-shellcheck.sh sh aux/workflow/assert-todos.sh - sh aux/workflow/assert-changelog.sh -n '$(NAME)' - sh aux/workflow/assert-readme.sh -n '$(NAME)' -m '$(MAILING_LIST)' + sh aux/workflow/assert-changelog.sh -n '$(NAME)' $(EXTRA_VERSION) + sh aux/workflow/assert-readme.sh -n '$(NAME)' -m '$(MAILING_LIST)' \ + $(EXTRA_VERSION) sh aux/workflow/assert-manpages.sh -n '$(NAME)' -m '$(MAILING_LIST)' \ -l '$(TRANSLATIONS) en' $(manpages.en.in) sh aux/workflow/repocheck.sh -x1 -l1 -f7 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 |