Flatpak Build #272
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: Flatpak Build | |
| on: | |
| push: | |
| branches: | |
| - handbrake-svt-av1-hdr | |
| pull_request: | |
| schedule: | |
| - cron: '30 7 * * 1,5' | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| name: Build on Linux | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Cargo-C Toolchain Cache | |
| id: linux-cargo-c-toolchain | |
| uses: actions/cache@v5 | |
| with: | |
| path: | | |
| ~/.cargo/bin/cargo-capi | |
| ~/.cargo/bin/cargo-cbuild | |
| ~/.cargo/bin/cargo-cinstall | |
| key: linux-cargo-c-toolchain | |
| - name: Setup Environment | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y \ | |
| autoconf automake autopoint appstream build-essential cmake git libass-dev \ | |
| libbz2-dev libfontconfig1-dev libfreetype6-dev libfribidi-dev libharfbuzz-dev \ | |
| libjansson-dev liblzma-dev libmp3lame-dev libnuma-dev libogg-dev libopus-dev \ | |
| libsamplerate-dev libspeex-dev libtheora-dev libtool libtool-bin libturbojpeg0-dev \ | |
| libvorbis-dev libx264-dev libxml2-dev libvpx-dev m4 make meson nasm ninja-build \ | |
| patch pkg-config tar zlib1g-dev libva-dev libdrm-dev intltool libglib2.0-dev \ | |
| libunwind-dev libgtk-4-dev libgudev-1.0-dev libssl-dev python3-mesonpy | |
| sudo apt-get install flatpak flatpak-builder | |
| sudo flatpak remote-add --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo | |
| sudo flatpak install -y flathub \ | |
| org.freedesktop.Sdk//25.08 \ | |
| org.freedesktop.Platform//25.08 \ | |
| org.gnome.Platform//49 \ | |
| org.gnome.Sdk//49 \ | |
| org.freedesktop.Sdk.Extension.llvm21//25.08 \ | |
| org.freedesktop.Sdk.Extension.rust-stable//25.08 | |
| sudo apt-get upgrade -y | |
| - name: Setup Cargo-C Toolchain | |
| if: steps.linux-cargo-c-toolchain.outputs.cache-hit != 'true' | |
| run: | | |
| cargo install cargo-c --force | |
| - name: Download the Source Code | |
| run: | | |
| git clone -b preview https://github.com/kentooo/HandBrake.git | |
| ./patch.sh | |
| - name: Build HandBrake | |
| run: | | |
| cd HandBrake | |
| ./configure --launch-jobs=0 --flatpak --enable-qsv --enable-vce --enable-nvenc --enable-nvdec | |
| cd build | |
| make pkg.create.flatpak --jobs=$(nproc) | |
| - name: Upload Assets | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: HandBrake-Flatpak | |
| path: ./HandBrake/build/pkg/flatpak/*.flatpak | |
| deploy_nightly: | |
| name: Deploy Nightly Build | |
| runs-on: ubuntu-24.04 | |
| needs: build | |
| if: github.event_name != 'pull_request' | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Download Artifacts - Flatpak Binaries | |
| uses: actions/download-artifact@v8 | |
| with: | |
| name: HandBrake-Flatpak | |
| path: flatpak/ | |
| # Generate Hashes | |
| - name: Generate SHA265 Hashes | |
| run: | | |
| cd flatpak | |
| sha256sum * > sha256.txt | |
| cp sha256.txt ../.github/workflows/ | |
| cd .. | |
| cd .github/workflows/ | |
| sed -e 's/ / | /' -i sha256.txt | |
| sed -e 's/^/| /' -i sha256.txt | |
| sed -e 's/$/ |/' -i sha256.txt | |
| cat sha256.txt >> flatpak_rel_body.md | |
| # Publishing the Release | |
| - name: Remove the old Release | |
| uses: dev-drprasad/delete-older-releases@v0.3.4 | |
| with: | |
| keep_latest: 0 | |
| delete_tag_pattern: "flatpak_hdr_build" | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - uses: ncipollo/release-action@v1 | |
| with: | |
| artifacts: "flatpak/*.*" | |
| name: "HDR Build for Linux (Flatpak)" | |
| bodyFile: .github/workflows/flatpak_rel_body.md | |
| prerelease: true | |
| replacesArtifacts: false | |
| allowUpdates: false | |
| tag: flatpak_hdr_build | |
| token: ${{ secrets.GITHUB_TOKEN }} |