ci: replace flatpak with appimage

This commit is contained in:
edde746
2025-11-05 07:36:55 +01:00
parent 0774263d83
commit 7236702818
3 changed files with 122 additions and 122 deletions
+53 -37
View File
@@ -379,11 +379,8 @@ jobs:
name: linux-app
path: plezy-linux.tar.gz
build-flatpak:
build-appimage:
runs-on: ubuntu-latest
container:
image: ghcr.io/flathub-infra/flatpak-github-actions:gnome-48
options: --privileged
permissions:
id-token: write
attestations: write
@@ -391,50 +388,69 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Replace version and commit placeholders
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
channel: "stable"
cache: true
- name: Cache Pub dependencies
uses: actions/cache@v4
with:
path: |
~/.pub-cache
key: ${{ runner.os }}-pub-${{ hashFiles('**/pubspec.lock') }}
restore-keys: |
${{ runner.os }}-pub-
- name: Cache APT packages
uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: clang cmake ninja-build pkg-config libgtk-3-dev liblzma-dev libstdc++-12-dev libasound2-dev libmpv-dev mpv
version: 1.0
- name: Install Linux dependencies
run: |
sudo apt-get update
sudo apt-get install -y clang cmake ninja-build pkg-config libgtk-3-dev liblzma-dev libstdc++-12-dev libasound2-dev libmpv-dev mpv
- name: Install dependencies
run: flutter pub get
- name: Build Linux
run: flutter build linux --release --dart-define=ENABLE_UPDATE_CHECK=true
- 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)
COMMIT_SHA=$(git rev-parse HEAD)
echo "Version: $VERSION"
echo "Flutter SDK Version: $FLUTTER_VERSION"
echo "Date: $DATE"
echo "Commit SHA: $COMMIT_SHA"
# 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
# Replace placeholders in manifest
sed -i "s|{{COMMIT_SHA}}|$COMMIT_SHA|g" linux/com.edde746.plezy.yml
- 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
- name: Build AppImage
uses: AppImageCrafters/build-appimage-action@master
with:
bundle: plezy.flatpak
manifest-path: linux/com.edde746.plezy.yml
cache-key: flatpak-builder-${{ github.sha }}
recipe: linux/AppImageBuilder.yml
env:
UPDATE_INFO: gh-releases-zsync|edde746|plezy|latest|Plezy-*x86_64.AppImage.zsync
- name: Attest Flatpak
- name: Rename AppImage
run: |
APPIMAGE=$(find . -name "*.AppImage" -type f | head -1)
if [ -f "$APPIMAGE" ]; then
mv "$APPIMAGE" plezy-linux.AppImage
fi
- name: Attest AppImage
uses: actions/attest-build-provenance@v2
with:
subject-path: plezy.flatpak
subject-path: plezy-linux.AppImage
- name: Upload Flatpak
- name: Upload AppImage
uses: actions/upload-artifact@v4
with:
name: linux-flatpak
path: plezy.flatpak
name: linux-appimage
path: plezy-linux.AppImage
create-release:
needs:
@@ -444,7 +460,7 @@ jobs:
build-macos,
build-windows,
build-linux,
build-flatpak,
build-appimage,
]
runs-on: ubuntu-latest
permissions:
@@ -468,7 +484,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
artifacts/linux-appimage/plezy-linux.AppImage
draft: true
prerelease: false
generate_release_notes: true
+69
View File
@@ -0,0 +1,69 @@
version: 1
script:
# Remove previous build
- rm -rf AppDir || true
# Copy Flutter bundle
- cp -r build/linux/x64/release/bundle AppDir
# Create icon directories
- mkdir -p AppDir/usr/share/icons/hicolor/512x512/apps/
- mkdir -p AppDir/usr/share/applications/
- mkdir -p AppDir/usr/share/metainfo/
# Copy desktop integration files
- install -Dm644 linux/com.edde746.plezy.desktop AppDir/usr/share/applications/com.edde746.plezy.desktop
- install -Dm644 linux/com.edde746.plezy.metainfo.xml AppDir/usr/share/metainfo/com.edde746.plezy.metainfo.xml
- install -Dm644 android/fastlane/metadata/android/en-GB/images/icon.png AppDir/usr/share/icons/hicolor/512x512/apps/com.edde746.plezy.png
# Move libraries to standard location
- mkdir -p AppDir/usr/lib
- mv AppDir/lib/* AppDir/usr/lib/ || true
- rmdir AppDir/lib || true
AppDir:
path: ./AppDir
app_info:
id: com.edde746.plezy
name: Plezy
icon: com.edde746.plezy
version: latest
exec: bin/plezy
exec_args: $@
apt:
arch: amd64
sources:
- sourceline: 'deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ jammy main restricted universe multiverse'
- sourceline: 'deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ jammy-updates main restricted universe multiverse'
include:
- libgtk-3-0
- libmpv2
- mpv
- libasound2
exclude:
- adwaita-icon-theme
- humanity-icon-theme
runtime:
env:
GIO_MODULE_DIR: '${APPDIR}/usr/lib/x86_64-linux-gnu/gio/modules'
APPDIR_LIBRARY_PATH: '${APPDIR}/usr/lib/x86_64-linux-gnu:${APPDIR}/usr/lib'
test:
fedora-30:
image: appimagecrafters/tests-env:fedora-30
command: ./AppRun
debian-stable:
image: appimagecrafters/tests-env:debian-stable
command: ./AppRun
archlinux-latest:
image: appimagecrafters/tests-env:archlinux-latest
command: ./AppRun
ubuntu-xenial:
image: appimagecrafters/tests-env:ubuntu-xenial
command: ./AppRun
AppImage:
arch: x86_64
update-information: guess
-85
View File
@@ -1,85 +0,0 @@
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/plezy.git
commit: {{COMMIT_SHA}}
- type: git
url: https://github.com/flutter/flutter.git
tag: 3.35.6
dest: flutter