script.sh 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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 "$TRAVIS_BUILD_DIR/.travis/" "$TRAVIS_BUILD_DIR/cmake/" -type f -name '*.sh' -o -name "*.sh.in")
  9. else
  10. mkdir -p build
  11. cd build
  12. export CMAKE_FLAGS="-DCMAKE_BUILD_TYPE=RelWithDebInfo"
  13. if [ -z "$TRAVIS_TAG" ]; then
  14. export CMAKE_FLAGS="$CMAKE_FLAGS -DUSE_CCACHE=ON"
  15. fi
  16. "$TRAVIS_BUILD_DIR/.travis/$TRAVIS_OS_NAME.$TARGET_OS.script.sh"
  17. make -j4
  18. if [[ $TARGET_OS != win* ]]; then
  19. make tests
  20. tests/tests
  21. fi
  22. # Package and upload non-tagged builds
  23. if [ ! -z "$TRAVIS_TAG" ]; then
  24. # Skip, handled by travis deploy instead
  25. exit 0
  26. elif [[ $TARGET_OS == win* ]]; then
  27. make -j4 package
  28. PACKAGE="$(ls lmms-*win*.exe)"
  29. elif [[ $TRAVIS_OS_NAME == osx ]]; then
  30. make -j4 install > /dev/null
  31. make dmg
  32. PACKAGE="$(ls lmms-*.dmg)"
  33. else
  34. make -j4 install > /dev/null
  35. make appimage
  36. PACKAGE="$(ls lmms-*.AppImage)"
  37. fi
  38. echo "Uploading $PACKAGE to transfer.sh..."
  39. curl --upload-file "$PACKAGE" "https://transfer.sh/$PACKAGE" || true
  40. fi