feat: add AppImage and Flatpak packaging support

- Add AppImage build using linuxdeploy
- Add Flatpak build using flatpak-builder
- Create AppRun script for .NET runtime sharing
- Create Flatpak manifest and desktop file
- Integrate both formats into release workflow
- Upload .AppImage and .flatpak as release artifacts

This provides comprehensive Linux packaging support:
- DEB: For Debian/Ubuntu systems
- Linglong: For Deepin/UOS systems
- AppImage: Universal Linux format (download and run)
- Flatpak: Universal Linux format (sandboxed)

All formats share the same .NET runtime for efficiency.
This commit is contained in:
lincube
2026-06-25 16:18:06 +08:00
parent de2ab54732
commit f7926a287f
4 changed files with 246 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
#!/bin/bash
# AppImage entry point for LanMountainDesktop
SELF=$(readlink -f "$0")
HERE="${SELF%/*}"
# Find the app directory with .NET runtime
APP_DIR=""
for dir in "$HERE/usr/bin"/app-*; do
if [ -d "$dir" ] && [ -f "$dir/LanMountainDesktop.dll" ]; then
APP_DIR="$dir"
break
fi
done
if [ -n "$APP_DIR" ]; then
export DOTNET_ROOT="$APP_DIR"
export PATH="$DOTNET_ROOT:$PATH"
fi
# Launch the application
exec "$HERE/usr/bin/LanMountainDesktop.Launcher" "$@"

View File

@@ -0,0 +1,10 @@
[Desktop Entry]
Type=Application
Version=1.0
Name=LanMountainDesktop
Comment=LanMountainDesktop desktop shell
Exec=LanMountainDesktop.Launcher %U
Icon=com.lanmountain.desktop
Terminal=false
Categories=Utility;Education;
StartupWMClass=LanMountainDesktop

View File

@@ -0,0 +1,54 @@
app-id: com.lanmountain.desktop
runtime: org.freedesktop.Platform
runtime-version: '23.08'
sdk: org.freedesktop.Sdk
command: LanMountainDesktop.Launcher
finish-args:
# X11 + XShm access
- --share=ipc
- --socket=x11
# Wayland access
- --socket=wayland
# GPU acceleration
- --device=dri
# Audio access
- --socket=pulseaudio
# Network access
- --share=network
# Home directory access
- --filesystem=home
# D-Bus access for desktop integration
- --talk-name=org.freedesktop.Notifications
- --talk-name=org.kde.StatusNotifierWatcher
modules:
- name: LanMountainDesktop
buildsystem: simple
build-commands:
# Create directory structure
- mkdir -p /app/bin
- mkdir -p /app/lib
- mkdir -p /app/share/applications
- mkdir -p /app/share/icons/hicolor/256x256/apps
# Copy application files
- cp -r publish/linux-x64/app-*/* /app/lib/
- cp publish/linux-x64/LanMountainDesktop.Launcher /app/bin/
- cp publish/linux-x64/LanMountainDesktop.AirAppRuntime /app/bin/
- cp publish/linux-x64/LanMountainDesktop.AirAppRuntime.dll /app/lib/
# Copy AirAppHost if exists
- if [ -d "publish/linux-x64/AirAppHost" ]; then cp -r publish/linux-x64/AirAppHost /app/lib/; fi
# Set permissions
- chmod +x /app/bin/*
# Install desktop file
- install -Dm644 packaging/linux/Flatpak/com.lanmountain.desktop.desktop /app/share/applications/com.lanmountain.desktop.desktop
# Install icon
- install -Dm644 packaging/linux/lanmountaindesktop.png /app/share/icons/hicolor/256x256/apps/com.lanmountain.desktop.png
sources:
- type: dir
path: ../../..