@@ 1,6 1,7 @@
image: debian/sid
secrets:
- 275a0eb8-dca6-4b43-80f9-c12cb7d5af8a # yaxpeax-superh SSH key v2
+ - 9925918a-f2ce-4876-a6ab-ba0b69ca4422 # yaxpeax-superh auth token
packages:
- cargo
tasks:
@@ 27,3 28,16 @@ tasks:
git remote set-url origin 'git@git.sr.ht:~nabijaczleweli/yaxpeax-superh'
ssh-keyscan git.sr.ht > ~/.ssh/known_hosts
git push
+ - release: |
+ tag="$(git -C yaxpeax-superh describe --abbrev=0 --tags || echo HEAD~1)"
+ [ "$(git -C yaxpeax-superh rev-list -n1 "$tag")" = "$(git -C yaxpeax-superh rev-list -n1 HEAD)" ] || exit 0
+ mkdir "yaxpeax-superh-$tag-doc"
+ mv yaxpeax-superh-doc/* "yaxpeax-superh-$tag-doc"
+ tar -caf "yaxpeax-superh-$tag-doc.tbz2" "yaxpeax-superh-$tag-doc"
+ set +x # Avoid echoing the token
+ for f in *.tbz2; do
+ curl -H "Authorization: Bearer $(cat ~/.release-token)" \
+ -XPOST \
+ -F "file=@$f" \
+ "https://git.sr.ht/api/repos/yaxpeax-superh/artifacts/$tag"
+ done