binary-flatpak.yml 1.17 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
# Add template for the flatpak
# Largely based on the : https://gitlab.gnome.org/GNOME/citemplates

# Example

# variables:
#   BUNDLE: org.kde.juk.flatpak
#
# flatpak
#   extends: .flatpak
#   variables:
#     MANIFEST_URL: https://cgit.kde.org/flatpak-kde-applications.git/plain/org.kde.juk.json
#     APP_ID: org.kde.juk
#     FLATPAK_MODULE: juk
#     CMAKE_ARGS: -DENABLE_TESTING=OFF

.flatpak:
  before_script:
    - apt-get update -qq && apt-get install -qq -y flatpak flatpak-builder wget
    - flatpak remote-add --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo
21
    - if [ ! -z ${MANIFEST_URL} ]; then wget ${MANIFEST_URL}; fi
Bhushan Shah's avatar
Bhushan Shah committed
22
  stage: build
23 24 25 26
  tags:
    - flatpak
  script:
    - flatpak-builder --install-deps-from=flathub --stop-at=${FLATPAK_MODULE} app ${MANIFEST_PATH}
27
    - mkdir _build && cd _build
Bhushan Shah's avatar
Bhushan Shah committed
28
    - flatpak build ../app cmake .. -DCMAKE_INSTALL_PREFIX:PATH=/app -G Ninja ${CMAKE_ARGS}
29
    - cd ..
30
    - flatpak build app ninja -C _build install
31 32
    - flatpak-builder --finish-only --repo=repo app ${MANIFEST_PATH}
    - flatpak build-bundle repo ${BUNDLE} ${APP_ID}
33 34
  only:
    - master
35 36 37
  artifacts:
    paths:
      - ${BUNDLE}
38
    expire_in: 1 week