main.yml 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  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@v2
  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
  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@v2
  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@v2
  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://sourceforge.net/projects/mpv-player-windows/files/libmpv/mpv-dev-x86_64-v3-20230205-git-e439ddc.7z/download > mpv.7z
  58. 7z x mpv.7z
  59. mv include mpv
  60. mkdir include
  61. mv mpv include
  62. mkdir mpv
  63. mv include mpv
  64. mv mpv-2.dll mpv/mpv.dll
  65. mv mpv.def libmpv.dll.a mpv/
  66. mv mpv build/
  67. shell: bash
  68. - name: Build
  69. run: |
  70. call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
  71. cd build
  72. set PATH=%PATH%;C:\Program Files (x86)\WiX Toolset v3.11\bin;%CD%
  73. 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 ..
  74. lib /def:mpv\mpv.def /out:mpv\mpv.dll.lib /MACHINE:X64
  75. ninja
  76. ninja windows_package
  77. shell: cmd
  78. - name: Archive production artifacts
  79. uses: actions/upload-artifact@v2
  80. with:
  81. name: windows
  82. path: ${{ github.workspace }}/build/JellyfinMediaPlayer-*.exe
  83. build-win32:
  84. runs-on: windows-latest
  85. steps:
  86. - uses: actions/checkout@v2
  87. - name: Install Qt 5.15.2
  88. uses: jurplel/install-qt-action@v3
  89. with:
  90. version: "5.15.2"
  91. arch: "win32_msvc2019"
  92. modules: "qtwebengine"
  93. - name: Install dependencies
  94. run: |
  95. ./download_webclient.sh
  96. curl -L https://aka.ms/vs/17/release/vc_redist.x86.exe > vc_redist.x86.exe
  97. 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
  98. curl -L https://github.com/ninja-build/ninja/releases/download/v1.10.2/ninja-win.zip > ninja.zip
  99. unzip ninja.zip
  100. mv ninja.exe build/
  101. curl -L https://sourceforge.net/projects/mpv-player-windows/files/libmpv/mpv-dev-x86_64-20230205-git-e439ddc.7z/download > mpv.7z
  102. 7z x mpv.7z
  103. mv include mpv
  104. mkdir include
  105. mv mpv include
  106. mkdir mpv
  107. mv include mpv
  108. mv mpv-2.dll mpv/mpv.dll
  109. mv mpv.def libmpv.dll.a mpv/
  110. mv mpv build/
  111. shell: bash
  112. - name: Build
  113. run: |
  114. call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars32.bat"
  115. cd build
  116. set PATH=%PATH%;C:\Program Files (x86)\WiX Toolset v3.11\bin;%CD%
  117. 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 ..
  118. lib /def:mpv\mpv.def /out:mpv\mpv.dll.lib /MACHINE:X86
  119. ninja
  120. ninja windows_package
  121. shell: cmd
  122. - name: Archive production artifacts
  123. uses: actions/upload-artifact@v2
  124. with:
  125. name: windows-legacy32
  126. path: ${{ github.workspace }}/build/JellyfinMediaPlayer-*.exe
  127. build-ubuntu:
  128. strategy:
  129. matrix:
  130. tag: [kinetic, jammy, focal]
  131. runs-on: "ubuntu-latest"
  132. steps:
  133. - uses: actions/checkout@v2
  134. - name: Docker Build
  135. run: |
  136. docker build -f deployment/Dockerfile.debian -t builddeb --build-arg TAG=${{ matrix.tag }} --build-arg IMG=ubuntu deployment
  137. docker run -v $(pwd)/deployment/dist:/dist -v $(pwd):/jellyfin -e TAG=${{ matrix.tag }} builddeb
  138. - name: Archive production artifacts
  139. uses: actions/upload-artifact@v2
  140. with:
  141. name: ubuntu-${{ matrix.tag }}
  142. path: ${{ github.workspace }}/deployment/dist/*
  143. build-debian:
  144. strategy:
  145. matrix:
  146. tag: [bullseye, bookworm]
  147. runs-on: "ubuntu-latest"
  148. steps:
  149. - uses: actions/checkout@v2
  150. - name: Docker Build
  151. run: |
  152. docker build -f deployment/Dockerfile.debian -t builddeb --build-arg TAG=${{ matrix.tag }} deployment
  153. docker run -v $(pwd)/deployment/dist:/dist -v $(pwd):/jellyfin -e TAG=${{ matrix.tag }} builddeb
  154. - name: Archive production artifacts
  155. uses: actions/upload-artifact@v2
  156. with:
  157. name: debian-${{ matrix.tag }}
  158. path: ${{ github.workspace }}/deployment/dist/*