diff options
author | EuAndreh <eu@euandre.org> | 2021-03-01 06:51:50 -0300 |
---|---|---|
committer | EuAndreh <eu@euandre.org> | 2021-03-01 06:51:50 -0300 |
commit | fa7c99c72d7635095e669e8aed9ef1d8db089df4 (patch) | |
tree | 680cda449bc8287cd422ab16bc23319ce68c6288 | |
parent | TODOs.md: Add #task-319021df-ebdb-40cd-8330-329e8d01b747 (diff) | |
download | euandre.org-fa7c99c72d7635095e669e8aed9ef1d8db089df4.tar.gz euandre.org-fa7c99c72d7635095e669e8aed9ef1d8db089df4.tar.xz |
Update files under aux/
Diffstat (limited to '')
-rw-r--r-- | Makefile | 15 | ||||
-rwxr-xr-x | aux/ci/ci-build.sh | 12 | ||||
-rwxr-xr-x | aux/ci/git-post-receive.sh | 4 | ||||
-rwxr-xr-x | aux/ci/git-pre-push.sh | 2 | ||||
-rw-r--r-- | aux/guix/pinned-channels.scm | 13 | ||||
-rwxr-xr-x | aux/workflow/README.sh | 43 | ||||
-rwxr-xr-x | aux/workflow/assert-changelog.sh | 14 | ||||
-rwxr-xr-x | aux/workflow/commonmark.sh | 17 | ||||
-rwxr-xr-x | aux/workflow/dist.sh | 23 | ||||
-rw-r--r-- | aux/workflow/public.sh | 15 | ||||
-rwxr-xr-x | aux/workflow/sign-tarballs.sh | 17 |
11 files changed, 144 insertions, 31 deletions
@@ -5,17 +5,16 @@ check: sh scripts/extract-translations.sh sh scripts/apply-translations.sh +dev-check: check + clean: rm -rf public/ _site/ -NAME_UC = website -NAME = $(NAME_UC) -MAILING_LIST = public-inbox -OUT = public - public: - JEKYLL_ENV=production jekyll build -d $(OUT) --trace - sh aux/workflow/TODOs.sh $(NAME_UC) $(NAME) $(MAILING_LIST) + sh aux/workflow/public.sh website website public-inbox + mv public/index.html public/README.html + JEKYLL_ENV=production jekyll build --trace + rsync -a _site/ public publish: public rsync -avzP public/ euandre.org:/home/user-data/www/default/ --delete @@ -23,4 +22,4 @@ publish: public serve: JEKYLL_ENV=production jekyll serve --future --livereload --trace -.PHONY: clean check publish serve +.PHONY: clean check dev-check publish serve diff --git a/aux/ci/ci-build.sh b/aux/ci/ci-build.sh index 311abf9..1c033fe 100755 --- a/aux/ci/ci-build.sh +++ b/aux/ci/ci-build.sh @@ -28,7 +28,7 @@ EOF cd - if [ -f ./aux/ci/report.sh ]; then sh aux/ci/report.sh "$PACKAGE" - rsync -avzzP public/ "/srv/http/$PACKAGE/" --delete + rsync -avzzP public/ "/srv/http/$PACKAGE/" fi printf "\n>>>\n>>> CI logs added as Git note.\n>>>\n>>> Run status was %s" "$STATUS" @@ -50,13 +50,7 @@ EOF RUNNER='sh -c' fi - if [ -f ./configure ]; then - COMMAND='./configure && make CC=cc clean check public' - else - COMMAND='make CC=cc clean check public' - fi - - $RUNNER "$COMMAND" + $RUNNER 'make clean dev-check public' rsync -avzzP public/ "/srv/http/$PACKAGE/" --delete -} | tee "$LOGFILE" 2>&1 +} 2>&1 | tee "$LOGFILE" diff --git a/aux/ci/git-post-receive.sh b/aux/ci/git-post-receive.sh index b169489..f8986ed 100755 --- a/aux/ci/git-post-receive.sh +++ b/aux/ci/git-post-receive.sh @@ -10,5 +10,5 @@ for n in $(seq 0 $((GIT_PUSH_OPTION_COUNT - 1))); do done PACKAGE="$(basename "$PWD" | cut -d. -f1)" # remove .git suffix -LOGS_DIR="/srv/ci/$PACKAGE/logs" -"/srv/ci/$PACKAGE/ci-build.sh" "$PACKAGE" "$LOGS_DIR" +LOGS_DIR="/opt/ci/$PACKAGE/logs" +"/opt/ci/$PACKAGE/ci-build.sh" "$PACKAGE" "$LOGS_DIR" diff --git a/aux/ci/git-pre-push.sh b/aux/ci/git-pre-push.sh index d90a4b4..5546cb2 100755 --- a/aux/ci/git-pre-push.sh +++ b/aux/ci/git-pre-push.sh @@ -2,7 +2,7 @@ set -eux PACKAGE="$(basename "$PWD")" -LOGS_DIR="/srv/ci/$PACKAGE/logs" +LOGS_DIR="/opt/ci/$PACKAGE/logs" REMOTE_GIT_DIR="/srv/git/$PACKAGE.git" DESCRIPTION="$(mktemp)" diff --git a/aux/guix/pinned-channels.scm b/aux/guix/pinned-channels.scm index aa1641e..b026813 100644 --- a/aux/guix/pinned-channels.scm +++ b/aux/guix/pinned-channels.scm @@ -1,4 +1,4 @@ -(list +(cons* (channel (name 'xyz-euandreh) (url "git://git.euandreh.xyz/package-repository") @@ -8,13 +8,4 @@ "d749e053e6db365069cb9b2ef47a78b06f9e7361" (openpgp-fingerprint "5BDA E9B8 B2F6 C6BC BB0D 6CE5 81F9 0EC3 CD35 6060")))) - (channel - (name 'guix) - (url "https://git.savannah.gnu.org/git/guix.git") - (commit - "5ab0ca056691aaf88570a8c719e0104ab0a17c48") - (introduction - (make-channel-introduction - "9edb3f66fd807b096b48283debdcddccfea34bad" - (openpgp-fingerprint - "BBB0 2DDF 2CEA F6A8 0D1D E643 A2A0 6DF2 A33A 54FA"))))) + %default-channels) diff --git a/aux/workflow/README.sh b/aux/workflow/README.sh new file mode 100755 index 0000000..e30344f --- /dev/null +++ b/aux/workflow/README.sh @@ -0,0 +1,43 @@ +#!/bin/sh +set -eu + +mkdir -p public + +PROJECT_UC="$1" +PROJECT="$2" +MAILING_LIST="$3" + +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" +done + +RELEASES="$(mktemp)" +if [ -s "$RELEASES_LIST" ]; then + printf '\n# Releases\n\n' >> "$RELEASES" + cat "$RELEASES_LIST" >> "$RELEASES" +fi + +LINKS="$(mktemp)" +cat <<EOF > "$LINKS" + +# Links + +- [home page](https://$PROJECT.euandreh.xyz) +- [source code](https://git.euandreh.xyz/$PROJECT/about/) +- [bug tracking](https://$PROJECT.euandreh.xyz/TODOs.html) +- [mailing list](https://lists.sr.ht/~euandreh/$MAILING_LIST?search=%5B$PROJECT%5D) +- [CI logs](https://$PROJECT.euandreh.xyz/ci.html) +- [CHANGELOG](https://$PROJECT.euandreh.xyz/CHANGELOG.html) +EOF + +cat "README.md" "$LINKS" "$RELEASES" | \ + pandoc --toc \ + --highlight-style pygments \ + --toc-depth=2 \ + -s \ + --metadata title="$PROJECT_UC - README" \ + --metadata lang=en \ + -r commonmark \ + -w html \ + > public/index.html diff --git a/aux/workflow/assert-changelog.sh b/aux/workflow/assert-changelog.sh new file mode 100755 index 0000000..d39f527 --- /dev/null +++ b/aux/workflow/assert-changelog.sh @@ -0,0 +1,14 @@ +#!/bin/sh +set -eu + +PROJECT="$1" + +for VVERSION in $(git tag); do + VERSION="${VVERSION#v}" + DATE="$(git log -1 --format=%cd --date=short "$VVERSION")" + 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 +done diff --git a/aux/workflow/commonmark.sh b/aux/workflow/commonmark.sh new file mode 100755 index 0000000..e9609c2 --- /dev/null +++ b/aux/workflow/commonmark.sh @@ -0,0 +1,17 @@ +#!/bin/sh +set -eu + +mkdir -p public + +PROJECT_UC="$1" +F="$2" + +pandoc --toc \ + --highlight-style pygments \ + --toc-depth=2 \ + -s \ + --metadata title="$PROJECT_UC - ${F%.*}" \ + --metadata lang=en \ + -r commonmark \ + -w html \ + < "$F" > "public/${F%.*}.html" diff --git a/aux/workflow/dist.sh b/aux/workflow/dist.sh new file mode 100755 index 0000000..afe2c92 --- /dev/null +++ b/aux/workflow/dist.sh @@ -0,0 +1,23 @@ +#!/bin/sh +set -eu + +DATE="$1" +VERSION="$2" +VVERSION="v$2" +PROJECT="$3" + +if git show "$VVERSION" 1>/dev/null 2>/dev/null; then + echo "Version '$VVERSION' already exists." >&2 + exit 1 +fi + +if [ "$DATE" != "$(git log -1 --format=%cd --date=short HEAD)" ]; then + echo "Date '$DATE' is not up-to-date." >&2 + exit 1 +fi + +sh aux/workflow/assert-changelog.sh "$DATE" "$VERSION" "$PROJECT" + +git tag "$VVERSION" + +sh aux/workflow/sign-tarballs.sh "$PROJECT" diff --git a/aux/workflow/public.sh b/aux/workflow/public.sh new file mode 100644 index 0000000..4c90225 --- /dev/null +++ b/aux/workflow/public.sh @@ -0,0 +1,15 @@ +#!/bin/sh +set -eu + +PROJECT_UC="$1" +PROJECT="$2" +MAILING_LIST="$3" + +sh aux/workflow/TODOs.sh "$PROJECT_UC" "$PROJECT" "$MAILING_LIST" +sh aux/workflow/README.sh "$PROJECT_UC" "$PROJECT" "$MAILING_LIST" + +if [ -f CHANGELOG.md ]; then + sh aux/workflow/commonmark.sh "$PROJECT" CHANGELOG.md +fi + +sh aux/ci/report.sh "$PROJECT" diff --git a/aux/workflow/sign-tarballs.sh b/aux/workflow/sign-tarballs.sh new file mode 100755 index 0000000..b88ff33 --- /dev/null +++ b/aux/workflow/sign-tarballs.sh @@ -0,0 +1,17 @@ +#!/bin/sh +set -eu + +PROJECT="$1" + +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.gz add -f -C "$( + git archive --format tar.gz --prefix "$PROJECT-${tag#v}/" "$tag" | + gpg --output - --armor --detach-sign | + git hash-object -w --stdin + )" "$tag" + fi +done |