mirror of
https://github.com/kilyabin/psysonic.git
synced 2026-07-22 06:25:41 +00:00
feat(flatpak): add Flatpak packaging and CI release pipeline (#271)
Adds full Flatpak support for Psysonic including: - Flatpak manifest (org.gnome.Platform 47 + rust-stable + node20) with proper finish-args for MPRIS, Discord RPC, PulseAudio, Wayland/X11 - AppStream metainfo XML and .desktop entry - In-app updater disabled at build time via VITE_PSYSONIC_FLATPAK=1 - CI job \`build-flatpak\` in release.yml: generates cargo/npm offline sources, patches manifest with release tag/commit, builds bundle via flatpak/flatpak-github-actions@v6, uploads .flatpak to GitHub release - Release docs updated in CLAUDE.md (Flatpak bump and Flathub mirror flow)
This commit is contained in:
@@ -0,0 +1,89 @@
|
||||
app-id: dev.psysonic.Psysonic
|
||||
runtime: org.gnome.Platform
|
||||
runtime-version: '47'
|
||||
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
|
||||
- --socket=wayland
|
||||
- --socket=fallback-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:
|
||||
- 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
|
||||
# Build frontend (dist/ must exist before cargo compiles the Rust crate,
|
||||
# because tauri-build embeds the assets at compile time)
|
||||
- npm run build
|
||||
# Build the Rust binary (offline, using pre-vendored cargo sources)
|
||||
- cargo build --manifest-path src-tauri/Cargo.toml --release
|
||||
# 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 packages/flatpak/generate-sources.sh to create them.
|
||||
- cargo-sources.json
|
||||
- npm-sources.json
|
||||
- type: file
|
||||
path: dev.psysonic.Psysonic.desktop
|
||||
- type: file
|
||||
path: dev.psysonic.Psysonic.metainfo.xml
|
||||
Reference in New Issue
Block a user