From e2591fdae7282fe8dca3c797f70933ae1c255764 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=BD=D0=B0=D0=B1?= Date: Tue, 30 Nov 2021 23:36:39 +0100 Subject: [PATCH] Upload build artifacts to tag like tzpfms --- .build.yml | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/.build.yml b/.build.yml index 031d951..062ca86 100644 --- a/.build.yml +++ b/.build.yml @@ -1,6 +1,7 @@ image: debian/sid secrets: - d9cc88fb-6e8e-4ff6-b2bf-d0ec6641bb15 # klapki SSH key v2 + - 1c5b3bab-c76c-4964-a5f7-6d6754715c16 # klapki auth token packages: - clang - llvm-dev @@ -23,7 +24,7 @@ tasks: git -C klapki/ worktree add ../klapki-man man cd klapki-man git ls-tree -z --name-only HEAD | xargs -0 rm -r - mv ../klapki/out/man/* . + cp ../klapki/out/man/* . sed -e 's/…/.../g' *.[12345678] | groff -K utf8 -tpe -mdoc -Tps > klapki.ps ps2pdf klapki.ps klapki.pdf git add . @@ -33,3 +34,21 @@ tasks: git remote set-url origin 'git@git.sr.ht:~nabijaczleweli/klapki' ssh-keyscan git.sr.ht > ~/.ssh/known_hosts git push + - release: | + tag="$(git -C klapki describe --abbrev=0 --tags || echo HEAD~1)" + [ "$(git -C klapki rev-list -n1 "$tag")" = "$(git -C klapki rev-list -n1 HEAD)" ] || exit 0 + mkdir "klapki-$tag-bin-amd64" + mv klapki/out/klapki "klapki-$tag-bin-amd64" + mv klapki/out/man "klapki-$tag-man" + mv klapki-man/klapki.ps "klapki-$tag-manual.ps" + mv klapki-man/klapki.pdf "klapki-$tag-manual.pdf" + for s in bin-amd64 man; do + tar -cvaf "klapki-$tag-$s.tbz2" "klapki-$tag-$s" + done + set +x # Avoid echoing the token + for f in *.tbz2 "klapki-$tag-manual.ps" "klapki-$tag-manual.pdf"; do + curl -H "Authorization: Bearer $(cat ~/.release-token)" \ + -XPOST \ + -F "file=@$f" \ + "https://git.sr.ht/api/repos/klapki/artifacts/$tag" + done -- 2.45.2