main.yml 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. name: build
  2. on:
  3. push:
  4. branches:
  5. - release
  6. jobs:
  7. build-mac:
  8. runs-on: macOS-latest
  9. steps:
  10. - uses: actions/checkout@v2
  11. - name: Install Qt 5.15.2
  12. uses: jurplel/install-qt-action@v2
  13. with:
  14. version: "5.15.2"
  15. modules: "qtwebengine"
  16. - name: Install dependencies
  17. run: |
  18. brew update
  19. grep -v libx /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/cairo.rb | grep -v enable-x > _tmp
  20. mv _tmp /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/cairo.rb
  21. brew install cairo --build-from-source
  22. brew install harfbuzz --build-from-source
  23. brew install libass --build-from-source
  24. sed 's/args = %W\[/& --enable-static --disable-shared/g' /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/ffmpeg.rb > _tmp
  25. mv _tmp /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/ffmpeg.rb
  26. brew install ffmpeg --build-from-source
  27. brew install ninja
  28. grep -v enable-javascript /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/mpv.rb | grep -v mujs > _tmp
  29. mv _tmp /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/mpv.rb
  30. brew install mpv --build-from-source
  31. - name: Release build
  32. run: |
  33. ./download_webclient.sh
  34. cd build
  35. cmake -GNinja -DQTROOT=$Qt5_DIR -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=output ..
  36. ninja install
  37. - name: Archive production artifacts
  38. uses: actions/upload-artifact@v2
  39. with:
  40. name: macos
  41. path: ${{ github.workspace }}/build/output/Jellyfin\ Media\ Player.dmg
  42. build-win:
  43. runs-on: windows-latest
  44. steps:
  45. - uses: actions/checkout@v2
  46. - name: Install Qt 5.15.2
  47. uses: jurplel/install-qt-action@v2
  48. with:
  49. version: "5.15.2"
  50. arch: "win64_msvc2019_64"
  51. modules: "qtwebengine"
  52. - name: Install dependencies
  53. run: |
  54. ./download_webclient.sh
  55. 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
  56. curl -L https://github.com/ninja-build/ninja/releases/download/v1.10.2/ninja-win.zip > ninja.zip
  57. unzip ninja.zip
  58. mv ninja.exe build/
  59. curl -L https://sourceforge.net/projects/mpv-player-windows/files/libmpv/mpv-dev-x86_64-20210404-git-dd86f19.7z/download > mpv.7z
  60. 7z x mpv.7z
  61. mv include mpv
  62. mkdir include
  63. mv mpv include
  64. mkdir mpv
  65. mv include mpv
  66. mv mpv-1.dll mpv/mpv.dll
  67. mv mpv.def libmpv.dll.a mpv/
  68. mv mpv build/
  69. shell: bash
  70. - name: Build
  71. run: |
  72. call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
  73. cd build
  74. set PATH=%PATH%;C:\Program Files (x86)\WiX Toolset v3.11\bin;%CD%
  75. cmake -GNinja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=output -DCMAKE_MAKE_PROGRAM=ninja.exe -DQTROOT=%Qt5_DIR% -DMPV_INCLUDE_DIR=mpv/include -DMPV_LIBRARY=mpv/mpv.dll -DCMAKE_INSTALL_PREFIX=output ..
  76. lib /def:mpv\mpv.def /out:mpv\mpv.dll.lib /MACHINE:X64
  77. ninja
  78. ninja windows_package
  79. shell: cmd
  80. - name: Archive production artifacts
  81. uses: actions/upload-artifact@v2
  82. with:
  83. name: windows
  84. path: ${{ github.workspace }}/build/JellyfinMediaPlayer-*-windows-x64.exe
  85. build-ubuntu:
  86. strategy:
  87. matrix:
  88. os: [ubuntu-latest]
  89. tag: [focal, groovy]
  90. runs-on: ${{ matrix.os }}
  91. steps:
  92. - uses: actions/checkout@v2
  93. - name: Docker Build
  94. run: |
  95. docker build -f deployment/Dockerfile.debian -t builddeb --build-arg TAG=${{ matrix.tag }} --build-arg IMG=ubuntu deployment
  96. docker run -v $(pwd)/deployment/dist:/dist -v $(pwd):/jellyfin -e TAG=${{ matrix.tag }} builddeb
  97. - name: Archive production artifacts
  98. uses: actions/upload-artifact@v2
  99. with:
  100. name: ubuntu-${{ matrix.tag }}
  101. path: ${{ github.workspace }}/deployment/dist/*
  102. build-debian:
  103. strategy:
  104. matrix:
  105. os: [ubuntu-latest]
  106. tag: [buster, bullseye]
  107. runs-on: ${{ matrix.os }}
  108. steps:
  109. - uses: actions/checkout@v2
  110. - name: Docker Build
  111. run: |
  112. docker build -f deployment/Dockerfile.debian -t builddeb --build-arg TAG=${{ matrix.tag }} deployment
  113. docker run -v $(pwd)/deployment/dist:/dist -v $(pwd):/jellyfin -e TAG=${{ matrix.tag }} builddeb
  114. - name: Archive production artifacts
  115. uses: actions/upload-artifact@v2
  116. with:
  117. name: debian-${{ matrix.tag }}
  118. path: ${{ github.workspace }}/deployment/dist/*