script.sh 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. #!/usr/bin/env bash
  2. set -e
  3. if [ "$TYPE" = 'style' ]; then
  4. # SC2185 is disabled because of: https://github.com/koalaman/shellcheck/issues/942
  5. # once it's fixed, it should be enabled again
  6. # shellcheck disable=SC2185
  7. # shellcheck disable=SC2046
  8. shellcheck $(find -O3 . -maxdepth 3 -type f -name '*.sh' -o -name "*.sh.in")
  9. shellcheck doc/bash-completion/lmms
  10. else
  11. export CMAKE_FLAGS="-DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUNDLE_QT_TRANSLATIONS=ON"
  12. if [ -z "$TRAVIS_TAG" ]; then
  13. export CMAKE_FLAGS="$CMAKE_FLAGS -DUSE_CCACHE=ON"
  14. fi
  15. "$TRAVIS_BUILD_DIR/.travis/$TRAVIS_OS_NAME.$TARGET_OS.script.sh"
  16. # Package and upload non-tagged builds
  17. if [ -n "$TRAVIS_TAG" ]; then
  18. # Skip, handled by travis deploy instead
  19. exit 0
  20. elif [[ $TARGET_OS == win* ]]; then
  21. cd build
  22. make -j4 package
  23. PACKAGE="$(ls lmms-*win*.exe)"
  24. elif [[ $TRAVIS_OS_NAME == osx ]]; then
  25. cd build
  26. make -j4 install > /dev/null
  27. make dmg
  28. PACKAGE="$(ls lmms-*.dmg)"
  29. elif [[ $TARGET_OS != debian-sid ]]; then
  30. cd build
  31. make -j4 install > /dev/null
  32. make appimage
  33. PACKAGE="$(ls lmms-*.AppImage)"
  34. fi
  35. echo "Uploading $PACKAGE to transfer.sh..."
  36. # Limit the connection time to 3 minutes and total upload time to 5 minutes
  37. # Otherwise the build may hang
  38. curl --connect-timeout 180 --max-time 300 --upload-file "$PACKAGE" "https://transfer.sh/$PACKAGE" || true
  39. fi