name: Build Flatpak

on:
  push:
    branches: [master]
  pull_request:

jobs:
  codespell:
    name: Check for spelling errors
    runs-on: ubuntu-latest
    steps:
      - uses: codespell-project/actions-codespell@v2
  flatpak:
    name: Build Flatpak Package
    runs-on: ubuntu-latest
    container:
      image: bilelmoussaoui/flatpak-github-actions:gnome-nightly
      options: --privileged

    steps:
      - name: Checkout repository
        uses: actions/checkout@v4

      - name: Build Flatpak bundle
        uses: flatpak/flatpak-github-actions/flatpak-builder@v6
        with:
          bundle: gradia.flatpak
          manifest-path: build-aux/flatpak/be.alexandervanhee.gradia.json
          cache-key: flatpak-builder-${{ github.sha }}
