|
| 1 | +--- |
| 2 | +name: CI |
| 3 | + |
| 4 | +on: |
| 5 | + pull_request: |
| 6 | + branches: [master] |
| 7 | + types: [opened, synchronize, reopened] |
| 8 | + push: |
| 9 | + branches: [master] |
| 10 | + schedule: |
| 11 | + - cron: "45 23 * * 0" # weekly build of master (Sunday 11:45pm) |
| 12 | + |
| 13 | +concurrency: |
| 14 | + group: "${{ github.workflow }}-${{ github.ref }}" |
| 15 | + cancel-in-progress: true |
| 16 | + |
| 17 | +jobs: |
| 18 | + build_win: |
| 19 | + name: Windows |
| 20 | + runs-on: windows-2022 |
| 21 | + steps: |
| 22 | + - uses: actions/checkout@v4 |
| 23 | + with: |
| 24 | + submodules: recursive |
| 25 | + |
| 26 | + - name: Install Qt x64 |
| 27 | + uses: jurplel/install-qt-action@v4 |
| 28 | + with: |
| 29 | + arch: win64_msvc2022_64 |
| 30 | + dir: ${{ github.workspace }}\x64\ |
| 31 | + host: windows |
| 32 | + setup-python: false |
| 33 | + target: desktop |
| 34 | + version: '6.8.*' |
| 35 | + |
| 36 | + - name: Gather metadata |
| 37 | + run: | |
| 38 | + echo ("VERSION=" + (Get-Content app/version.txt)) >> $env:GITHUB_ENV |
| 39 | +
|
| 40 | + - name: Build Windows x64 |
| 41 | + shell: pwsh |
| 42 | + run: | |
| 43 | + Add-Content $env:GITHUB_PATH "$($env:QT_ROOT_DIR)\bin" |
| 44 | + scripts\build-arch.bat Release x64 |
| 45 | + mkdir artifacts |
| 46 | + Copy-Item "build\installer-x64-release\MoonlightPortable-x64-$($env:VERSION).zip" -Destination "artifacts\MoonlightPortable-x64.zip" |
| 47 | + Copy-Item "build\symbols-x64-Release\MoonlightDebuggingSymbols-x64-$($env:VERSION).zip" -Destination "artifacts\MoonlightDebuggingSymbols-x64.zip" |
| 48 | + Get-ChildItem -Path "artifacts" -Recurse |
| 49 | +
|
| 50 | + - name: Install Qt arm64 |
| 51 | + uses: jurplel/install-qt-action@v4 |
| 52 | + with: |
| 53 | + arch: win64_msvc2022_arm64_cross_compiled |
| 54 | + dir: ${{ github.workspace }}\arm64\ |
| 55 | + host: windows |
| 56 | + setup-python: false |
| 57 | + target: desktop |
| 58 | + version: '6.8.*' |
| 59 | + |
| 60 | + - name: Build Windows arm64 |
| 61 | + shell: pwsh |
| 62 | + run: | |
| 63 | + Copy-Item "scripts\build_arm64\qmake.bat" -Destination "$($env:QT_ROOT_DIR)\bin" |
| 64 | + Copy-Item "scripts\build_arm64\qtpaths.bat" -Destination "$($env:QT_ROOT_DIR)\bin" |
| 65 | + Copy-Item "scripts\build_arm64\target_qt.conf" -Destination "$($env:QT_ROOT_DIR)\bin" |
| 66 | + Add-Content $env:GITHUB_PATH "$($env:QT_ROOT_DIR)\bin" |
| 67 | + scripts\build-arch.bat Release arm64 |
| 68 | + Copy-Item "build\installer-arm64-release\MoonlightPortable-arm64-$($env:VERSION).zip" -Destination "artifacts\MoonlightPortable-arm64.zip" |
| 69 | + Copy-Item "build\symbols-arm64-Release\MoonlightDebuggingSymbols-arm64-$($env:VERSION).zip" -Destination "artifacts\MoonlightDebuggingSymbols-arm64.zip" |
| 70 | + Get-ChildItem -Path "artifacts" -Recurse |
| 71 | +
|
| 72 | + - name: Build universal binary |
| 73 | + shell: pwsh |
| 74 | + run: | |
| 75 | + scripts\generate-bundle.bat Release |
| 76 | + Copy-Item "build\installer-release\MoonlightSetup-$($env:VERSION).exe" -Destination "artifacts\MoonlightSetup.exe" |
| 77 | + Get-ChildItem -Path "artifacts" -Recurse |
| 78 | +
|
| 79 | + # This is the only way to generate separate artifacts without using a job matrix |
| 80 | + - name: Upload Artifacts (Installer) |
| 81 | + uses: actions/upload-artifact@v4 |
| 82 | + with: |
| 83 | + name: MoonlightSetup.exe |
| 84 | + path: artifacts/MoonlightSetup.exe |
| 85 | + compression-level: 0 |
| 86 | + |
| 87 | + - name: Upload Artifacts (Portable x64) |
| 88 | + uses: actions/upload-artifact@v4 |
| 89 | + with: |
| 90 | + name: MoonlightPortable-x64.zip |
| 91 | + path: artifacts/MoonlightPortable-x64.zip |
| 92 | + compression-level: 0 |
| 93 | + |
| 94 | + - name: Upload Artifacts (Portable arm64) |
| 95 | + uses: actions/upload-artifact@v4 |
| 96 | + with: |
| 97 | + name: MoonlightPortable-arm64.zip |
| 98 | + path: artifacts/MoonlightPortable-arm64.zip |
| 99 | + compression-level: 0 |
| 100 | + |
| 101 | + - name: Upload Artifacts (Debug symbols) |
| 102 | + uses: actions/upload-artifact@v4 |
| 103 | + with: |
| 104 | + name: MoonlightDebuggingSymbols |
| 105 | + path: | |
| 106 | + artifacts/MoonlightDebuggingSymbols-x64.zip |
| 107 | + artifacts/MoonlightPortable-arm64.zip |
| 108 | + compression-level: 0 |
| 109 | + |
| 110 | +### |
| 111 | + |
| 112 | + build_macos: |
| 113 | + name: macOS |
| 114 | + runs-on: macos-15 |
| 115 | + steps: |
| 116 | + - uses: actions/checkout@v4 |
| 117 | + with: |
| 118 | + submodules: recursive |
| 119 | + |
| 120 | + - name: Install Qt |
| 121 | + uses: jurplel/install-qt-action@v4 |
| 122 | + with: |
| 123 | + arch: clang_64 |
| 124 | + host: mac |
| 125 | + target: desktop |
| 126 | + version: '6.8.*' |
| 127 | + |
| 128 | + - name: Install Node |
| 129 | + run: | |
| 130 | + brew install node |
| 131 | + npm install --global create-dmg |
| 132 | +
|
| 133 | + - name: Gather Metadata |
| 134 | + run: | |
| 135 | + echo "VERSION=$(cat app/version.txt)" >> $GITHUB_ENV |
| 136 | +
|
| 137 | + - name: Build macOS universal binary |
| 138 | + shell: bash |
| 139 | + run: | |
| 140 | + echo "${QT_ROOT_DIR}/bin" >> $GITHUB_PATH |
| 141 | + scripts/generate-dmg.sh Release |
| 142 | + mkdir artifacts |
| 143 | + mv build/installer-Release/Moonlight\ ${VERSION}.dmg artifacts/Moonlight.dmg |
| 144 | + ls -lR artifacts |
| 145 | +
|
| 146 | + - name: Upload Artifacts |
| 147 | + uses: actions/upload-artifact@v4 |
| 148 | + with: |
| 149 | + name: Moonlight.dmg |
| 150 | + path: artifacts/Moonlight.dmg |
| 151 | + compression-level: 0 |
| 152 | + |
| 153 | +### |
| 154 | + |
| 155 | + build_linux: |
| 156 | + name: Linux x86_64 |
| 157 | + runs-on: ubuntu-20.04 |
| 158 | + strategy: |
| 159 | + fail-fast: false |
| 160 | + matrix: |
| 161 | + qtversion: |
| 162 | + - '5.15.2' |
| 163 | + - '6.8.3' |
| 164 | + |
| 165 | + steps: |
| 166 | + - name: Checkout |
| 167 | + uses: actions/checkout@v4 |
| 168 | + with: |
| 169 | + submodules: recursive |
| 170 | + |
| 171 | + - name: Setup local env and metadata |
| 172 | + run: | |
| 173 | + mkdir -p $HOME/local/{bin,include,lib} |
| 174 | + echo "$HOME/local/bin" >> $GITHUB_PATH |
| 175 | + echo "PKG_CONFIG_PATH=$HOME/local/lib/pkgconfig:$HOME/local/lib/x86_64-linux-gnu/pkgconfig" >> $GITHUB_ENV |
| 176 | + echo "VERSION=$(cat app/version.txt)" >> $GITHUB_ENV |
| 177 | +
|
| 178 | + # This may still install various Qt packages, but the later install step will override them |
| 179 | + - name: Install Deps |
| 180 | + run: | |
| 181 | + wget -qO - https://packages.lunarg.com/lunarg-signing-key-pub.asc | sudo apt-key add - |
| 182 | + sudo wget -qO /etc/apt/sources.list.d/lunarg-vulkan-1.3.280-focal.list https://packages.lunarg.com/vulkan/1.3.280/lunarg-vulkan-1.3.280-focal.list |
| 183 | + sudo apt update || true |
| 184 | + sudo apt install -y \ |
| 185 | + python3-pip nasm libgbm-dev libdrm-dev libfreetype6-dev libasound2-dev \ |
| 186 | + libdbus-1-dev libegl1-mesa-dev libgl1-mesa-dev libgles2-mesa-dev libglu1-mesa-dev \ |
| 187 | + libibus-1.0-dev libpulse-dev libudev-dev libx11-dev libxcursor-dev libxext-dev \ |
| 188 | + libxi-dev libxinerama-dev libxkbcommon-dev libxrandr-dev libxss-dev libxt-dev \ |
| 189 | + libxv-dev libxxf86vm-dev libxcb-dri3-dev libx11-xcb-dev libwayland-dev wayland-protocols \ |
| 190 | + libopus-dev libvdpau-dev vulkan-sdk |
| 191 | + sudo pip3 install meson |
| 192 | +
|
| 193 | + # XXX switch this to `--revision $SHA --depth 1` when git 2.49 is available |
| 194 | + - name: Build SDL2 |
| 195 | + env: |
| 196 | + SDL2_REV: 86fd4ed83cdcf71fef6a57766b126e88f923acd3 |
| 197 | + run: | |
| 198 | + git clone https://github.com/libsdl-org/SDL.git SDL2 |
| 199 | + cd SDL2 |
| 200 | + git checkout $SDL2_REV |
| 201 | + ./autogen.sh |
| 202 | + ./configure --prefix=$HOME/local |
| 203 | + make -j$(nproc) |
| 204 | + make install |
| 205 | + cd .. |
| 206 | +
|
| 207 | + - name: Build SDL2_TTF |
| 208 | + env: |
| 209 | + SDL2_TTF_VER: 2.22.0 |
| 210 | + run: | |
| 211 | + wget -q https://github.com/libsdl-org/SDL_ttf/releases/download/release-$SDL2_TTF_VER/SDL2_ttf-$SDL2_TTF_VER.tar.gz |
| 212 | + tar -xf SDL2_ttf-$SDL2_TTF_VER.tar.gz |
| 213 | + cd SDL2_ttf-$SDL2_TTF_VER |
| 214 | + ./configure --prefix=$HOME/local |
| 215 | + make -j$(nproc) |
| 216 | + make install |
| 217 | + cd .. |
| 218 | +
|
| 219 | + - name: Build libva |
| 220 | + env: |
| 221 | + LIBVA_VER: 2.22.0 |
| 222 | + run: | |
| 223 | + git clone --branch $LIBVA_VER --depth 1 https://github.com/intel/libva.git |
| 224 | + cd libva |
| 225 | + ./autogen.sh |
| 226 | + ./configure --prefix=$HOME/local --enable-x11 --enable-wayland |
| 227 | + make -j$(nproc) |
| 228 | + make install |
| 229 | + cd .. |
| 230 | +
|
| 231 | + - name: Build dav1d |
| 232 | + env: |
| 233 | + DAV1D_VER: 1.5.0 |
| 234 | + run: | |
| 235 | + git clone --branch $DAV1D_VER --depth 1 https://code.videolan.org/videolan/dav1d.git |
| 236 | + cd dav1d |
| 237 | + meson setup build --prefix=$HOME/local -Ddefault_library=static -Dbuildtype=release -Denable_tools=false -Denable_tests=false |
| 238 | + ninja -C build |
| 239 | + ninja install -C build |
| 240 | + cd .. |
| 241 | +
|
| 242 | + - name: Build libplacebo |
| 243 | + env: |
| 244 | + LIBPLACEBO_VER: v7.349.0 |
| 245 | + run: | |
| 246 | + git clone --branch $LIBPLACEBO_VER --depth 1 https://code.videolan.org/videolan/libplacebo.git |
| 247 | + cd libplacebo |
| 248 | + git apply ../app/deploy/linux/appimage/*.patch |
| 249 | + git submodule update --init --recursive |
| 250 | + meson setup build --prefix=$HOME/local -Dvulkan=enabled -Dopengl=disabled -Ddemos=false |
| 251 | + ninja -C build |
| 252 | + ninja install -C build |
| 253 | + cd .. |
| 254 | +
|
| 255 | + # XXX switch this to `--revision $SHA --depth 1` when git 2.49 is available |
| 256 | + - name: Build ffmpeg |
| 257 | + env: |
| 258 | + FFMPEG_REV: 87ccf995cb855f0baced9916928b7b48d8b6ed9d |
| 259 | + run: | |
| 260 | + git clone https://github.com/FFmpeg/FFmpeg.git FFmpeg |
| 261 | + cd FFmpeg |
| 262 | + git checkout $FFMPEG_REV |
| 263 | + ./configure --prefix=$HOME/local --enable-pic --disable-static --enable-shared --disable-all --enable-avcodec \ |
| 264 | + --enable-avformat --enable-swscale --enable-decoder=h264 --enable-decoder=hevc --enable-decoder=av1 \ |
| 265 | + --enable-hwaccel=h264_vaapi --enable-hwaccel=hevc_vaapi --enable-hwaccel=av1_vaapi --enable-hwaccel=h264_vdpau \ |
| 266 | + --enable-hwaccel=hevc_vdpau --enable-hwaccel=av1_vdpau --enable-libdrm --enable-hwaccel=h264_vulkan \ |
| 267 | + --enable-hwaccel=hevc_vulkan --enable-hwaccel=av1_vulkan --enable-libdav1d --enable-decoder=libdav1d |
| 268 | + make -j$(nproc) |
| 269 | + make install |
| 270 | + cd .. |
| 271 | +
|
| 272 | + - name: Install Qt ${{ matrix.qtversion }} |
| 273 | + uses: jurplel/install-qt-action@v4 |
| 274 | + with: |
| 275 | + aqtversion: '==3.1.*' |
| 276 | + arch: ${{ matrix.qtversion == '5.15.2' && 'gcc_64' || 'linux_gcc_64' }} |
| 277 | + host: linux |
| 278 | + target: desktop |
| 279 | + version: '${{ matrix.qtversion }}' |
| 280 | + modules: qtwaylandcompositor |
| 281 | + |
| 282 | + - name: Install linuxdeployqt |
| 283 | + run: | |
| 284 | + wget -qO $HOME/local/bin/linuxdeployqt https://github.com/probonopd/linuxdeployqt/releases/download/continuous/linuxdeployqt-continuous-x86_64.AppImage |
| 285 | + chmod a+x $HOME/local/bin/linuxdeployqt |
| 286 | +
|
| 287 | + # The Install Qt action clobbers our lib paths so we need to set them again |
| 288 | + - name: Fixup environment |
| 289 | + run: | |
| 290 | + echo "PKG_CONFIG_PATH=$HOME/local/lib/pkgconfig:$HOME/local/lib/x86_64-linux-gnu/pkgconfig:$PKG_CONFIG_PATH" >> $GITHUB_ENV |
| 291 | + echo "LD_LIBRARY_PATH=$HOME/local/lib:$HOME/local/lib/x86_64-linux-gnu:$LD_LIBRARY_PATH" >> $GITHUB_ENV |
| 292 | +
|
| 293 | + - name: Build Moonlight Linux |
| 294 | + run: | |
| 295 | + scripts/build-appimage.sh |
| 296 | + mkdir artifacts |
| 297 | + mv build/installer-release/Moonlight-${VERSION}-x86_64.AppImage artifacts/Moonlight-qt${{ matrix.qtversion }}-x86_64.AppImage |
| 298 | + ls -lR artifacts |
| 299 | +
|
| 300 | + - name: Upload Artifacts |
| 301 | + uses: actions/upload-artifact@v4 |
| 302 | + with: |
| 303 | + name: Moonlight-qt${{ matrix.qtversion }}-x86_64.AppImage |
| 304 | + path: artifacts/Moonlight-qt${{ matrix.qtversion }}-x86_64.AppImage |
| 305 | + compression-level: 0 |
0 commit comments