forked from electron-userland/electron-builder-binaries
-
Notifications
You must be signed in to change notification settings - Fork 0
/
winCodeSign.sh
executable file
·36 lines (29 loc) · 1.1 KB
/
winCodeSign.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
#!/usr/bin/env bash
set -e
NAME=winCodeSign
version=`cat $NAME/version.txt`
archiveFileName=$NAME-$version.7z
archiveFile=out/$archiveFileName
rm -f $archiveFile
cd $NAME
../ 7za a -m0=lzma2 -mx=9 -mfb=64 -md=64m -ms=on ../$archiveFile .
cd ..
if [ -z "$BT_ACCOUNT" ] ; then
SEC=`security find-generic-password -l BINTRAY_API_KEY -g 2>&1`
BT_ACCOUNT=`echo "$SEC" | grep "acct" | cut -d \" -f 4`
BT_API_KEY=`echo "$SEC" | grep "password" | cut -d \" -f 2`
fi
curl --progress-bar -T $archiveFile -u${BT_ACCOUNT}:${BT_API_KEY} "https://api.bintray.com/content/electron-userland/bin/$NAME/$version/$archiveFileName?override=1&publish=1&list_in_downloads=1" > out/result
result=`cat out/result`
if [ "$result" != '{"message":"success"}' ]; then
>&2 echo "$result"
exit 1
fi
echo "sleep 10 seconds to add file to downloads list"
secs=$((10))
while [ $secs -gt 0 ]; do
echo -ne "$secs\033[0K\r"
sleep 1
: $((secs--))
done
curl -u${BT_ACCOUNT}:${BT_API_KEY} -H Content-Type:application/json -X PUT -d '{"list_in_downloads": true}' https://api.bintray.com/file_metadata/electron-userland/bin/$archiveFileName