feat: nicer loading spinner #1194
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build | |
| on: [push] | |
| env: | |
| MPV_VERSION: "20260118-git-468d34c" | |
| jobs: | |
| build: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-24.04, macos-14, windows-2022] | |
| build-type: [Release] | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v5 | |
| with: | |
| submodules: recursive | |
| # # ── ccache ──────────────────────────────────────────────────────────── | |
| # - name: Install ccache (Linux) | |
| # if: runner.os == 'Linux' | |
| # run: sudo apt-get install -y ccache | |
| # - name: Install ccache (macOS) | |
| # if: runner.os == 'macOS' | |
| # run: brew install ccache | |
| # - name: Install ccache (Windows) | |
| # if: runner.os == 'Windows' | |
| # run: choco install ccache --no-progress | |
| # - name: Cache ccache | |
| # uses: actions/cache@v5 | |
| # with: | |
| # path: | | |
| # ~/.ccache | |
| # ~/AppData/Local/ccache | |
| # key: ccache-${{ runner.os }}-${{ runner.arch }}-${{ matrix.build-type }}-${{ github.sha }} | |
| # restore-keys: | | |
| # ccache-${{ runner.os }}-${{ runner.arch }}-${{ matrix.build-type }}- | |
| # - name: Configure ccache | |
| # shell: bash | |
| # run: | | |
| # ccache --set-config=max_size=500M | |
| # ccache --set-config=compression=true | |
| # ccache -z # zero stats so we can see hit rate in logs | |
| # ── Linux setup ─────────────────────────────────────────────────────── | |
| - name: Cache apt packages | |
| if: runner.os == 'Linux' | |
| uses: actions/cache@v5 | |
| with: | |
| path: /var/cache/apt/archives | |
| key: apt-${{ runner.os }}-${{ hashFiles('.github/workflows/build.yml') }} | |
| restore-keys: apt-${{ runner.os }}- | |
| - name: Add GCC repository | |
| if: runner.os == 'Linux' | |
| run: | | |
| for i in {1..5}; do | |
| sudo apt-get update && sudo apt-get install -y software-properties-common && break || sleep 10 | |
| done | |
| sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test | |
| - name: Install Linux dependencies | |
| if: runner.os == 'Linux' | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y \ | |
| libx11-dev \ | |
| libxcursor-dev \ | |
| libxinerama-dev \ | |
| libxi-dev \ | |
| libxrandr-dev \ | |
| libgl1-mesa-dev \ | |
| libncurses6 \ | |
| gcc-13 g++-13 \ | |
| libfontconfig1-dev \ | |
| autoconf automake libtool pkg-config libltdl-dev \ | |
| libnotify-dev \ | |
| libmpv-dev \ | |
| ninja-build \ | |
| gperf | |
| - name: Install GCC | |
| if: runner.os == 'Linux' | |
| run: | | |
| sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-13 100 --slave /usr/bin/g++ g++ /usr/bin/g++-13 --slave /usr/bin/gcov gcov /usr/bin/gcov-13 | |
| sudo update-alternatives --set gcc /usr/bin/gcc-13 | |
| # ── Project dependencies ────────────────────────────────────────────── | |
| - name: Cache build dependencies (macOS) | |
| if: runner.os == 'macOS' | |
| uses: actions/cache@v5 | |
| with: | |
| path: ci/out | |
| key: deps-macos-${{ runner.arch }}-${{ hashFiles('ci/build-dependencies-macos.sh') }} | |
| - name: Cache build dependencies (Linux) | |
| if: runner.os == 'Linux' | |
| uses: actions/cache@v5 | |
| with: | |
| path: ci/out | |
| key: deps-linux-${{ runner.arch }}-${{ hashFiles('ci/build-dependencies-linux.sh') }} | |
| - name: Cache build dependencies (Windows) | |
| if: runner.os == 'Windows' | |
| uses: actions/cache@v5 | |
| with: | |
| path: ci/out | |
| key: deps-windows-${{ runner.arch }}-${{ hashFiles('ci/build-dependencies-windows.ps1') }} | |
| - name: Collect dependencies (macOS) | |
| if: runner.os == 'macOS' | |
| run: | | |
| brew install ffmpeg libass zimg imagemagick autoconf automake libtool gcc ffmpeg llvm@20 meson xxhash vapoursynth fftw dylibbundler vulkan-loader molten-vk mpv | |
| cd ci | |
| bash build-dependencies-macos.sh | |
| - name: Collect dependencies (Windows) | |
| if: runner.os == 'Windows' | |
| run: | | |
| cd ci | |
| pwsh build-dependencies-windows.ps1 | |
| - name: Download libmpv (Windows) | |
| if: runner.os == 'Windows' | |
| run: | | |
| curl -L https://sourceforge.net/projects/mpv-player-windows/files/libmpv/mpv-dev-x86_64-v3-${{ env.MPV_VERSION }}.7z/download > mpv.7z | |
| 7z x mpv.7z | |
| mkdir mpv | |
| mv include mpv | |
| gendef libmpv-2.dll | |
| mv libmpv-2.dll mpv/libmpv-2.dll | |
| mv libmpv-2.def mpv.def | |
| mv mpv.def libmpv.dll.a mpv/ | |
| shell: bash | |
| - name: Collect dependencies (Linux) | |
| if: runner.os == 'Linux' | |
| run: | | |
| cd ci | |
| bash build-dependencies-linux.sh | |
| # ── vcpkg ───────────────────────────────────────────────────────────── | |
| - name: Set up vcpkg | |
| shell: bash | |
| run: | | |
| git clone https://github.com/microsoft/vcpkg.git | |
| cd vcpkg | |
| ./bootstrap-vcpkg.sh | |
| - name: Get vcpkg commit hash | |
| id: vcpkg-commit | |
| shell: bash | |
| run: echo "hash=$(git -C vcpkg rev-parse HEAD)" >> $GITHUB_OUTPUT | |
| - name: Cache vcpkg packages | |
| uses: actions/cache@v5 | |
| with: | |
| path: | | |
| vcpkg_installed/ | |
| vcpkg/downloads/ | |
| vcpkg/packages/ | |
| key: vcpkg-${{ runner.os }}-${{ runner.arch }}-${{ matrix.build-type }}-${{ steps.vcpkg-commit.outputs.hash }}-${{ hashFiles('vcpkg.json') }} | |
| restore-keys: | | |
| vcpkg-${{ runner.os }}-${{ runner.arch }}-${{ matrix.build-type }}-${{ steps.vcpkg-commit.outputs.hash }}- | |
| vcpkg-${{ runner.os }}-${{ runner.arch }}-${{ matrix.build-type }}- | |
| # ── Build ───────────────────────────────────────────────────────────── | |
| - name: Determine CMake Preset | |
| id: select-preset | |
| shell: bash | |
| run: | | |
| if [ "${{ runner.os }}" == "Windows" ]; then | |
| prefix="win" | |
| elif [ "${{ runner.os }}" == "Linux" ]; then | |
| prefix="linux" | |
| elif [ "${{ runner.os }}" == "macOS" ]; then | |
| prefix="mac" | |
| fi | |
| preset="${prefix}-$(echo "${{ matrix.build-type }}" | tr '[:upper:]' '[:lower:]')" | |
| echo "preset=$preset" >> $GITHUB_OUTPUT | |
| - name: Use Developer Command Prompt for Microsoft Visual C++ | |
| if: runner.os == 'Windows' | |
| uses: ilammy/msvc-dev-cmd@v1 | |
| - name: Configure CMake | |
| run: cmake --preset ${{ steps.select-preset.outputs.preset }} | |
| env: | |
| VCPKG_ROOT: ${{ github.workspace }}/vcpkg | |
| # CMAKE_C_COMPILER_LAUNCHER: ccache | |
| # CMAKE_CXX_COMPILER_LAUNCHER: ccache | |
| - name: Build | |
| run: cmake --build . --preset ${{ steps.select-preset.outputs.preset }} | |
| env: | |
| VCPKG_ROOT: ${{ github.workspace }}/vcpkg | |
| # - name: Print ccache stats | |
| # shell: bash | |
| # run: ccache -s | |
| # ── Package ─────────────────────────────────────────────────────────── | |
| - name: Prepare Binaries | |
| id: prep | |
| shell: bash | |
| run: | | |
| # Set up variables | |
| build_dir="bin/${{ matrix.build-type }}" | |
| config="${{ runner.os }}-${{ matrix.build-type }}-$(echo "${{ runner.arch }}" | tr '[:upper:]' '[:lower:]')" | |
| bundle_dir="$PWD/bundle" | |
| # Create bundle directory for all outputs | |
| mkdir -p "$bundle_dir" | |
| cd "$build_dir" | |
| case "${{ runner.os }}" in | |
| "Windows") | |
| # Rename binaries | |
| mv blur-cli.exe "blur-cli-$config.exe" | |
| mv blur-gui.exe "blur-$config.exe" | |
| # Build installer | |
| cd ../../ | |
| cp -r ci/out/* installer/dependencies/lib | |
| curl -L https://aka.ms/vs/17/release/vc_redist.x64.exe -o installer/redist/vc_redist.x64.exe | |
| cp "$build_dir/blur-cli-$config.exe" installer/resources/blur-cli.exe | |
| cp "$build_dir/blur-$config.exe" installer/resources/blur-gui.exe | |
| cp "mpv/libmpv-2.dll" installer/resources/ | |
| iscc installer/setup.iss | |
| # Copy everything to bundle | |
| cp "$build_dir/blur-cli-$config.exe" "$bundle_dir/" | |
| cp "$build_dir/blur-$config.exe" "$bundle_dir/" | |
| cp installer/output/blur-installer.exe "$bundle_dir/blur-Windows-Installer-x64.exe" | |
| ;; | |
| "Linux") | |
| # Package everything | |
| mkdir -p package | |
| mv blur-cli "package/blur-cli-$config" | |
| mv blur "package/blur-$config" | |
| mv lib/ package/ | |
| cp -r ../../ci/out/* package/ | |
| tar -czf "$bundle_dir/blur-$config.tar.gz" -C package . | |
| ;; | |
| "macOS") | |
| # Package CLI | |
| mv blur-cli "blur-cli-$config" | |
| tar -czf "$bundle_dir/blur-cli-$config.tar.gz" "blur-cli-$config" | |
| # Create DMG | |
| brew install create-dmg | |
| mkdir source_folder && mv blur.app source_folder/ | |
| create-dmg \ | |
| --volname "Blur Installer" \ | |
| --window-pos 200 120 \ | |
| --window-size 600 400 \ | |
| --icon-size 100 \ | |
| --icon "blur.app" 175 120 \ | |
| --hide-extension "blur.app" \ | |
| --app-drop-link 425 120 \ | |
| "$bundle_dir/blur-$config.dmg" source_folder | |
| ;; | |
| esac | |
| # Set outputs | |
| echo "config=$config" >> $GITHUB_OUTPUT | |
| - name: Upload Artifacts | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| name: Blur-${{ steps.prep.outputs.config }} | |
| path: bundle/ | |
| - name: Release | |
| uses: softprops/action-gh-release@v2 | |
| if: github.event_name == 'push' && contains(github.ref, 'refs/tags/') | |
| with: | |
| files: bundle/* |