Try new upload script
This commit is contained in:
parent
f3ec856995
commit
2e9b4bf07c
2 changed files with 29 additions and 1 deletions
|
@ -42,4 +42,4 @@ script:
|
||||||
|
|
||||||
|
|
||||||
after_script:
|
after_script:
|
||||||
- bash scripts/travis-upload.sh
|
- sh travis-upload.sh *.apk
|
||||||
|
|
28
travis-upload.sh
Normal file
28
travis-upload.sh
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
# Upload travis generated APKs to the Transfer.sh and Yandex.Disk
|
||||||
|
|
||||||
|
getDaysSinceRelease()
|
||||||
|
{
|
||||||
|
printf %04d $(( ( $(date +'%s') - $(date -ud '2015-04-01' +'%s') )/60/60/24 ))
|
||||||
|
}
|
||||||
|
|
||||||
|
DAYSSINCERELEASE=`getDaysSinceRelease`
|
||||||
|
COMMITHASH=$(git rev-parse --short HEAD)
|
||||||
|
#CURRENTBRANCH=$(git rev-parse --abbrev-ref HEAD)
|
||||||
|
|
||||||
|
|
||||||
|
PREFIX=$DAYSSINCERELEASE-$(date +"%H-%M")
|
||||||
|
POSTFIX=$COMMITHASH
|
||||||
|
|
||||||
|
while [[ $1 ]]; do
|
||||||
|
FNAME=$1
|
||||||
|
FILE_BASE=${FNAME%.*}
|
||||||
|
FILE_EXT="${FNAME##*.}"
|
||||||
|
OUTNAME=$PREFIX-$FILE_BASE-$POSTFIX.$FILE_EXT
|
||||||
|
echo $FNAME: `curl --upload-file $FNAME https://transfer.sh/$OUTNAME`
|
||||||
|
curl -T $FNAME -u $YADISK_USERNAME:$YADISK_PASSWORD https://webdav.yandex.ru/XashTestVersions/$YADISKPATH/$OUTNAME
|
||||||
|
curl -T xashdroid-armv7.apk -u $YADISK_USERNAME:$YADISK_PASSWORD https://webdav.yandex.ru/XashTestVersions/current-$FILE_BASE-$TRAVIS_BRANCH.$FILE_EXT
|
||||||
|
shift
|
||||||
|
done
|
||||||
|
exit 0
|
Loading…
Add table
Reference in a new issue