main.yml 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  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
  47. run: |
  48. python -m pip install aqtinstall==1.1.3
  49. python -m aqt install 5.15.2 windows desktop win64_msvc2019_64 -m qtwebengine -O D:\a\Qt
  50. shell: cmd
  51. - name: Install dependencies
  52. run: |
  53. ./download_webclient.sh
  54. 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
  55. curl -L https://github.com/ninja-build/ninja/releases/download/v1.10.2/ninja-win.zip > ninja.zip
  56. unzip ninja.zip
  57. mv ninja.exe build/
  58. curl -L https://sourceforge.net/projects/mpv-player-windows/files/libmpv/mpv-dev-x86_64-20210404-git-dd86f19.7z/download > mpv.7z
  59. 7z x mpv.7z
  60. mv include mpv
  61. mkdir include
  62. mv mpv include
  63. mkdir mpv
  64. mv include mpv
  65. mv mpv-1.dll mpv/mpv.dll
  66. mv mpv.def libmpv.dll.a mpv/
  67. mv mpv build/
  68. shell: bash
  69. - name: Build
  70. run: |
  71. call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
  72. cd build
  73. set PATH=%PATH%;C:\Program Files (x86)\WiX Toolset v3.11\bin;%CD%
  74. cmake -GNinja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=output -DCMAKE_MAKE_PROGRAM=ninja.exe -DQTROOT=D:/a/Qt/5.15.2/msvc2019_64 -DMPV_INCLUDE_DIR=mpv/include -DMPV_LIBRARY=mpv/mpv.dll -DCMAKE_INSTALL_PREFIX=output ..
  75. lib /def:mpv\mpv.def /out:mpv\mpv.dll.lib /MACHINE:X64
  76. ninja
  77. ninja windows_package
  78. shell: cmd
  79. - name: Archive production artifacts
  80. uses: actions/upload-artifact@v2
  81. with:
  82. name: windows
  83. path: ${{ github.workspace }}/build/JellyfinMediaPlayer-*-windows-x64.exe
  84. build-ubuntu:
  85. strategy:
  86. matrix:
  87. os: [ubuntu-latest]
  88. tag: [focal, groovy]
  89. runs-on: ${{ matrix.os }}
  90. steps:
  91. - uses: actions/checkout@v2
  92. - name: Docker Build
  93. run: |
  94. docker build -f deployment/Dockerfile.debian -t builddeb --build-arg TAG=${{ matrix.tag }} --build-arg IMG=ubuntu deployment
  95. docker run -v $(pwd)/deployment/dist:/dist -v $(pwd):/jellyfin -e TAG=${{ matrix.tag }} builddeb
  96. - name: Archive production artifacts
  97. uses: actions/upload-artifact@v2
  98. with:
  99. name: ubuntu-${{ matrix.tag }}
  100. path: ${{ github.workspace }}/deployment/dist/*
  101. build-debian:
  102. strategy:
  103. matrix:
  104. os: [ubuntu-latest]
  105. tag: [buster, bullseye]
  106. runs-on: ${{ matrix.os }}
  107. steps:
  108. - uses: actions/checkout@v2
  109. - name: Docker Build
  110. run: |
  111. docker build -f deployment/Dockerfile.debian -t builddeb --build-arg TAG=${{ matrix.tag }} deployment
  112. docker run -v $(pwd)/deployment/dist:/dist -v $(pwd):/jellyfin -e TAG=${{ matrix.tag }} builddeb
  113. - name: Archive production artifacts
  114. uses: actions/upload-artifact@v2
  115. with:
  116. name: debian-${{ matrix.tag }}
  117. path: ${{ github.workspace }}/deployment/dist/*