name: Flatpak Build

on:
  push:
    branches: [master]
  pull_request:
    branches: [master]

jobs:
  flatpak_build:
    runs-on: ubuntu-latest
    container:
      image: ghcr.io/flathub-infra/flatpak-github-actions:gnome-49
      options: --privileged

    steps:
      - uses: actions/checkout@v4
        with:
          submodules: true

      - uses: flatpak/flatpak-github-actions/flatpak-builder@v6
        with:
          bundle: zoitechat.flatpak
          manifest-path: flatpak/io.github.Zoitechat.json
          cache-key: flatpak-builder-${{ github.sha }}
