image: debian/sid secrets: - ccb6777e-650b-4fa2-87e1-e2342f5bb605 # tzpfms SSH key - b26aef46-5e87-45b1-a64d-d136ccde36a7 # tzpfms auth token packages: - clang - llvm-dev - pkg-config - libtss2-dev - libtspi-dev - libssl-dev - gettext - mandoc - shellcheck - curl - groff - ghostscript tasks: - get-zfs: | sudo sed -i 's/main/main contrib/' /etc/apt/sources.list sudo apt-get update sudo apt-get install -y libzfslinux-dev - build-gcc: | cd tzpfms (cd src/bin/; ln -s ../../contrib/*.cpp .) make find out/ -maxdepth 1 -type f -exec readelf -d {} + | tee /dev/stderr | grep Shared | LC_ALL=C sort -u make clean find src/bin/ -type l -delete - build-clang: | cd tzpfms CC=clang CXX=clang++ make find out/ -maxdepth 1 -type f -exec readelf -d {} + | tee /dev/stderr | grep Shared | LC_ALL=C sort -u - manpages: | sudo sh -c 'curl https://git.sr.ht/~nabijaczleweli/groff-1.23-unfucking/blob/trunk/mdoc.local >> /etc/groff/mdoc.local' git -C tzpfms/ worktree add ../tzpfms-man man cd tzpfms-man git ls-tree -z --name-only HEAD | grep -z tpm | xargs -0 rm -r cp -pr ../tzpfms/out/man/* . sed -e 's/…/.../g' $(ls *.[12345678] | awk -F. '{print $2 "\t" $1}' | sort | awk -F'\t' '{print $2 "." $1}') | groff -K utf8 -tpe -mdoc -Tps -dpaper=a4 -P-pa4 > tzpfms.ps ps2pdf -sPAPERSIZE=a4 tzpfms.ps tzpfms.pdf git add . git config user.email "nabijaczleweli/autouploader@nabijaczleweli.xyz" git config user.name "наб autouploader" git commit -m "Manpage update by job $JOB_ID" || exit 0 git remote set-url origin 'git@git.sr.ht:~nabijaczleweli/tzpfms' ssh-keyscan git.sr.ht > ~/.ssh/known_hosts git push - release: | set -o posix # bash in non-POSIX mode doesn't process aliases non-interactively. good shell. tag="$(git -C tzpfms describe --abbrev=0 --tags || echo HEAD~1)" [ "$(git -C tzpfms rev-list -n1 "$tag")" = "$(git -C tzpfms rev-list -n1 HEAD)" ] || exit 0 mkdir "tzpfms-$tag-bin-amd64" mv tzpfms/out/zfs-tpm* "tzpfms-$tag-bin-amd64" mv tzpfms/out/locale "tzpfms-$tag-bin-amd64" mv tzpfms/out/dracut "tzpfms-$tag-dracut" mv tzpfms/out/initramfs-tools "tzpfms-$tag-initramfs-tools" mv tzpfms/out/systemd "tzpfms-$tag-systemd" mv tzpfms/out/man "tzpfms-$tag-man" mv tzpfms-man/tzpfms.ps "tzpfms-$tag-manual.ps" mv tzpfms-man/tzpfms.pdf "tzpfms-$tag-manual.pdf" for s in bin-amd64 dracut initramfs-tools systemd man; do tar -caf "tzpfms-$tag-$s.tbz2" "tzpfms-$tag-$s" done sha256sum *.tbz2 "tzpfms-$tag-manual.ps" "tzpfms-$tag-manual.pdf" set +x # Avoid echoing the token alias curl="curl --oauth2-bearer $(cat ~/.release-token)" id="$(curl -F operations='{"query": "{me {repository(name: \"tzpfms\") {id}}}"}' -F map='{}' https://git.sr.ht/query | tr -cd 0-9)" for f in *.tbz2 "tzpfms-$tag-manual.ps" "tzpfms-$tag-manual.pdf"; do curl -F operations='{ "query": "mutation($id: Int!, $rev: String!, $file: Upload!) {uploadArtifact(repoId: $id, revspec: $rev, file: $file) { created, filename, checksum } }", "variables": { "file": null, "rev": "'"$(git -C tzpfms rev-list -n1 "$tag")"'", "id": '"$id"' } }' \ -F map='{ "a": ["variables.file"] }' \ -F a=@"$f" \ https://git.sr.ht/query echo done