2018-05-24 09:55:25 +00:00
#!/bin/bash
set -ex -o xtrace
BUILDPATH = ${ PWD }
BRANCH = "`git log --max-count=1 --date=short --abbrev=8 --pretty=format:" %cd_%h"`"
2018-11-20 12:02:29 +00:00
git clone --single-branch https://${ GH_TOKEN } @github.com/OpenSC/Nightly.git > /dev/null 2>& 1
2018-05-24 09:55:25 +00:00
cd Nightly
git checkout -b " ${ BRANCH } "
2019-10-17 21:28:50 +00:00
for file in ${ BUILDPATH } /win32/Output/OpenSC*.exe ${ BUILDPATH } /opensc*.tar.gz ${ BUILDPATH } /OpenSC*.dmg ${ BUILDPATH } /OpenSC*.msi ${ BUILDPATH } /OpenSC*.zip ${ BUILDPATH } /*.pkg
2018-05-24 09:55:25 +00:00
do
if [ -f ${ file } ]
then
cp ${ file } .
git add ` basename ${ file } `
fi
done
git commit --message " $1 "
2019-10-17 22:41:10 +00:00
i = 0
while [ $i -le 10 ] && ! git push --quiet --set-upstream origin " ${ BRANCH } "
do
2018-05-24 09:55:25 +00:00
sleep $[ ( $RANDOM % 32 ) + 1 ] s
git pull --rebase origin " ${ BRANCH } "
2019-10-17 22:41:10 +00:00
i = $(( $i + 1 ))
done