diff options
author | EuAndreh <eu@euandre.org> | 2021-06-16 23:00:20 -0300 |
---|---|---|
committer | EuAndreh <eu@euandre.org> | 2021-06-16 23:00:20 -0300 |
commit | 993e0e15eb9691bc73e502e0003fa799650862e3 (patch) | |
tree | fbba2173783f55445ddd7c7e24f652db6936016d /aux | |
parent | README.md: Highlight link as anchor instead of text (diff) | |
download | package-repository-993e0e15eb9691bc73e502e0003fa799650862e3.tar.gz package-repository-993e0e15eb9691bc73e502e0003fa799650862e3.tar.xz |
aux/: Update
Diffstat (limited to 'aux')
-rwxr-xr-x | aux/ci/ci-build.sh | 2 | ||||
-rwxr-xr-x | aux/ci/report.sh | 6 | ||||
-rwxr-xr-x | aux/workflow/TODOs.sh | 11 | ||||
-rwxr-xr-x | aux/workflow/assert-changelog.sh | 30 | ||||
-rwxr-xr-x | aux/workflow/assert-readme.sh | 37 | ||||
-rwxr-xr-x | aux/workflow/dist.sh | 9 | ||||
-rw-r--r-- | aux/workflow/preamble.md | 4 |
7 files changed, 79 insertions, 20 deletions
diff --git a/aux/ci/ci-build.sh b/aux/ci/ci-build.sh index b6769a9..60af813 100755 --- a/aux/ci/ci-build.sh +++ b/aux/ci/ci-build.sh @@ -27,7 +27,7 @@ EOF cd - sh aux/ci/report.sh "$PACKAGE" - rsync -a public/ "/srv/http/$PACKAGE/" --delete + rsync -av public/ "/srv/http/$PACKAGE/" --delete printf "\n>>>\n>>> CI logs added as Git note.\n>>>\n>>> Run status was %s" "$STATUS" } diff --git a/aux/ci/report.sh b/aux/ci/report.sh index 65d3335..2b40f3e 100755 --- a/aux/ci/report.sh +++ b/aux/ci/report.sh @@ -1,7 +1,8 @@ #!/bin/sh set -eu -PROJECT_UC="$1" +PROJECT="$1" +TLD="$(cat aux/tld.txt)" PASS='✅' FAIL='❌' @@ -27,6 +28,7 @@ cat <<EOF >> "$OUT" <meta charset="UTF-8" /> <meta name="viewport" content="width=device-width, initial-scale=1" /> <link rel="icon" type="image/svg+xml" href="favicon.svg" /> + <title>CI logs for $PROJECT</title> <style> pre { @@ -36,7 +38,7 @@ cat <<EOF >> "$OUT" </head> <body> <h1> - CI logs for $PROJECT_UC + CI logs for <a href="https://$TLD/$PROJECT/">$PROJECT</a> </h1> <ul> EOF diff --git a/aux/workflow/TODOs.sh b/aux/workflow/TODOs.sh index 80059ee..9f9f657 100755 --- a/aux/workflow/TODOs.sh +++ b/aux/workflow/TODOs.sh @@ -8,7 +8,9 @@ PROJECT="$2" MAILING_LIST="$3" TLD="$(cat aux/tld.txt)" -TODOS_REGEX='s/^## (TODO|DOING|WAITING|MEETING|INACTIVE|NEXT|CANCELLED|DONE) (.*) \{#(.*?)\}$/## <a href="#\3"><span class="\1">\1<\/span> \2<\/a>\n<span class="header-anchor" id="\3">#\3<\/span>\n/' +TODOS_ADD_REGEX='s/^## (TODO|DOING|WAITING|MEETING|INACTIVE|NEXT|CANCELLED|DONE) (.*) \{#(.*?)\}$/## <a href="#\3"><span class="\1">\1<\/span> \2<\/a>\n<span class="header-anchor" id="\3">#\3<\/span>\n/' +TODOS_CLEANUP_REGEX1='s/(<a><a)/<a/' +TODOS_CLEANUP_REGEX2='s/<\/a><\/a>/<\/a>/' TAGS_REGEX='s/tag:([\w-]+)/<span class="tag">\1<\/span>/g' @@ -20,7 +22,7 @@ sed -e "s:@PROJECT_UC@:$PROJECT_UC:g" \ printf \ '%s\n\n%s' \ "$(cat -)" \ - "$(perl -pe "$TODOS_REGEX" TODOs.md | perl -pe "$TAGS_REGEX")" | \ + "$(perl -pe "$TODOS_ADD_REGEX" TODOs.md | perl -pe "$TAGS_REGEX")" | \ pandoc \ --toc \ --highlight-style pygments \ @@ -32,4 +34,7 @@ sed -e "s:@PROJECT_UC@:$PROJECT_UC:g" \ -w html \ -H aux/workflow/favicon.html \ -H aux/workflow/style.css \ - > public/TODOs.html + | \ + perl -pe "$TODOS_CLEANUP_REGEX1" | \ + perl -pe "$TODOS_CLEANUP_REGEX2" \ + > public/TODOs.html diff --git a/aux/workflow/assert-changelog.sh b/aux/workflow/assert-changelog.sh index 8e81f1f..dc8867f 100755 --- a/aux/workflow/assert-changelog.sh +++ b/aux/workflow/assert-changelog.sh @@ -1,14 +1,38 @@ #!/bin/sh set -eu +TLD="$(cat aux/tld.txt)" PROJECT="$1" +shift -for VVERSION in $(git tag); do - VERSION="${VVERSION#v}" - DATE="$(git log -1 --format=%cd --date=short "$VVERSION")" +HOMEPAGE_LINK="Changelog for [$PROJECT](https://$TLD/$PROJECT/)." + +if ! grep -qF "$HOMEPAGE_LINK" CHANGELOG.md; then + echo "Missing link to homepage in CHANGELOG.md:" >&2 + echo "$HOMEPAGE_LINK" + exit 1 +fi + +assert() { + DATE="$1" + VVERSION="$2" + VERSION="${2#v}" CHANGELOG_ENTRY="# [$VERSION](https://git.euandreh.xyz/$PROJECT/commit/?id=$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 + +# "$@" represents a list of tags to be also included in the verification. +# shellcheck disable=2068 +for VVERSION in $@; do + DATE="$(date '+%Y-%m-%d')" + assert "$DATE" "$VVERSION" done diff --git a/aux/workflow/assert-readme.sh b/aux/workflow/assert-readme.sh index cef75dd..2e5d978 100755 --- a/aux/workflow/assert-readme.sh +++ b/aux/workflow/assert-readme.sh @@ -5,6 +5,8 @@ mkdir -p public PROJECT="$1" MAILING_LIST="$2" +shift +shift TLD="$(cat aux/tld.txt)" EXPECTED="$(mktemp)" @@ -22,25 +24,45 @@ 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/). + ## Links -- [home page](https://$TLD/$PROJECT/) +- [homepage](https://$TLD/$PROJECT/) - [source code](https://git.euandreh.xyz/$PROJECT/) - [bug tracking](https://$TLD/$PROJECT/TODOs.html) -- [mailing list](https://lists.sr.ht/~euandreh/$MAILING_LIST?search=%5B$PROJECT%5D) +- [mailing list] - [CI logs](https://$TLD/$PROJECT/ci.html) - [CHANGELOG](https://$TLD/$PROJECT/CHANGELOG.html) + +[mailing list]: https://lists.sr.ht/~euandreh/$MAILING_LIST?search=%5B$PROJECT%5D EOF RELEASES_LIST="$(mktemp)" -for version in $(git tag | perl -e 'print reverse <>'); do - echo "- version [$version](https://git.euandreh.xyz/$PROJECT/snapshot/$PROJECT-$version.tar.gz) ([sig](https://git.euandreh.xyz/$PROJECT/snapshot/$PROJECT-$version.tar.gz.asc)), released in $(git log -1 --format=%cd --date=short "$version")" >> "$RELEASES_LIST" +add_release() { + DATE="$1" + VVERSION="$2" + echo "- version [$VVERSION](https://git.euandreh.xyz/$PROJECT/snapshot/$PROJECT-$VVERSION.tar.gz) ([sig](https://git.euandreh.xyz/$PROJECT/snapshot/$PROJECT-$VVERSION.tar.gz.asc)), released in $DATE" >> "$RELEASES_LIST" +} + +for VVERSION in $(git tag); do + DATE="$(git log -1 --format=%cd --date=short "$VVERSION")" + add_release "$DATE" "$VVERSION" +done + +# "$@" represents a list of tags to be also included in the verification. +# shellcheck disable=2068 +for VVERSION in $@; do + if ! git tag | grep -qF "$VVERSION"; then + DATE="$(date '+%Y-%m-%d')" + add_release "$DATE" "$VVERSION" + fi done if [ -s "$RELEASES_LIST" ]; then printf '\n\n## Releases\n\n' >> "$EXPECTED" - cat "$RELEASES_LIST" >> "$EXPECTED" + sort -r "$RELEASES_LIST" >> "$EXPECTED" fi cat <<EOF >> "$EXPECTED" @@ -50,10 +72,11 @@ cat <<EOF >> "$EXPECTED" 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://www.gnu.org/licenses/agpl-3.0.en.html +[AGPL-3.0-or-later]: https://git.euandreh.xyz/$PROJECT/tree/COPYING EOF if ! tail -n "$(wc -l < "$EXPECTED")" README.md | diff - "$EXPECTED"; then - echo 'Missing metadata at the end of README.md file' + echo 'Wrong metadata at the end of README.md file' + echo "See expected content at: $EXPECTED" exit 1 fi diff --git a/aux/workflow/dist.sh b/aux/workflow/dist.sh index c061a04..d0d3e02 100755 --- a/aux/workflow/dist.sh +++ b/aux/workflow/dist.sh @@ -4,12 +4,16 @@ set -eu DATE="$1" VVERSION="v$2" PROJECT="$3" +MAILING_LIST="$4" 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 "$PROJECT" "$VVERSION" +sh aux/workflow/assert-readme.sh "$PROJECT" "$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,7 +24,10 @@ 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" diff --git a/aux/workflow/preamble.md b/aux/workflow/preamble.md index 30efe0b..dcc2fc3 100644 --- a/aux/workflow/preamble.md +++ b/aux/workflow/preamble.md @@ -1,8 +1,6 @@ # About -TODOs for @PROJECT_UC@. - -See also [@TLD@/@PROJECT@/](https://@TLD@/@PROJECT@/) and [CI logs](https://@TLD@/@PROJECT@/ci.html). +TODOs for [@PROJECT_UC@](https://@TLD@/@PROJECT@/). Register a new one at [~euandreh/@MAILING_LIST@@lists.sr.ht](mailto:~euandreh/@MAILING_LIST@@lists.sr.ht?subject=%5B@PROJECT@%5D%20BUG%20or%20TASK%3A%20%3Cdescription%3E) |