diff options
author | EuAndreh <eu@euandre.org> | 2021-09-03 20:39:10 -0300 |
---|---|---|
committer | EuAndreh <eu@euandre.org> | 2021-09-03 20:39:10 -0300 |
commit | 51a9914dc8ec02b053a5594b7478b4d68a750672 (patch) | |
tree | 8b3143830dc5658f3848328facded29e4c6cb52c /aux/workflow | |
parent | WIP reactivate nixvps with Terraform and nixos-rebuild on Vultr (diff) | |
download | server-51a9914dc8ec02b053a5594b7478b4d68a750672.tar.gz server-51a9914dc8ec02b053a5594b7478b4d68a750672.tar.xz |
aux/: Update
Diffstat (limited to 'aux/workflow')
-rwxr-xr-x | aux/workflow/TODOs.sh | 6 | ||||
-rwxr-xr-x | aux/workflow/assert-changelog.sh | 15 | ||||
-rwxr-xr-x | aux/workflow/assert-readme.sh | 13 | ||||
-rwxr-xr-x | aux/workflow/assert-todos.sh | 3 | ||||
-rwxr-xr-x | aux/workflow/dist.sh | 29 | ||||
-rw-r--r-- | aux/workflow/favicon.png | bin | 2372 -> 0 bytes | |||
-rwxr-xr-x | aux/workflow/public.sh | 14 | ||||
-rwxr-xr-x | aux/workflow/sign-tarballs.sh | 17 |
8 files changed, 65 insertions, 32 deletions
diff --git a/aux/workflow/TODOs.sh b/aux/workflow/TODOs.sh index d875e0e..efc0b04 100755 --- a/aux/workflow/TODOs.sh +++ b/aux/workflow/TODOs.sh @@ -46,14 +46,14 @@ IDS_REGEX='s:^## \(TODO\|DOING\|WAITING\|MEETING\|INACTIVE\|NEXT\|CANCELLED\|DON :g' TAGS_REGEX='s|tag:\([a-z0-9-]*\)|<span class="tag">\1</span>|g' -cat aux/workflow/preamble.md TODOs.md | \ +cat aux/workflow/preamble.md TODOs.md | sed \ -e "s:@PROJECT_UC@:$PROJECT_UC:g" \ -e "s:@PROJECT@:$PROJECT:g" \ -e "s:@MAILING_LIST@:$MAILING_LIST:g" \ -e "s:@TLD@:$TLD:g" \ -e "$IDS_REGEX" \ - -e "$TAGS_REGEX" | \ + -e "$TAGS_REGEX" | pandoc \ --toc \ --highlight-style pygments \ @@ -64,7 +64,7 @@ cat aux/workflow/preamble.md TODOs.md | \ -r commonmark \ -w html \ -H aux/workflow/favicon.html \ - -H aux/workflow/style.css | \ + -H aux/workflow/style.css | sed \ -e 's:<a><a:<a:g' \ -e 's:</a></a>:</a>:g' \ diff --git a/aux/workflow/assert-changelog.sh b/aux/workflow/assert-changelog.sh index 7f9117f..4acc81b 100755 --- a/aux/workflow/assert-changelog.sh +++ b/aux/workflow/assert-changelog.sh @@ -43,18 +43,21 @@ assert() { DATE="$1" VVERSION="$2" VERSION="${2#v}" - CHANGELOG_ENTRY="# [$VERSION](https://git.euandreh.xyz/$PROJECT/commit/?id=$VVERSION) - $DATE" - + CHANGELOG_ENTRY="$(printf \ + '# [%s](https://git.euandreh.xyz/%s/commit/?id=%s) - %s' \ + "$VERSION" "$PROJECT" "$VVERSION" "$DATE")" if ! grep -qF "$CHANGELOG_ENTRY" CHANGELOG.md; then echo "Missing '$CHANGELOG_ENTRY' entry from CHANGELOG.md" >&2 exit 1 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 333a753..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 @@ -44,7 +48,8 @@ and for generating the documentation HTML and website, run: $ make public \`\`\` -Send contributions to the [mailing list] via [\`git send-email\`](https://git-send-email.io/). +Send contributions to the [mailing list] via +[\`git send-email\`](https://git-send-email.io/). ## Links @@ -63,7 +68,7 @@ RELEASES_LIST="$(mkstemp)" add_release() { DATE="$1" VVERSION="$2" - echo "- [$VVERSION](https://git.euandreh.xyz/$PROJECT/commit/?id=$VVERSION) [$PROJECT-$VVERSION.tar.xz](https://git.euandreh.xyz/$PROJECT/snapshot/$PROJECT-$VVERSION.tar.xz) ([sig](https://git.euandreh.xyz/$PROJECT/snapshot/$PROJECT-$VVERSION.tar.xz.asc)) - $DATE" >> "$RELEASES_LIST" + echo "- [$VVERSION](https://git.euandreh.xyz/$PROJECT/commit/?id=$VVERSION) [$PROJECT-$VVERSION.tar.gz](https://git.euandreh.xyz/$PROJECT/snapshot/$PROJECT-$VVERSION.tar.gz) ([sig](https://git.euandreh.xyz/$PROJECT/snapshot/$PROJECT-$VVERSION.tar.gz.asc)) - $DATE" >> "$RELEASES_LIST" } for VVERSION in $(git tag); do @@ -89,7 +94,9 @@ cat <<EOF >> "$EXPECTED" ## License -The code is licensed under [GNU Affero General Public License v3.0 or later][AGPL-3.0-or-later] (AGPL-3.0-or-later). +The code is licensed under +[GNU Affero General Public License v3.0 or later][AGPL-3.0-or-later] +(AGPL-3.0-or-later). [AGPL-3.0-or-later]: https://git.euandreh.xyz/$PROJECT/tree/COPYING EOF diff --git a/aux/workflow/assert-todos.sh b/aux/workflow/assert-todos.sh index dfa1ab7..bc4907d 100755 --- a/aux/workflow/assert-todos.sh +++ b/aux/workflow/assert-todos.sh @@ -1,7 +1,8 @@ #!/bin/sh set -eu -if git grep FIXME | grep -v '^TODOs.md' | grep -v '^aux/workflow/assert-todos.sh'; then +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." exit 1 diff --git a/aux/workflow/dist.sh b/aux/workflow/dist.sh index 15593f4..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,21 +68,32 @@ 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.xz -o skip-ci --no-verify +git push origin refs/notes/signatures/tar.gz -o skip-ci --no-verify 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/favicon.png b/aux/workflow/favicon.png Binary files differdeleted file mode 100644 index 051fdf1..0000000 --- a/aux/workflow/favicon.png +++ /dev/null diff --git a/aux/workflow/public.sh b/aux/workflow/public.sh index f9f3b3d..38613de 100755 --- a/aux/workflow/public.sh +++ b/aux/workflow/public.sh @@ -41,17 +41,19 @@ PROJECT_UC="${PROJECT_UC:-$PROJECT}" mkdir -p "$OUTDIR" -sh aux/workflow/TODOs.sh -N "$PROJECT_UC" -n "$PROJECT" -m "$MAILING_LIST" -o "$OUTDIR" +sh aux/workflow/TODOs.sh \ + -N "$PROJECT_UC" -n "$PROJECT" -m "$MAILING_LIST" -o "$OUTDIR" for lang in $LANGS; do mkdir -p "$OUTDIR/$lang/" - sh aux/workflow/commonmark.sh -N "$PROJECT" -t README -l "$lang" < "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" + sh aux/workflow/commonmark.sh -N "$PROJECT" -t README -l "$lang" \ + < "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" + ln -fs ../favicon.svg "$OUTDIR/$lang" done ln -fs en/index.html "$OUTDIR/index.html" -ln -fs en/CHANGELOG.html "$OUTDIR/CHANGELOG.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" diff --git a/aux/workflow/sign-tarballs.sh b/aux/workflow/sign-tarballs.sh index 3775e28..3ab2bb8 100755 --- a/aux/workflow/sign-tarballs.sh +++ b/aux/workflow/sign-tarballs.sh @@ -23,15 +23,16 @@ assert_arg() { assert_arg "${PROJECT:-}" '-n PROJECT' -SIGNATURES="$(git notes --ref=refs/notes/signatures/tar.xz list | cut -d\ -f2)" +SIGNATURES="$(git notes --ref=refs/notes/signatures/tar.gz list | cut -d\ -f2)" for tag in $(git tag); do COMMIT="$(git rev-list -n1 "$tag")" - if ! echo "$SIGNATURES" | grep -qF "$COMMIT"; then - echo "Adding missing signature to $tag" >&2 - git notes --ref=refs/notes/signatures/tar.xz add -C "$( - git archive --format tar.xz --prefix "$PROJECT-$tag/" "$tag" | - gpg --output - --armor --detach-sign | - git hash-object -w --stdin - )" "$tag" + if echo "$SIGNATURES" | grep -qF "$COMMIT"; then + continue fi + echo "Adding missing signature to $tag" >&2 + git notes --ref=refs/notes/signatures/tar.gz add -C "$( + git archive --format tar.gz --prefix "$PROJECT-$tag/" "$tag" | + gpg --output - --armor --detach-sign | + git hash-object -w --stdin + )" "$tag" done |