add Flatpak CI and release workflows, update paths in manifest

This commit is contained in:
2026-01-28 22:37:36 +03:00
parent 502ef2ed89
commit b936b58e75
3 changed files with 107 additions and 7 deletions
+28
View File
@@ -0,0 +1,28 @@
name: Flatpak CI
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]
workflow_dispatch:
jobs:
flatpak-build:
runs-on: ubuntu-latest
container:
image: bilelmoussaoui/flatpak-github-actions:freedesktop-24.08
options: --privileged
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Build Flatpak
uses: flatpak/flatpak-github-actions/flatpak-builder@v6
with:
bundle: ru.arabianq.pwsp.flatpak
manifest-path: packages/flatpak/ru.arabianq.pwsp.yaml
cache: true
branch: master
+72
View File
@@ -0,0 +1,72 @@
name: Release Flatpak
permissions:
contents: write
on:
release:
types: [created]
workflow_dispatch:
inputs:
tag:
description: "Tag to attach assets to (e.g. v1.0.0)"
required: false
jobs:
flatpak-release:
runs-on: ubuntu-latest
container:
image: bilelmoussaoui/flatpak-github-actions:freedesktop-24.08
options: --privileged
steps:
- name: Determine tag to use
id: tag
run: |
set -euo pipefail
INPUT_TAG="${{ github.event.inputs.tag || '' }}"
if [ -n "$INPUT_TAG" ]; then
echo "tag=$INPUT_TAG" >> $GITHUB_OUTPUT
exit 0
fi
EVENT_TAG="${{ github.event.release.tag_name || '' }}"
if [ -n "$EVENT_TAG" ]; then
echo "tag=$EVENT_TAG" >> $GITHUB_OUTPUT
exit 0
fi
if [[ "${GITHUB_REF:-}" =~ ^refs/tags/(.+)$ ]]; then
echo "tag=${BASH_REMATCH[1]}" >> $GITHUB_OUTPUT
exit 0
fi
echo "No tag found"
echo "tag=" >> $GITHUB_OUTPUT
- name: Fail if no tag determined
if: ${{ steps.tag.outputs.tag == '' }}
run: |
echo "ERROR: No tag determined."
exit 1
- uses: actions/checkout@v4
with:
ref: ${{ steps.tag.outputs.tag }}
submodules: recursive
- name: Build Flatpak
uses: flatpak/flatpak-github-actions/flatpak-builder@v6
with:
bundle: ru.arabianq.pwsp.flatpak
manifest-path: packages/flatpak/ru.arabianq.pwsp.yaml
cache: true
branch: master
- name: Upload Flatpak to release
uses: softprops/action-gh-release@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
tag_name: ${{ steps.tag.outputs.tag }}
files: ru.arabianq.pwsp.flatpak
+7 -7
View File
@@ -38,16 +38,16 @@ modules:
- install -Dm755 target/release/pwsp-daemon /app/bin/pwsp-daemon
- install -Dm755 target/release/pwsp-cli /app/bin/pwsp-cli
- install -Dm755 target/release/pwsp-gui /app/bin/pwsp-gui
- install -Dm755 pwsp-wrapper.sh /app/bin/pwsp-wrapper.sh
- install -Dm755 packages/flatpak/pwsp-wrapper.sh /app/bin/pwsp-wrapper.sh
- install -Dm644 assets/icon.png /app/share/icons/hicolor/256x256/apps/ru.arabianq.pwsp.png
- install -Dm644 ru.arabianq.pwsp.desktop /app/share/applications/ru.arabianq.pwsp.desktop
- install -Dm644 ru.arabianq.pwsp.metainfo.xml /app/share/metainfo/ru.arabianq.pwsp.metainfo.xml
- install -Dm644 packages/flatpak/ru.arabianq.pwsp.desktop /app/share/applications/ru.arabianq.pwsp.desktop
- install -Dm644 packages/flatpak/ru.arabianq.pwsp.metainfo.xml /app/share/metainfo/ru.arabianq.pwsp.metainfo.xml
sources:
- type: dir
path: ../../
path: .
- type: file
path: pwsp-wrapper.sh
path: packages/flatpak/pwsp-wrapper.sh
- type: file
path: ru.arabianq.pwsp.desktop
path: packages/flatpak/ru.arabianq.pwsp.desktop
- type: file
path: ru.arabianq.pwsp.metainfo.xml
path: packages/flatpak/ru.arabianq.pwsp.metainfo.xml