osx_script.sh 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. #!/bin/bash --
  2. set -e
  3. project_dir="$(pwd)"
  4. brew update > /dev/null
  5. brew install qt
  6. QTDIR=/usr/local/opt/qt
  7. PATH="${QTDIR}"/bin:"${PATH}"
  8. LDFLAGS=-L"${QTDIR}"/lib
  9. CPPFLAGS=-I"${QTDIR}"/include
  10. # Build your app
  11. cd "${project_dir}"
  12. mkdir dist
  13. mkdir build
  14. cd build
  15. qmake -version
  16. qmake CONFIG-=debug CONFIG+=release CONFIG+=packaging ../flameshot.pro
  17. make -j$(nproc)
  18. git clone https://github.com/aurelien-rainone/macdeployqtfix.git
  19. pwd
  20. ls
  21. ls /Users/travis/build/ZetaoYang/flameshot
  22. # Package DMG from build/flamshot.app directory
  23. "${QTDIR}"/bin/macdeployqt flameshot.app
  24. python \
  25. "${project_dir}"/build/macdeployqtfix/macdeployqtfix.py \
  26. flameshot.app/Contents/MacOS/flameshot \
  27. "${QTDIR}"
  28. cd "${project_dir}"/build
  29. mkdir -p distrib/Flameshot
  30. cd distrib/Flameshot
  31. mv "${project_dir}"/build/flameshot.app "${project_dir}"/build/distrib/Flameshot/
  32. cp "${project_dir}"/LICENSE LICENSE
  33. cp "${project_dir}"/README.md README.md
  34. echo "${VERSION}" > version
  35. echo "${TRAVIS_COMMIT}" >> version
  36. ln -s /Applications ./Applications
  37. cd ..
  38. hdiutil create -srcfolder ./Flameshot -format UDBZ ./flameshot.dmg
  39. mv flameshot.dmg flameshot_X64_${VERSION}.dmg
  40. mv flameshot_X64_${VERSION}.dmg "${project_dir}"/dist/flameshot_X64_$VERSION.dmg
  41. curl \
  42. --upload-file \
  43. flameshot_X64_$VERSION.dmg \
  44. "https://transfer.sh/flameshot_X64_$VERSION.dmg"
  45. cd ..