add github actions (#4164)

This commit is contained in:
ebbit1q 2020-11-23 02:20:48 +01:00 committed by GitHub
parent 45d838a0b3
commit 4aaedf64d2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 425 additions and 334 deletions

19
.ci/get_github_upload_url.sh Executable file
View file

@ -0,0 +1,19 @@
#!/bin/bash
# this script is to be used by the ci to fetch the github upload url
# using curl and jq
[[ $ref ]] || missing+=" ref"
[[ $repo ]] || missing+=" repo"
if [[ $missing ]]; then
echo "missing env:$missing" >&2
exit 2
fi
tag="${ref##*/}"
api_url="https://api.github.com/repos/$repo/releases/tags/$tag"
upload_url="$(curl "$api_url" | jq -r '.upload_url')"
if [[ $upload_url && $upload_url != null ]]; then
echo "$upload_url"
exit 0
else
echo "failed to fetch upload url from $api_url" >&2
exit 1
fi