autobuild 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. #!/bin/bash
  2. cd ../..
  3. # Check which revision to build.
  4. if [ -z $2 ]; then
  5. buildrev="tip"
  6. else
  7. buildrev=$2
  8. fi
  9. # Update to the appropriate revision.
  10. hg pull
  11. hg update $buildrev
  12. # Set the displayversion.
  13. if [ -z $3 ]; then
  14. if [ "$buildrev" == "tip" ]; then
  15. # Get the current SVN version, use sed to remove any non-numbers.
  16. currentversion=`hg log -l1 | grep changeset | sed 's/.*://g'`
  17. currentdate=`date +%Y%m%d`
  18. displayversion="$currentdate-$currentversion"
  19. else
  20. # The revision is already specified, so we'll use that as the
  21. # display version.
  22. displayversion="$buildrev"
  23. fi
  24. else
  25. # If the param is present, it overrides everything else.
  26. displayversion=$3
  27. fi
  28. cd platform/macosx
  29. outfile="love-$displayversion-macosx-ub"
  30. outdmg="$outfile.dmg"
  31. outlog="$outfile.log"
  32. xcodebuild > $outlog 2>&1
  33. cp love.dmg $outdmg
  34. # Deal with uploading.
  35. if [ "$1" == "build" ]; then
  36. pass=`cat pwtehlol`
  37. ftp -u ftp://love2d:[email protected]/public_html/builds/files/$outdmg $outdmg
  38. ftp -u ftp://love2d:[email protected]/public_html/builds/files/$outlog $outlog
  39. fi
  40. if [ "$1" == "release" ]; then
  41. echo "release"
  42. fi