[gnome-software: 2/3] ci: Add an on-demand flatpak bundle build




commit 0c6b103b786f132bd1eebcfb9c4100ded0c93dfb
Author: Philip Withnall <pwithnall endlessos org>
Date:   Thu Apr 15 13:57:45 2021 +0100

    ci: Add an on-demand flatpak bundle build
    
    As mentioned in `README.md`, this is not an official release, nor is it
    fully functional (only the flatpak plugin is built). It will be useful
    for testing upcoming UI changes without requiring designers to build
    gnome-software themselves.
    
    You can build it by manually triggering the ‘flatpak bundle’ job in any
    CI pipeline. Download `gnome-software-dev.flatpak` from the job’s
    artifacts once it completes, and install and run using:
    ```
    $ flatpak install --bundle ./gnome-software-dev.flatpak
    $ flatpak run org.gnome.SoftwareDevel
    ```
    
    The CI machinery uses
    https://gitlab.gnome.org/GNOME/citemplates/-/blob/master/flatpak/flatpak_ci_initiative.yml
    as a template, and is based on Nautilus’ use of the same
    (https://gitlab.gnome.org/GNOME/nautilus/-/blob/master/.gitlab-ci.yml,
    https://gitlab.gnome.org/GNOME/nautilus/-/blob/master/build-aux/flatpak/org.gnome.NautilusMaster.yml).
    
    Signed-off-by: Philip Withnall <pwithnall endlessos org>
    
    Fixes: #1206

 .gitlab-ci.yml                      |  33 ++++++++
 README.md                           |  17 ++++-
 contrib/org.gnome.SoftwareDevel.yml | 145 ++++++++++++++++++++++++++++++++++++
 3 files changed, 194 insertions(+), 1 deletion(-)
---
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 2aebc4423..dd8f03ba9 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1,5 +1,8 @@
+include: 'https://gitlab.gnome.org/GNOME/citemplates/raw/master/flatpak/flatpak_ci_initiative.yml'
+
 stages:
   - build
+  - deploy
 
 cache:
   paths:
@@ -9,6 +12,7 @@ variables:
   MESON_TEST_TIMEOUT_MULTIPLIER: 2
   G_MESSAGES_DEBUG: all
   MESON_COMMON_OPTIONS: "--buildtype debug --wrap-mode=nodownload --prefix /usr"
+  BUNDLE: "gnome-software-dev.flatpak"
 
 .build:
   before_script:
@@ -69,3 +73,32 @@ debian-stable-x86_64:
       - "_build/config.h"
       - "_build/meson-logs"
       - "_build/${CI_JOB_NAME}-report.xml"
+
+# Allow building a flatpak on demand to test out the gnome-software UI
+flatpak bundle:
+  extends: '.flatpak'
+  stage: 'build'
+  dependencies: []
+  variables:
+    MANIFEST_PATH: "contrib/org.gnome.SoftwareDevel.yml"
+    FLATPAK_MODULE: "gnome-software"
+    RUNTIME_REPO: "https://nightly.gnome.org/gnome-nightly.flatpakrepo";
+    APP_ID: "org.gnome.SoftwareDevel"
+  when: manual
+  allow_failure: true
+  script:
+    # Modified from 
https://gitlab.gnome.org/GNOME/citemplates/-/blob/master/flatpak/flatpak_ci_initiative.yml
+    # to drop the unit tests, since we don’t need them
+    - rewrite-flatpak-manifest ${MANIFEST_PATH} ${FLATPAK_MODULE} ${CONFIG_OPTS}
+    - flatpak-builder --user --disable-rofiles-fuse flatpak_app --repo=repo 
${BRANCH:+--default-branch=$BRANCH} ${MANIFEST_PATH}
+    # Generate a Flatpak bundle
+    - flatpak build-bundle repo ${BUNDLE} --runtime-repo=${RUNTIME_REPO} ${APP_ID} ${BRANCH}
+    - tar cf repo.tar repo/
+
+# Due to the `only` clause in .publish_nightly, this will only publish on-demand
+# builds to nightly.gnome.org if they are built from a commit on `master`
+nightly:
+  extends: '.publish_nightly'
+  dependencies:
+    - 'flatpak bundle'
+
diff --git a/README.md b/README.md
index fe579e58e..c181688ea 100644
--- a/README.md
+++ b/README.md
@@ -31,7 +31,22 @@ Bug reports and merge requests should be filed on [GNOME GitLab](https://gitlab.
 
 For development discussion, join us on `#gnome-software` on 
[irc.gnome.org](https://wiki.gnome.org/Community/GettingInTouch/IRC).
 
-# Building
+# Running a nightly build
+
+A [flatpak bundle](https://docs.flatpak.org/en/latest/single-file-bundles.html)
+of Software can be built on demand here by running the ‘flatpak bundle’ CI job.
+It is not fully functional, but is useful for development and testing of
+upcoming UI changes to Software. It may become more functional over time. It
+is not an official or supported release.
+
+The CI job saves the bundle in its artifacts list as `gnome-software-dev.flatpak`.
+This can be installed and run locally by downloading it and running:
+```
+$ flatpak install --bundle ./gnome-software-dev.flatpak
+$ flatpak run org.gnome.SoftwareDevel
+```
+
+# Building locally
 
 Software uses a number of plugins and depending on your operating system you
 may want to disable or enable certain ones. For example on Fedora Silverblue
diff --git a/contrib/org.gnome.SoftwareDevel.yml b/contrib/org.gnome.SoftwareDevel.yml
new file mode 100644
index 000000000..af598de90
--- /dev/null
+++ b/contrib/org.gnome.SoftwareDevel.yml
@@ -0,0 +1,145 @@
+---
+app-id: org.gnome.SoftwareDevel
+runtime: org.gnome.Platform
+runtime-version: master
+sdk: org.gnome.Sdk
+command: gnome-software
+tags:
+- devel
+- development
+- nightly
+finish-args:
+- "--share=ipc"
+- "--socket=x11"
+- "--socket=wayland"
+- "--socket=session-bus"
+- "--socket=system-bus"
+- "--filesystem=host"
+- "--share=network"
+- "--filesystem=xdg-run/dconf"
+- "--filesystem=~/.config/dconf:ro"
+- "--talk-name=ca.desrt.dconf"
+- "--env=DCONF_USER_CONFIG_DIR=.config/dconf"
+- "--filesystem=/var/lib/flatpak"
+- "--env=FLATPAK_SYSTEM_DIR=/var/lib/flatpak"
+- "--filesystem=xdg-data/flatpak"
+- "--filesystem=/usr/share/appdata:ro"
+- "--filesystem=/usr/share/app-info:ro"
+- "--filesystem=/var/lib/app-info:ro"
+- "--filesystem=/var/cache/app-info:ro"
+
+modules:
+- name: libyaml
+  buildsystem: autotools
+  builddir: true
+  config-opts:
+  - "--libdir=/app/lib"
+  sources:
+  - type: git
+    url: https://github.com/yaml/libyaml
+
+- name: lmdb
+  buildsystem: simple
+  subdir: libraries/liblmdb
+  build-commands:
+  - make install prefix=/ DESTDIR=/app
+  sources:
+  - type: git
+    url: https://git.openldap.org/openldap/openldap.git
+
+- name: appstream
+  buildsystem: meson
+  config-opts:
+  - "-Dstemming=false"
+  - "-Dapidocs=false"
+  sources:
+  - type: git
+    url: https://github.com/ximion/appstream.git
+
+- name: libxmlb
+  buildsystem: meson
+  config-opts:
+  - "-Dgtkdoc=false"
+  sources:
+  - type: git
+    url: https://github.com/hughsie/libxmlb.git
+
+- name: gnome-online-accounts
+  buildsystem: meson
+  sources:
+  - type: git
+    url: https://gitlab.gnome.org/GNOME/gnome-online-accounts.git
+
+- name: intltool
+  buildsystem: autotools
+  sources:
+  - type: archive
+    url: https://download.gnome.org/sources/intltool/0.40/intltool-0.40.6.tar.bz2
+    sha256: 4d1e5f8561f09c958e303d4faa885079a5e173a61d28437d0013ff5efc9e3b64
+
+- name: linux-pam
+  buildsystem: autotools
+  config-opts:
+  - "--disable-doc"
+  - "--includedir=/app/include/security"
+  sources:
+  - type: git
+    url: https://github.com/linux-pam/linux-pam.git
+
+- name: polkit
+  buildsystem: meson
+  sources:
+  - type: git
+    url: https://gitlab.freedesktop.org/polkit/polkit.git
+
+- name: libfuse
+  buildsystem: simple
+  build-commands:
+  - ./makeconf.sh
+  - ./configure --disable-util --disable-example --prefix=/
+  - make install DESTDIR=/app
+  sources:
+  - type: git
+    url: https://github.com/libfuse/libfuse.git
+    branch: fuse_2_9_bugfix
+
+- name: ostree
+  buildsystem: autotools
+  config-opts:
+  - "--disable-rofiles-fuse"
+  sources:
+  - type: git
+    url: https://github.com/ostreedev/ostree.git
+
+- name: pyparsing
+  buildsystem: simple
+  build-commands:
+  - pip3 install --prefix=/app --no-deps ./pyparsing-*.whl
+  sources:
+  - type: file
+    url: 
https://files.pythonhosted.org/packages/8a/bb/488841f56197b13700afd5658fc279a2025a39e22449b7cf29864669b15d/pyparsing-2.4.7-py2.py3-none-any.whl
+    sha256: ef9d7589ef3c200abe66653d3f1ab1033c3c419ae9b9bdb1240a85b024efc88b
+
+- name: flatpak
+  buildsystem: autotools
+  sources:
+  - type: git
+    url: https://github.com/flatpak/flatpak.git
+
+- buildsystem: meson
+  builddir: true
+  name: gnome-software
+  config-opts:
+  - "--libdir=/app/lib"
+  - "-Dgspell=false"
+  - "-Dpackagekit=false"
+  - "-Dpackagekit_autoremove=false"
+  - "-Dfwupd=false"
+  - "-Dflatpak=true"
+  - "-Dmalcontent=false"
+  - "-Dgudev=false"
+  - "-Dgtk_doc=false"
+  - "-Dprofile=Devel"
+  sources:
+  - type: git
+    url: https://gitlab.gnome.org/GNOME/gnome-software.git


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]