forked from stashapp/stash
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathupload-pull-request.sh
38 lines (31 loc) · 1.08 KB
/
upload-pull-request.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/bin/sh
# assumes cross-compile.sh has already been run successfully
uploadFile()
{
FILE=$1
BASENAME="$(basename "${FILE}")"
# get available server from gofile api
serverApi=$(curl -m 15 https://apiv2.gofile.io/getServer)
resp=$(echo "$serverApi" | cut -d "\"" -f 4)
# if no server is available abort
if [ $resp != "ok" ] ; then
echo "Upload of $BASENAME failed! Server not available."
echo
return
fi
server=$(echo "$serverApi" | cut -d "," -f 2 | cut -d "\"" -f 6)
# abort if it takes more than two minutes to upload
uploadedTo=$(curl -m 120 -F "[email protected]" -F "file=@$FILE" "https://$server.gofile.io/uploadFile")
resp=$(echo "$uploadedTo" | cut -d "\"" -f 4)
if [ $resp = "ok" ] ; then
URL=$(echo "$uploadedTo"|cut -d "," -f 2 | cut -d "\"" -f 6)
echo "$BASENAME uploaded to url: \"https://gofile.io/d/$URL\""
fi
# print an extra newline
echo
}
uploadFile "dist/stash-osx"
uploadFile "dist/stash-win.exe"
uploadFile "dist/stash-linux"
echo "SHA1 Checksums"
cat CHECKSUMS_SHA1 | grep -v '\-pi\|\-arm'