main.yml 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  1. name: build
  2. on:
  3. push:
  4. branches:
  5. - release
  6. - prerelease
  7. - test
  8. jobs:
  9. build-mac:
  10. runs-on: macos-11
  11. steps:
  12. - uses: actions/checkout@v3
  13. - name: Install Qt 5.15.2
  14. uses: jurplel/install-qt-action@v3
  15. with:
  16. version: "5.15.2"
  17. modules: "qtwebengine"
  18. setup-python: 'false'
  19. - name: Install dependencies
  20. run: |
  21. brew update
  22. brew install ninja mpv || true
  23. - name: Release build
  24. run: |
  25. ./download_webclient.sh
  26. cd build
  27. cmake -GNinja -DQTROOT=$Qt5_DIR -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=output ..
  28. ninja install
  29. - name: Fix library paths and create dmg
  30. run: |
  31. python3 ./scripts/fix-install-names.py ./build/output/Jellyfin\ Media\ Player.app
  32. brew install create-dmg
  33. create-dmg --volname "Jellyfin Media Player" --no-internet-enable "JellyfinMediaPlayer.dmg" "./build/output/Jellyfin Media Player.app"
  34. - name: Archive production artifacts
  35. uses: actions/upload-artifact@v3
  36. with:
  37. name: macos
  38. path: ${{ github.workspace }}/JellyfinMediaPlayer.dmg
  39. build-win64:
  40. runs-on: windows-latest
  41. steps:
  42. - uses: actions/checkout@v3
  43. - name: Install Qt 5.15.2
  44. uses: jurplel/install-qt-action@v3
  45. with:
  46. version: "5.15.2"
  47. arch: "win64_msvc2019_64"
  48. modules: "qtwebengine"
  49. - name: Install dependencies
  50. run: |
  51. ./download_webclient.sh
  52. curl -L https://aka.ms/vs/17/release/vc_redist.x64.exe > vc_redist.x64.exe
  53. sed -i 's#C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\VC\\Redist\\MSVC\\v142\\vcredist_x64.exe#'"$(readlink -f vc_redist.x64.exe | sed 's#/\([a-z]\)/#\1:\\#g' | tr '/' '\\' | sed 's/\\/\\\\/g')#g" bundle/win/Bundle.wxs
  54. curl -L https://github.com/ninja-build/ninja/releases/download/v1.10.2/ninja-win.zip > ninja.zip
  55. unzip ninja.zip
  56. mv ninja.exe build/
  57. curl -L https://github.com/iwalton3/mpv-winbuild-cmake/releases/download/v20230304-git-362256e/mpv-dev-x86_64-20230304-git-362256e.7z > mpv.7z
  58. 7z x mpv.7z
  59. mkdir mpv
  60. mv include mpv
  61. mv libmpv-2.dll mpv/mpv.dll
  62. echo "LIBRARY MPV" > mpv.def.fixed
  63. echo "EXPORTS" >> mpv.def.fixed
  64. cat mpv.def >> mpv.def.fixed
  65. mv mpv.def.fixed mpv.def
  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\Microsoft Visual Studio\2022\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=%Qt5_DIR% -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@v3
  81. with:
  82. name: windows
  83. path: ${{ github.workspace }}/build/JellyfinMediaPlayer-*.exe
  84. build-win32:
  85. runs-on: windows-latest
  86. steps:
  87. - uses: actions/checkout@v3
  88. - name: Install Qt 5.15.2
  89. uses: jurplel/install-qt-action@v3
  90. with:
  91. version: "5.15.2"
  92. arch: "win32_msvc2019"
  93. modules: "qtwebengine"
  94. - name: Install dependencies
  95. run: |
  96. ./download_webclient.sh
  97. curl -L https://aka.ms/vs/17/release/vc_redist.x86.exe > vc_redist.x86.exe
  98. sed -i 's#C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\VC\\Redist\\MSVC\\v142\\vcredist_x64.exe#'"$(readlink -f vc_redist.x86.exe | sed 's#/\([a-z]\)/#\1:\\#g' | tr '/' '\\' | sed 's/\\/\\\\/g')#g" bundle/win/Bundle.wxs
  99. curl -L https://github.com/ninja-build/ninja/releases/download/v1.10.2/ninja-win.zip > ninja.zip
  100. unzip ninja.zip
  101. mv ninja.exe build/
  102. curl -L https://github.com/iwalton3/mpv-winbuild-cmake/releases/download/v20230304-git-362256e/mpv-dev-i686-20230304-git-362256e.7z > mpv.7z
  103. 7z x mpv.7z
  104. mkdir mpv
  105. mv include mpv
  106. mv libmpv-2.dll mpv/mpv.dll
  107. echo "LIBRARY MPV" > mpv.def.fixed
  108. echo "EXPORTS" >> mpv.def.fixed
  109. cat mpv.def >> mpv.def.fixed
  110. mv mpv.def.fixed mpv.def
  111. mv mpv.def libmpv.dll.a mpv/
  112. mv mpv build/
  113. shell: bash
  114. - name: Build
  115. run: |
  116. call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars32.bat"
  117. cd build
  118. set PATH=%PATH%;C:\Program Files (x86)\WiX Toolset v3.11\bin;%CD%
  119. 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 ..
  120. lib /def:mpv\mpv.def /out:mpv\mpv.dll.lib /MACHINE:X86
  121. ninja
  122. ninja windows_package
  123. shell: cmd
  124. - name: Archive production artifacts
  125. uses: actions/upload-artifact@v3
  126. with:
  127. name: windows-legacy32
  128. path: ${{ github.workspace }}/build/JellyfinMediaPlayer-*.exe
  129. build-ubuntu:
  130. strategy:
  131. matrix:
  132. tag: [kinetic, jammy, focal]
  133. runs-on: "ubuntu-latest"
  134. steps:
  135. - uses: actions/checkout@v3
  136. - name: Docker Build
  137. run: |
  138. docker build -f deployment/Dockerfile.debian -t builddeb --build-arg TAG=${{ matrix.tag }} --build-arg IMG=ubuntu deployment
  139. docker run -v $(pwd)/deployment/dist:/dist -v $(pwd):/jellyfin -e TAG=${{ matrix.tag }} builddeb
  140. - name: Archive production artifacts
  141. uses: actions/upload-artifact@v3
  142. with:
  143. name: ubuntu-${{ matrix.tag }}
  144. path: ${{ github.workspace }}/deployment/dist/*
  145. build-debian:
  146. strategy:
  147. matrix:
  148. tag: [bullseye, bookworm]
  149. runs-on: "ubuntu-latest"
  150. steps:
  151. - uses: actions/checkout@v3
  152. - name: Docker Build
  153. run: |
  154. docker build -f deployment/Dockerfile.debian -t builddeb --build-arg TAG=${{ matrix.tag }} deployment
  155. docker run -v $(pwd)/deployment/dist:/dist -v $(pwd):/jellyfin -e TAG=${{ matrix.tag }} builddeb
  156. - name: Archive production artifacts
  157. uses: actions/upload-artifact@v3
  158. with:
  159. name: debian-${{ matrix.tag }}
  160. path: ${{ github.workspace }}/deployment/dist/*