linux:flatpak:
    image: ubuntu:latest
    stage: build
    variables:
        KDE_FLATPAK_MODULE_NAME: ${CI_PROJECT_NAME}
        #KDE_FLATPAK_APP_ID: org.kde.${CI_PROJECT_NAME}
        KDE_FLATPAK_APP_ID: org.mattbas.Glaxnimate
    before_script:
        - apt-get update -qq
        - apt install -y flatpak-builder python3 python3-pip
        - pip install pyyaml
        - flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
        - flatpak install -y org.kde.Platform/x86_64/6.3
        - flatpak install -y org.kde.Sdk/x86_64/6.3
    script:
        - mkdir -p build/flatpak_out
        - flatpak-builder --repo=repo build/flatpak_out .flatpak-manifest.yml
        - flatpak build-bundle repo ${KDE_FLATPAK_MODULE_NAME}.flatpak ${KDE_FLATPAK_APP_ID} master
    artifacts:
        name: Flatpak artifacts
        expose_as: 'Flatpak Bundle'
        when: on_success
        paths:
        - "${KDE_FLATPAK_MODULE_NAME}.flatpak"
        expire_in: 14 days

