main.yml 6.0 KB

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