diff options
Diffstat (limited to '')
-rwxr-xr-x | aux/workflow/assert-changelog.sh | 10 | ||||
-rwxr-xr-x | aux/workflow/assert-readme.sh | 4 | ||||
-rwxr-xr-x | aux/workflow/assert-todos.sh | 2 | ||||
-rwxr-xr-x | aux/workflow/dist.sh | 27 | ||||
-rwxr-xr-x | aux/workflow/public.sh | 4 |
5 files changed, 36 insertions, 11 deletions
diff --git a/aux/workflow/assert-changelog.sh b/aux/workflow/assert-changelog.sh index ca86407..4acc81b 100755 --- a/aux/workflow/assert-changelog.sh +++ b/aux/workflow/assert-changelog.sh @@ -52,10 +52,12 @@ assert() { fi } -for VVERSION in $(git tag); do - DATE="$(git log -1 --format=%cd --date=short "$VVERSION")" - assert "$DATE" "$VVERSION" -done +if [ -e .git ]; then + for VVERSION in $(git tag); do + DATE="$(git log -1 --format=%cd --date=short "$VVERSION")" + assert "$DATE" "$VVERSION" + done +fi # "$@" represents a list of tags to be also included in the verification. for VVERSION in "$@"; do diff --git a/aux/workflow/assert-readme.sh b/aux/workflow/assert-readme.sh index dbe657e..1e49bfb 100755 --- a/aux/workflow/assert-readme.sh +++ b/aux/workflow/assert-readme.sh @@ -1,6 +1,10 @@ #!/bin/sh set -eu +if [ ! -e .git ]; then + exit +fi + TLD="$(cat aux/tld.txt)" . aux/lib.sh diff --git a/aux/workflow/assert-todos.sh b/aux/workflow/assert-todos.sh index c21ebb9..bc4907d 100755 --- a/aux/workflow/assert-todos.sh +++ b/aux/workflow/assert-todos.sh @@ -1,7 +1,7 @@ #!/bin/sh set -eu -if git grep FIXME | grep -v '^TODOs.md' | +if [ -e .git ] && git grep FIXME | grep -v '^TODOs.md' | grep -v '^aux/workflow/assert-todos.sh'; then echo "Found dangling FIXME markers on the project." echo "You should write them down properly on TODOs.md." 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 diff --git a/aux/workflow/public.sh b/aux/workflow/public.sh index 07be9d4..38613de 100755 --- a/aux/workflow/public.sh +++ b/aux/workflow/public.sh @@ -50,10 +50,10 @@ for lang in $LANGS; do < "README.$lang.md" > "$OUTDIR/$lang/index.html" sh aux/workflow/commonmark.sh -N "$PROJECT" -t CHANGELOG -l "$lang" \ < "CHANGELOG.$lang.md" > "$OUTDIR/$lang/CHANGELOG.html" - cp aux/workflow/favicon.svg aux/workflow/favicon.png "$OUTDIR/$lang" + ln -fs ../favicon.svg "$OUTDIR/$lang" done ln -fs en/index.html "$OUTDIR/index.html" -cp aux/workflow/favicon.svg aux/workflow/favicon.png "$OUTDIR" +cp aux/workflow/favicon.svg "$OUTDIR" sh aux/ci/report.sh -n "$PROJECT" -o "$OUTDIR" |