main.yml 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  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: macos
  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: windows
  94. path: ${{ github.workspace }}/build/JellyfinMediaPlayer-*-windows-x64.exe
  95. build-ubuntu:
  96. strategy:
  97. matrix:
  98. os: [ubuntu-latest]
  99. tag: [focal, groovy]
  100. runs-on: ${{ matrix.os }}
  101. steps:
  102. - uses: actions/checkout@v2
  103. - name: Docker Build
  104. run: |
  105. docker build -f deployment/Dockerfile.debian -t builddeb --build-arg TAG=${{ matrix.tag }} --build-arg IMG=ubuntu deployment
  106. docker run -v $(pwd)/deployment/dist:/dist -v $(pwd):/jellyfin -e TAG=${{ matrix.tag }} builddeb
  107. - name: Archive production artifacts
  108. uses: actions/upload-artifact@v2
  109. with:
  110. name: ubuntu-${{ matrix.tag }}
  111. path: ${{ github.workspace }}/deployment/dist/*
  112. build-debian:
  113. strategy:
  114. matrix:
  115. os: [ubuntu-latest]
  116. tag: [buster, bullseye]
  117. runs-on: ${{ matrix.os }}
  118. steps:
  119. - uses: actions/checkout@v2
  120. - name: Docker Build
  121. run: |
  122. docker build -f deployment/Dockerfile.debian -t builddeb --build-arg TAG=${{ matrix.tag }} deployment
  123. docker run -v $(pwd)/deployment/dist:/dist -v $(pwd):/jellyfin -e TAG=${{ matrix.tag }} builddeb
  124. - name: Archive production artifacts
  125. uses: actions/upload-artifact@v2
  126. with:
  127. name: debian-${{ matrix.tag }}
  128. path: ${{ github.workspace }}/deployment/dist/*