2017-01-03 14:54:15 +00:00
|
|
|
if [ $# -eq 0 ]; then
|
|
|
|
if [ "$TRAVIS_PULL_REQUEST" != false ]; then
|
|
|
|
echo "Need to supply version argument" && exit;
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2017-01-07 10:24:53 +00:00
|
|
|
# Use mono or .net depending on OS
|
|
|
|
case "$(uname -s)" in
|
|
|
|
CYGWIN*|MINGW32*|MINGW64*|MSYS*)
|
|
|
|
# on windows, use dotnet
|
|
|
|
runtime="dotnet"
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
# otherwise use mono
|
|
|
|
runtime="mono"
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
2017-01-03 14:54:15 +00:00
|
|
|
if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then
|
2017-01-03 15:29:49 +00:00
|
|
|
VERSION="`date +%H:%M:%S`"
|
2017-01-03 14:54:15 +00:00
|
|
|
YEAR="`date +%Y`"
|
|
|
|
MONTH="`date +%m`"
|
|
|
|
DAY="`date +%d`"
|
|
|
|
else
|
|
|
|
VERSION=$1
|
|
|
|
fi
|
2017-01-03 13:18:13 +00:00
|
|
|
outputFolder='./_output'
|
|
|
|
outputFolderMono='./_output_mono'
|
|
|
|
outputFolderOsx='./_output_osx'
|
|
|
|
outputFolderOsxApp='./_output_osx_app'
|
|
|
|
|
2017-01-05 16:20:30 +00:00
|
|
|
tr -d "\r" < $outputFolderOsxApp/Radarr.app/Contents/MacOS/Sonarr > $outputFolderOsxApp/Radarr.app/Contents/MacOS/Sonarr2
|
|
|
|
rm $outputFolderOsxApp/Radarr.app/Contents/MacOS/Sonarr
|
|
|
|
chmod +x $outputFolderOsxApp/Radarr.app/Contents/MacOS/Sonarr2
|
|
|
|
mv $outputFolderOsxApp/Radarr.app/Contents/MacOS/Sonarr2 $outputFolderOsxApp/Radarr.app/Contents/MacOS/Sonarr >& error.log
|
2017-01-03 16:35:47 +00:00
|
|
|
|
2017-01-07 10:24:53 +00:00
|
|
|
if [ $runtime = "dotnet" ] ; then
|
2017-01-07 11:40:19 +00:00
|
|
|
./7za.exe a Radarr_Windows_$VERSION.zip ./Radarr_Windows_$VERSION/*
|
|
|
|
./7za.exe a -ttar -so Radarr_Mono_$VERSION.tar ./Radarr_Mono_$VERSION/* | ./7za.exe a -si Radarr_Mono_$VERSION.tar.gz
|
2017-01-07 11:49:10 +00:00
|
|
|
./7za.exe a -ttar -so Radarr_OSX_$VERSION.tar ./_output_osx/* | ./7za.exe a -si Radarr_OSX_$VERSION.tar.gz
|
|
|
|
./7za.exe a -ttar -so Radarr_OSX_App_$VERSION.tar ./_output_osx_app/* | ./7za.exe a -si Radarr_OSX_App_$VERSION.tar.gz
|
2017-01-07 10:24:53 +00:00
|
|
|
else
|
2017-04-12 19:20:33 +00:00
|
|
|
zip -r Radarr_Windows_$VERSION.zip Radarr_Windows_$VERSION/*
|
|
|
|
tar -zcvf Radarr_Mono_$VERSION.tar.gz Radarr_Mono_$VERSION #TODO update for tar.gz
|
2017-04-12 19:23:02 +00:00
|
|
|
tar -zcvf Radarr_OSX_$VERSION.tar.gz _output_osx
|
|
|
|
zip -r Radarr_OSX_APP_$VERSION.zip _output_osx_app/*
|
2017-01-07 10:24:53 +00:00
|
|
|
fi
|
2017-04-12 14:45:13 +00:00
|
|
|
# ftp -n ftp.leonardogalli.ch << END_SCRIPT
|
|
|
|
# passive
|
|
|
|
# quote USER $FTP_USER
|
|
|
|
# quote PASS $FTP_PASS
|
|
|
|
# mkdir builds
|
|
|
|
# cd builds
|
|
|
|
# mkdir $YEAR
|
|
|
|
# cd $YEAR
|
|
|
|
# mkdir $MONTH
|
|
|
|
# cd $MONTH
|
|
|
|
# mkdir $DAY
|
|
|
|
# cd $DAY
|
|
|
|
# binary
|
|
|
|
# put Radarr_Windows_$VERSION.zip
|
|
|
|
# put Radarr_Mono_$VERSION.zip
|
|
|
|
# put Radarr_OSX_$VERSION.zip
|
|
|
|
# quit
|
|
|
|
# END_SCRIPT
|