main.yml 3.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. name: build
  2. on:
  3. push:
  4. branches:
  5. - release
  6. jobs:
  7. build-mac:
  8. strategy:
  9. matrix:
  10. # windows builds may need to specify building 64bit target:
  11. # if [[ "$OSTYPE" == "msys" ]]; then export WINEXTRA="-DCMAKE_GENERATOR_PLATFORM=x64"; else export WINEXTRA=""; fi
  12. os: [macOS-latest]
  13. qt: [5.15.2]
  14. runs-on: ${{ matrix.os }}
  15. steps:
  16. - uses: actions/checkout@v2
  17. - name: Install Qt ${{ matrix.qt }}
  18. uses: jurplel/install-qt-action@v2
  19. with:
  20. version: ${{ matrix.qt }}
  21. modules: "qtwebengine"
  22. - name: Install dependencies
  23. run: |
  24. brew update
  25. grep -v libx /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/cairo.rb | grep -v enable-x > _tmp
  26. mv _tmp /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/cairo.rb
  27. brew install cairo --build-from-source
  28. brew install harfbuzz --build-from-source
  29. brew install libass --build-from-source
  30. sed 's/args = %W\[/& --enable-static --disable-shared/g' /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/ffmpeg.rb > _tmp
  31. mv _tmp /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/ffmpeg.rb
  32. brew install ffmpeg --build-from-source
  33. brew install ninja
  34. grep -v enable-javascript /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/mpv.rb | grep -v mujs > _tmp
  35. mv _tmp /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/mpv.rb
  36. brew install mpv --build-from-source
  37. - name: Debug build and test
  38. run: |
  39. ./download_webclient.sh
  40. cd build
  41. cmake -GNinja -DQTROOT=$Qt5_DIR -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=output ..
  42. ninja install
  43. - name: Archive production artifacts
  44. uses: actions/upload-artifact@v2
  45. with:
  46. name: bundle.dmg
  47. path: ${{ github.workspace }}/build/output/Jellyfin\ Media\ Player.dmg
  48. build-win:
  49. strategy:
  50. matrix:
  51. os: [windows-latest]
  52. qt: [5.15.2]
  53. runs-on: ${{ matrix.os }}
  54. steps:
  55. - uses: actions/checkout@v2
  56. - name: Install Qt ${{ matrix.qt }}
  57. uses: jurplel/install-qt-action@v2
  58. with:
  59. version: ${{ matrix.qt }}
  60. modules: "qtwebengine"
  61. arch: "win64_msvc2019_64"
  62. - name: Install dependencies
  63. run: |
  64. ./download_webclient.sh
  65. sed -i 's#Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\VC\\Redist\\MSVC\\v142\\#'"$(ls -d "/c/Program Files (x86)/Microsoft Visual Studio/2019/"*"/VC/Redist/MSVC/v"* | head -n 1 | sed 's#/c/##g' | tr '/' '\\' | sed 's/\\/\\\\/g')\\\\#g" bundle/win/Bundle.wxs
  66. curl -L https://github.com/ninja-build/ninja/releases/download/v1.10.2/ninja-win.zip > ninja.zip
  67. unzip ninja.zip
  68. mv ninja.exe build/
  69. curl -L https://sourceforge.net/projects/mpv-player-windows/files/libmpv/mpv-dev-x86_64-20210404-git-dd86f19.7z/download > mpv.7z
  70. 7z x mpv.7z
  71. mv include mpv
  72. mkdir include
  73. mv mpv include
  74. mkdir mpv
  75. mv include mpv
  76. mv mpv-1.dll mpv/mpv.dll
  77. mv mpv.def libmpv.dll.a mpv/
  78. mv mpv build/
  79. shell: bash
  80. - name: Build
  81. run: |
  82. call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
  83. cd build
  84. set PATH=%PATH%;C:\Program Files (x86)\WiX Toolset v3.11\bin;%CD%
  85. cmake -GNinja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=output -DCMAKE_MAKE_PROGRAM=ninja.exe -DQTROOT=Qt/5.15.2/msvc2019_64 -DMPV_INCLUDE_DIR=mpv/include -DMPV_LIBRARY=mpv/mpv.dll -DCMAKE_INSTALL_PREFIX=output ..
  86. lib /def:mpv\mpv.def /out:mpv\mpv.dll.lib /MACHINE:X64
  87. ninja
  88. ninja windows_package
  89. shell: cmd
  90. - name: Archive production artifacts
  91. uses: actions/upload-artifact@v2
  92. with:
  93. name: installer.exe
  94. path: ${{ github.workspace }}/build/JellyfinMediaPlayer-*-windows-x64.exe