9cde705f5d0d5a3cb871385c7bf50bf177395ad2 — Simon Ser a month ago 21493ca
bin/submit-build: new command
1 files changed, 19 insertions(+), 0 deletions(-)

A bin/submit-build
A bin/submit-build => bin/submit-build +19 -0
@@ 0,0 1,19 @@
+ #!/bin/sh -eu
+ 
+ . ~/.config/sr.ht
+ 
+ if [ $# -eq 1 ]
+ then
+     manifest=$1
+ else
+     manifest=.build.yml
+ fi
+ 
+ build_id=$(http \
+     "${BUILDSRHT:-https://builds.sr.ht}/api/jobs" \
+     manifest=@$manifest \
+     tags:='["'$(basename $(pwd))'"]' \
+     Authorization:"token $oauth_token" \
+     | jq -r .id)
+ echo "Submitted #$build_id"
+ xdg-open ${BUILDSRHT:-https://builds.sr.ht}/'~sircmpwn'/job/$build_id