main.yml 6.0 KB

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