[ci] Add gitea workflows
Some checks failed
Build Flatpak / Build Flatpak (push) Failing after 7m39s
Some checks failed
Build Flatpak / Build Flatpak (push) Failing after 7m39s
This commit is contained in:
61
.gitea/workflows/build-flatpak.yml
Normal file
61
.gitea/workflows/build-flatpak.yml
Normal file
@ -0,0 +1,61 @@
|
||||
name: Build Flatpak
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ main ]
|
||||
tags: [ '*' ]
|
||||
pull_request:
|
||||
branches: [ main ]
|
||||
|
||||
jobs:
|
||||
flatpak:
|
||||
name: Build Flatpak
|
||||
# Use a VM runner if possible. If using a docker runner, ensure it supports namespaces.
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Install Flatpak Tools
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y flatpak flatpak-builder
|
||||
# Initialize the user installation (safer for CI than system-wide)
|
||||
flatpak --user remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
|
||||
|
||||
- name: Cache Flatpak Dependencies
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ~/.local/share/flatpak
|
||||
key: flatpak-${{ runner.os }}-${{ hashFiles('ink.unbl.Notify.yml') }}
|
||||
|
||||
- name: Install Runtimes
|
||||
run: |
|
||||
# Extract runtime from your manifest to install it
|
||||
# This assumes your manifest defines org.freedesktop.Platform/x86_64/23.08
|
||||
# You may need to hardcode this or parse your YAML
|
||||
flatpak --user install -y flathub org.freedesktop.Platform//23.08 org.freedesktop.Sdk//23.08
|
||||
|
||||
- name: Build Flatpak
|
||||
run: |
|
||||
# --force-clean: Ensures a fresh build
|
||||
# --install-deps-from=flathub: Automatically pulls needed libs
|
||||
# --repo=repo: Creates a local repo directory for export
|
||||
flatpak-builder --force-clean --user --install-deps-from=flathub --repo=repo build-dir ink.unbl.Notify.yml
|
||||
|
||||
- name: Build Bundle
|
||||
run: |
|
||||
# Create a single .flatpak file for distribution
|
||||
flatpak build-bundle repo my-app.flatpak ink.unbl.Notify
|
||||
|
||||
- name: Validate AppStream
|
||||
run: |
|
||||
# Optional: Check metadata validity
|
||||
flatpak run org.freedesktop.appstream-cli validate --nonet my-app.flatpak || true
|
||||
|
||||
- name: Upload Artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: flatpak-bundle
|
||||
path: my-app.flatpak
|
||||
Reference in New Issue
Block a user