2017-01-03 15:54:15 +01:00
|
|
|
if [ $# -eq 0 ]; then
|
|
|
|
if [ "$TRAVIS_PULL_REQUEST" != false ]; then
|
|
|
|
echo "Need to supply version argument" && exit;
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2017-01-07 11:24:53 +01: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 15:54:15 +01:00
|
|
|
if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then
|
2017-09-24 13:16:05 +02:00
|
|
|
VERSION="$(date +%H:%M:%S)"
|
|
|
|
YEAR="$(date +%Y)"
|
|
|
|
MONTH="$(date +%m)"
|
|
|
|
DAY="$(date +%d)"
|
2017-01-03 15:54:15 +01:00
|
|
|
else
|
|
|
|
VERSION=$1
|
2017-04-12 21:46:33 +02:00
|
|
|
BRANCH=$2
|
2017-04-12 21:57:59 +02:00
|
|
|
BRANCH=${BRANCH#refs\/heads\/}
|
|
|
|
BRANCH=${BRANCH//\//-}
|
2017-01-03 15:54:15 +01:00
|
|
|
fi
|
2017-01-03 14:18:13 +01:00
|
|
|
outputFolder='./_output'
|
|
|
|
outputFolderMono='./_output_mono'
|
|
|
|
outputFolderOsx='./_output_osx'
|
|
|
|
outputFolderOsxApp='./_output_osx_app'
|
|
|
|
|
2017-04-26 18:44:57 +02:00
|
|
|
tr -d "\r" < $outputFolderOsxApp/Radarr.app/Contents/MacOS/Radarr > $outputFolderOsxApp/Radarr.app/Contents/MacOS/Radarr2
|
|
|
|
rm $outputFolderOsxApp/Radarr.app/Contents/MacOS/Radarr
|
|
|
|
chmod +x $outputFolderOsxApp/Radarr.app/Contents/MacOS/Radarr2
|
|
|
|
mv $outputFolderOsxApp/Radarr.app/Contents/MacOS/Radarr2 $outputFolderOsxApp/Radarr.app/Contents/MacOS/Radarr >& error.log
|
2017-01-03 17:35:47 +01:00
|
|
|
|
2017-01-07 11:24:53 +01:00
|
|
|
if [ $runtime = "dotnet" ] ; then
|
2018-11-23 08:05:47 +01:00
|
|
|
./tools/7zip/7za.exe a Radarr_Windows_$VERSION.zip ./Radarr_Windows_$VERSION/*
|
|
|
|
./tools/7zip/7za.exe a -ttar -so Radarr_Mono_$VERSION.tar ./Radarr_Mono_$VERSION/* | ./tools/7zip/7za.exe a -si Radarr_Mono_$VERSION.tar.gz
|
|
|
|
./tools/7zip/7za.exe a -ttar -so Radarr_OSX_$VERSION.tar ./_output_osx/* | ./tools/7zip/7za.exe a -si Radarr_OSX_$VERSION.tar.gz
|
|
|
|
./tools/7zip/7za.exe a -ttar -so Radarr_OSX_App_$VERSION.tar ./_output_osx_app/* | ./tools/7zip/7za.exe a -si Radarr_OSX_App_$VERSION.tar.gz
|
2017-01-07 11:24:53 +01:00
|
|
|
else
|
2017-04-12 21:46:33 +02:00
|
|
|
cp -r $outputFolder/ Radarr
|
|
|
|
zip -r Radarr.$BRANCH.$VERSION.windows.zip Radarr
|
|
|
|
rm -rf Radarr
|
|
|
|
cp -r $outputFolderMono/ Radarr
|
|
|
|
tar -zcvf Radarr.$BRANCH.$VERSION.linux.tar.gz Radarr
|
|
|
|
rm -rf Radarr
|
|
|
|
cp -r $outputFolderOsx/ Radarr
|
|
|
|
tar -zcvf Radarr.$BRANCH.$VERSION.osx.tar.gz Radarr
|
|
|
|
rm -rf Radarr
|
|
|
|
#TODO update for tar.gz
|
|
|
|
|
2017-04-12 22:31:49 +02:00
|
|
|
cd _output_osx_app/
|
|
|
|
zip -r ../Radarr.$BRANCH.$VERSION.osx-app.zip *
|
2017-01-07 11:24:53 +01:00
|
|
|
fi
|
2017-04-12 16:45:13 +02: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
|