Files
psysonic/packages/flatpak/dev.psysonic.Psysonic.yml
kilyabin 97d99b8c5e feat(flatpak): add Flatpak packaging and CI release pipeline
- GNOME Platform 48 runtime (WebKitGTK included)
- GDK_BACKEND=wayland,x11 via finish-args (fixes GTK panic on pure-Wayland)
- libappindicator3 from flathub/shared-modules (not in GNOME 48 runtime)
- npm run tauri -- build --no-bundle (enables custom-protocol, fixes blank window)
- build-flatpak job in reusable-channel-publish.yml
- In-app updater disabled via VITE_PSYSONIC_FLATPAK=1
2026-04-29 01:57:51 +04:00

97 lines
4.4 KiB
YAML

app-id: dev.psysonic.Psysonic
runtime: org.gnome.Platform
runtime-version: '50'
sdk: org.gnome.Sdk
sdk-extensions:
- org.freedesktop.Sdk.Extension.rust-stable
- org.freedesktop.Sdk.Extension.node20
command: psysonic
separate-locales: false
finish-args:
# Network: Subsonic server, Last.fm, Discord RPC, LRCLIB, Bandsintown
- --share=network
- --share=ipc
# Display: prefer Wayland, fall back to X11
- --socket=wayland
- --socket=fallback-x11
# On pure-Wayland sessions the X11 socket is absent; tell GDK to try
# Wayland first so GTK doesn't panic when XDG_SESSION_TYPE=wayland.
- --env=GDK_BACKEND=wayland,x11
# Audio: PulseAudio + ALSA, USB DACs (UMC202HD etc.)
- --socket=pulseaudio
- --device=all
# D-Bus: MPRIS, Discord RPC, tray icon
- --socket=session-bus
- --talk-name=org.mpris.MediaPlayer2.*
- --own-name=org.mpris.MediaPlayer2.psysonic
- --talk-name=com.discordapp.*
# Discord RPC unix socket lives in $XDG_RUNTIME_DIR
- --filesystem=xdg-run/discord-ipc-0:ro
- --filesystem=xdg-run/discord-ipc-1:ro
- --filesystem=xdg-run/discord-ipc-2:ro
- --filesystem=xdg-run/discord-ipc-3:ro
- --filesystem=xdg-run/discord-ipc-4:ro
# Tray icon (GNOME needs AppIndicator extension installed)
- --talk-name=org.kde.StatusNotifierWatcher
- --talk-name=org.freedesktop.Notifications
# Local music library (read-only, for future local-file playback)
- --filesystem=xdg-music:ro
build-options:
append-path: /usr/lib/sdk/rust-stable/bin:/usr/lib/sdk/node20/bin
env:
- CARGO_HOME=/run/build/psysonic/cargo
- CARGO_NET_OFFLINE=true
- RUSTUP_TOOLCHAIN=stable
modules:
# libappindicator3 is not in the GNOME 48 runtime; build the Canonical
# version from shared-modules (cloned by the CI job before flatpak-builder
# runs, and manually for local builds per CLAUDE.md).
- shared-modules/libappindicator/libappindicator-gtk3-12.10.json
- name: psysonic
buildsystem: simple
build-options:
env:
# Disables the in-app updater UI — Flathub owns updates for Flatpak installs
- VITE_PSYSONIC_FLATPAK=1
# Prevents tauri-build from checking whether the Vite dev server is running
- TAURI_SKIP_DEVSERVER_CHECK=true
# Last.fm API keys — replaced with real values by the CI job at build time
- VITE_LASTFM_API_KEY=__LASTFM_KEY__
- VITE_LASTFM_API_SECRET=__LASTFM_SECRET__
# npm offline cache — flatpak-node-generator places sources in flatpak-node/npm-cache
- npm_config_cache=/run/build/psysonic/flatpak-node/npm-cache
build-commands:
# Install npm dependencies from pre-generated offline sources
- npm ci --offline
# `tauri build` runs beforeBuildCommand (vite) then compiles the Rust
# binary with the custom-protocol feature enabled (required for the
# embedded asset server). --no-bundle skips deb/rpm/AppImage generation.
- npm run tauri -- build --no-bundle
# Install binary and assets
- install -Dm755 src-tauri/target/release/psysonic "${FLATPAK_DEST}/bin/psysonic"
- install -Dm644 dev.psysonic.Psysonic.desktop "${FLATPAK_DEST}/share/applications/dev.psysonic.Psysonic.desktop"
- install -Dm644 dev.psysonic.Psysonic.metainfo.xml "${FLATPAK_DEST}/share/metainfo/dev.psysonic.Psysonic.metainfo.xml"
- install -Dm644 src-tauri/icons/32x32.png "${FLATPAK_DEST}/share/icons/hicolor/32x32/apps/dev.psysonic.Psysonic.png"
- install -Dm644 src-tauri/icons/128x128.png "${FLATPAK_DEST}/share/icons/hicolor/128x128/apps/dev.psysonic.Psysonic.png"
- install -Dm644 src-tauri/icons/128x128@2x.png "${FLATPAK_DEST}/share/icons/hicolor/256x256/apps/dev.psysonic.Psysonic.png"
- install -Dm644 src-tauri/icons/icon.png "${FLATPAK_DEST}/share/icons/hicolor/512x512/apps/dev.psysonic.Psysonic.png"
sources:
- type: git
url: https://github.com/Psychotoxical/psysonic.git
# Updated automatically by the CI release job; bump manually for local builds
tag: app-v1.43.0
commit: PLACEHOLDER_COMMIT
# Generated by the CI job via flatpak-cargo-generator and flatpak-node-generator.
# Committed into git only for the Flathub mirror repo (separate from this source
# repo); locally, run the commands in CLAUDE.md to create them.
- cargo-sources.json
- npm-sources.json
- type: file
path: dev.psysonic.Psysonic.desktop
- type: file
path: dev.psysonic.Psysonic.metainfo.xml