From aa1efdff64a7e8dd8491f267c96c248bdc87d938 Mon Sep 17 00:00:00 2001 From: edde746 <86283021+edde746@users.noreply.github.com> Date: Tue, 4 Nov 2025 16:51:14 +0100 Subject: [PATCH] ci: flatpak build --- .github/workflows/build.yml | 51 +++++++++++++++- linux/com.edde746.plezy.desktop | 10 ++++ linux/com.edde746.plezy.metainfo.xml | 57 ++++++++++++++++++ linux/com.edde746.plezy.yml | 87 ++++++++++++++++++++++++++++ 4 files changed, 204 insertions(+), 1 deletion(-) create mode 100644 linux/com.edde746.plezy.desktop create mode 100644 linux/com.edde746.plezy.metainfo.xml create mode 100644 linux/com.edde746.plezy.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index eea52b82..11732230 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -379,8 +379,56 @@ jobs: name: linux-app path: plezy-linux.tar.gz + build-flatpak: + runs-on: ubuntu-latest + permissions: + id-token: write + attestations: write + contents: read + steps: + - uses: actions/checkout@v4 + + - name: Replace version placeholders + run: | + # Extract version from pubspec.yaml (e.g., "1.3.1+10" -> "1.3.1") + VERSION=$(grep '^version:' pubspec.yaml | sed 's/version: //' | sed 's/+.*//' | tr -d ' ') + DATE=$(date -u +%Y-%m-%d) + + echo "Version: $VERSION" + echo "Date: $DATE" + + # Replace placeholders in metainfo.xml + sed -i "s/{{VERSION}}/$VERSION/g" linux/com.edde746.plezy.metainfo.xml + sed -i "s/{{DATE}}/$DATE/g" linux/com.edde746.plezy.metainfo.xml + + - name: Preprocess Flatpak manifest with flatpak-flutter + run: | + docker run --rm \ + -v "$PWD":/usr/src/flatpak \ + -u $(id -u):$(id -g) \ + theappgineer/flatpak-flutter:latest \ + linux/com.edde746.plezy.yml + + - name: Build Flatpak + uses: flatpak/flatpak-github-actions/flatpak-builder@v6 + with: + bundle: plezy.flatpak + manifest-path: linux/com.edde746.plezy.yml + cache-key: flatpak-builder-${{ github.sha }} + + - name: Attest Flatpak + uses: actions/attest-build-provenance@v2 + with: + subject-path: plezy.flatpak + + - name: Upload Flatpak + uses: actions/upload-artifact@v4 + with: + name: linux-flatpak + path: plezy.flatpak + create-release: - needs: [build-android, build-ios, build-macos, build-windows, build-linux] + needs: [build-android, build-ios, build-macos, build-windows, build-linux, build-flatpak] runs-on: ubuntu-latest permissions: contents: write @@ -403,6 +451,7 @@ jobs: artifacts/windows-portable/plezy-windows-portable.zip artifacts/windows-installer/plezy-windows-installer.exe artifacts/linux-app/plezy-linux.tar.gz + artifacts/linux-flatpak/plezy.flatpak draft: true prerelease: false generate_release_notes: true diff --git a/linux/com.edde746.plezy.desktop b/linux/com.edde746.plezy.desktop new file mode 100644 index 00000000..32c1fadb --- /dev/null +++ b/linux/com.edde746.plezy.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Name=Plezy +Comment=A beautiful Plex client for Flutter +Exec=plezy +Icon=com.edde746.plezy +Type=Application +Categories=AudioVideo;Video;Player; +Terminal=false +StartupNotify=true +Keywords=plex;media;video;streaming; diff --git a/linux/com.edde746.plezy.metainfo.xml b/linux/com.edde746.plezy.metainfo.xml new file mode 100644 index 00000000..ed5b97a7 --- /dev/null +++ b/linux/com.edde746.plezy.metainfo.xml @@ -0,0 +1,57 @@ + + + com.edde746.plezy + Plezy + A beautiful Plex client for Flutter + + CC0-1.0 + MIT + + +

+ Plezy is a beautiful Plex client built with Flutter, offering a modern and intuitive + interface for accessing your Plex media library. +

+

Features:

+ +
+ + com.edde746.plezy.desktop + + https://github.com/edde746/plex-flutter + https://github.com/edde746/plex-flutter/issues + + + + Plezy main interface + + + + + + + + +

Latest release

+
+
+
+ + + AudioVideo + Video + Player + + + + plex + media + video + streaming + +
diff --git a/linux/com.edde746.plezy.yml b/linux/com.edde746.plezy.yml new file mode 100644 index 00000000..568ceefd --- /dev/null +++ b/linux/com.edde746.plezy.yml @@ -0,0 +1,87 @@ +app-id: com.edde746.plezy +runtime: org.freedesktop.Platform +runtime-version: '23.08' +sdk: org.freedesktop.Sdk +command: plezy + +finish-args: + # Graphics and display + - --share=ipc + - --socket=x11 + - --socket=wayland + - --device=dri + + # Audio + - --socket=pulseaudio + + # Network access (required for Plex) + - --share=network + + # Minimal filesystem access (home directory read-only) + - --filesystem=home:ro + + # Allow access to config directory + - --filesystem=xdg-config/plezy:create + - --filesystem=xdg-data/plezy:create + +modules: + # MPV for video playback + - name: mpv + buildsystem: simple + build-commands: + - python3 waf configure --prefix=/app --enable-libmpv-shared --disable-cplayer --disable-build-date + --disable-alsa + - python3 waf build + - python3 waf install + sources: + - type: archive + url: https://github.com/mpv-player/mpv/archive/v0.37.0.tar.gz + sha256: 1d2d4adbaf048a2fa6ee134575032c4b2dad9a7efafd5b3e69b88db935afaddf + - type: file + url: https://waf.io/waf-2.0.25 + sha256: 21199cd220ccf60434133e1fd2ab8c8e5217c3799199c82722543970dc8e38d5 + dest-filename: waf + cleanup: + - /include + - /lib/pkgconfig + - /share/man + + # Main application + - name: plezy + buildsystem: simple + build-commands: + # Set up Flutter PATH + - export PATH="$PATH:/usr/src/flatpak/flutter/bin" + - export PUB_CACHE=/usr/src/flatpak/.pub-cache + + # Build the app + - flutter build linux --release --dart-define=ENABLE_UPDATE_CHECK=true + + # Install application files + - mkdir -p /app/bin + - mkdir -p /app/share/applications + - mkdir -p /app/share/metainfo + - mkdir -p /app/share/icons/hicolor/512x512/apps + + # Copy built application + - cp -r build/linux/x64/release/bundle /app/plezy + - ln -s /app/plezy/plezy /app/bin/plezy + + # Install desktop file and metadata + - install -Dm644 linux/com.edde746.plezy.desktop /app/share/applications/com.edde746.plezy.desktop + - install -Dm644 linux/com.edde746.plezy.metainfo.xml /app/share/metainfo/com.edde746.plezy.metainfo.xml + + # Install icon + - install -Dm644 android/fastlane/metadata/android/en-GB/images/icon.png /app/share/icons/hicolor/512x512/apps/com.edde746.plezy.png + + sources: + - type: git + url: https://github.com/edde746/plex-flutter.git + # NOTE: This will be replaced with actual commit hash by flatpak-flutter preprocessing + commit: HEAD + + - type: git + url: https://github.com/flutter/flutter.git + # NOTE: This will be replaced with SDK modules by flatpak-flutter preprocessing + tag: stable + dest: flutter