diff options
Diffstat (limited to '')
-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 | 17 | ||||
-rwxr-xr-x | aux/workflow/assert-todos.sh | 3 | ||||
-rwxr-xr-x | aux/workflow/commonmark.sh | 10 | ||||
-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 | 38 | ||||
-rwxr-xr-x | aux/workflow/sign-tarballs.sh | 17 | ||||
-rw-r--r-- | aux/workflow/style.css | 99 |
10 files changed, 159 insertions, 75 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..c58a600 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://euandreh.xyz/%s.git/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..7afeb4c 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,13 +48,14 @@ 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 - [homepage](https://$TLD/$PROJECT/en/) -- [source code](https://git.euandreh.xyz/$PROJECT/) +- [source code](https://euandreh.xyz/$PROJECT.git/) - [bug tracking](https://$TLD/$PROJECT/TODOs.html) - [mailing list] - [CI logs](https://$TLD/$PROJECT/ci.html) @@ -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://euandreh.xyz/$PROJECT.git/commit/?id=$VVERSION) [$PROJECT-$VVERSION.tar.gz](https://euandreh.xyz/$PROJECT.git/snapshot/$PROJECT-$VVERSION.tar.gz) ([sig](https://euandreh.xyz/$PROJECT.git/snapshot/$PROJECT-$VVERSION.tar.gz.asc)) - $DATE" >> "$RELEASES_LIST" } for VVERSION in $(git tag); do @@ -89,9 +94,11 @@ 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 +[AGPL-3.0-or-later]: https://euandreh.xyz/.git$PROJECT/tree/COPYING EOF if ! tail -n "$(wc -l < "$EXPECTED")" README.md | diff - "$EXPECTED"; then 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/commonmark.sh b/aux/workflow/commonmark.sh index 6f5e59b..088d447 100755 --- a/aux/workflow/commonmark.sh +++ b/aux/workflow/commonmark.sh @@ -1,7 +1,7 @@ #!/bin/sh set -eu -while getopts 'N:t:l:' flag; do +while getopts 'N:t:l:H:' flag; do case "$flag" in N) PROJECT_UC="$OPTARG" @@ -12,6 +12,9 @@ while getopts 'N:t:l:' flag; do l) THE_LANG="$OPTARG" ;; + H) + ALTERNATES="$OPTARG" + ;; *) exit 2 ;; @@ -29,6 +32,7 @@ assert_arg() { assert_arg "${PROJECT_UC:-}" '-N PROJECT_UC' assert_arg "${TITLE:-}" '-t TITLE' assert_arg "${THE_LANG:-}" '-l THE_LANG' +assert_arg "${ALTERNATES:-}" '-H ALTERNATES' pandoc \ --toc \ @@ -39,4 +43,6 @@ pandoc \ --metadata "lang=$THE_LANG" \ -r commonmark \ -w html \ - -H aux/workflow/favicon.html + -H aux/workflow/favicon.html \ + -H aux/workflow/style.css \ + -H "$ALTERNATES" 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..2c8c36a 100755 --- a/aux/workflow/public.sh +++ b/aux/workflow/public.sh @@ -1,6 +1,9 @@ #!/bin/sh set -eu +TLD="$(cat aux/tld.txt)" +. aux/lib.sh + PROJECT_UC= while getopts 'n:N:m:o:l:' flag; do case "$flag" in @@ -39,19 +42,42 @@ assert_arg "${OUTDIR:-}" '-o OUTDIR' assert_arg "${LANGS:-}" '-l LANGS' PROJECT_UC="${PROJECT_UC:-$PROJECT}" + +alternates_for() { + ALTERNATES="$(mkstemp)" + lang="$1" + OUTNAME="$2" + for l in $LANGS; do + if [ "$l" = "$lang" ]; then + continue + fi + cat <<EOF >> "$ALTERNATES" +<link rel="alternate" href="https://$TLD/$PROJECT/$l/$OUTNAME" hreflang="$l" /> +EOF + done + echo "$ALTERNATES" +} + + 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" -l "$lang" -t README \ + -H "$(alternates_for "$lang" '')" \ + < "README.$lang.md" > "$OUTDIR/$lang/index.html" + sh aux/workflow/commonmark.sh \ + -N "$PROJECT" -l "$lang" -t CHANGELOG \ + -H "$(alternates_for "$lang" 'CHANGELOG.html')" \ + < "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 diff --git a/aux/workflow/style.css b/aux/workflow/style.css index d72991e..56e4712 100644 --- a/aux/workflow/style.css +++ b/aux/workflow/style.css @@ -1,41 +1,62 @@ <style> - hr { - background-color: #ccc; - } - - .header-anchor { - opacity: 0.5; - } - - .tag { - font-family: monospace; - font-size: 70%; - background-color: lightgray; - padding: 3px; - border-radius: 5px; - } - - .TODO { - color: brown; - } - - .DOING { - color: yellowgreen; - } - - .WAITING, .MEETING { - color: orange; - } - - .INACTIVE { - color: gray; - } - - .NEXT { - color: red; - } - - .CANCELLED, .DONE, .WONTFIX { - color: green; - } + @media(prefers-color-scheme: dark) { + :root { + color: white; + background-color: black; + } + + a { + color: hsl(211, 100%, 60%); + } + + a:visited { + color: hsl(242, 100%, 80%); + } + } + + body { + max-width: 800px; + margin: 0 auto 0 auto; + } + + hr { + background-color: #ccc; + } + + .header-anchor { + opacity: 0.5; + } + + .tag { + font-family: monospace; + font-size: 70%; + background-color: lightgray; + color: black; + padding: 3px; + border-radius: 5px; + } + + .TODO { + color: brown; + } + + .DOING { + color: yellowgreen; + } + + .WAITING, .MEETING { + color: orange; + } + + .INACTIVE { + color: gray; + } + + .NEXT { + color: red; + } + + .CANCELLED, .DONE, .WONTFIX { + color: green; + } </style> |