mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-11 00:24:47 -07:00
add github actions (#4164)
This commit is contained in:
parent
45d838a0b3
commit
4aaedf64d2
11 changed files with 425 additions and 334 deletions
19
.ci/get_github_upload_url.sh
Executable file
19
.ci/get_github_upload_url.sh
Executable 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
|
||||
Loading…
Add table
Add a link
Reference in a new issue