... | ... | @@ -18,6 +18,8 @@ variables: |
|
|
RUNTIME_REPO: "https://sdk.gnome.org/gnome-nightly.flatpakrepo"
|
|
|
# Replace with your application name, as written in the manifest
|
|
|
FLATPAK_MODULE: "app-name"
|
|
|
# Replace with your preferred file name of the resulting Flatpak bundle
|
|
|
BUNDLE: "app-name.flatpak"
|
|
|
# Make sure to keep this in sync with the Flatpak manifest, all arguments
|
|
|
# are passed except the config-args because we build it ourselves
|
|
|
MESON_ARGS: "-Dtests=all"
|
... | ... | @@ -45,14 +47,17 @@ For that, extend the previous CI file. |
|
|
Inside the script section generate the bundle. Append the following lines:
|
|
|
```yaml
|
|
|
- flatpak-builder --finish-only --repo=repo app ${MANIFEST_PATH}
|
|
|
- flatpak build-bundle repo ${BUNDLE} --runtime-repo=${RUNTIME_REPO}
|
|
|
- flatpak build-bundle repo ${BUNDLE} --runtime-repo=${RUNTIME_REPO} org.gnome.AppName
|
|
|
```
|
|
|
And secondly, we need to save the file in the server. For that we use what GitLab call artifacts.
|
|
|
|
|
|
([The last positional argument to `flatpak build-bundle` is the name of the application or runtime.](http://docs.flatpak.org/en/latest/flatpak-command-reference.html#flatpak-build-bundle))
|
|
|
|
|
|
And secondly, we need to save the file in the server. For that we use what GitLab call [artifacts](https://docs.gitlab.com/ce/user/project/pipelines/job_artifacts.html).
|
|
|
```yaml
|
|
|
artifacts:
|
|
|
paths:
|
|
|
- ${BUNDLE}
|
|
|
expire_in: 2 days
|
|
|
artifacts:
|
|
|
paths:
|
|
|
- ${BUNDLE}
|
|
|
expire_in: 2 days
|
|
|
```
|
|
|
|
|
|
### Saving build and test logs & cache builds
|
... | ... | @@ -61,15 +66,15 @@ If the CI fails, we need a way to retrieve the logs. For this we use the artifac |
|
|
- _build/meson-logs/meson-log.txt
|
|
|
- _build/meson-logs/testlog.txt
|
|
|
```
|
|
|
And we also want to be fast building, so we cache the Flatpak build adding a "cache" path.
|
|
|
And we also want to be speed up builds, so we [cache](https://docs.gitlab.com/ce/ci/caching/) the Flatpak build by adding a cache path.
|
|
|
```yaml
|
|
|
cache:
|
|
|
paths:
|
|
|
- .flatpak-builder/cache
|
|
|
- .flatpak-builder/cache
|
|
|
```
|
|
|
|
|
|
### Final gitlab-yaml file template
|
|
|
Here is the result of the whole template. The recommendation is to try to do it step by step.
|
|
|
Here is the resulting template, but it is recommended to try doing it step-by-step.
|
|
|
|
|
|
```yaml
|
|
|
stages:
|
... | ... | @@ -84,11 +89,11 @@ flatpak: |
|
|
RUNTIME_REPO: "https://sdk.gnome.org/gnome-nightly.flatpakrepo"
|
|
|
# Replace with your application name, as written in the manifest
|
|
|
FLATPAK_MODULE: "app-name"
|
|
|
# Replace with your preferred file name of the resulting Flatpak bundle
|
|
|
BUNDLE: "app-name.flatpak"
|
|
|
# Make sure to keep this in sync with the Flatpak manifest, all arguments
|
|
|
# are passed except the config-args because we build it ourselves
|
|
|
MESON_ARGS: "-Dtests=all"
|
|
|
# Replace with the name you prefer
|
|
|
BUNDLE: "app-name-dev.flatpak"
|
|
|
|
|
|
script:
|
|
|
- flatpak-builder --stop-at=${FLATPAK_MODULE} app ${MANIFEST_PATH}
|
... | ... | @@ -98,7 +103,7 @@ flatpak: |
|
|
- flatpak build app ninja -C _build install
|
|
|
- flatpak-builder --finish-only --repo=repo app ${MANIFEST_PATH}
|
|
|
# Make a Flatpak bundle for people to test
|
|
|
- flatpak build-bundle repo ${BUNDLE} --runtime-repo=${RUNTIME_REPO} org.gnome.NautilusDevel
|
|
|
- flatpak build-bundle repo ${BUNDLE} --runtime-repo=${RUNTIME_REPO} org.gnome.AppName
|
|
|
# Run automatic tests inside the Flatpak env
|
|
|
- xvfb-run -a -s "-screen 0 1024x768x24" flatpak build app ninja -C _build test
|
|
|
artifacts:
|
... | ... | @@ -129,7 +134,7 @@ else |
|
|
name_suffix = ''
|
|
|
endif
|
|
|
|
|
|
# Replace AppName by your app name
|
|
|
# Replace AppName with your app name
|
|
|
application_id = 'org.gnome.AppName@0@'.format(profile)
|
|
|
|
|
|
# We will use this inside the actual code to give visual hints that
|
... | ... | @@ -161,7 +166,7 @@ dependencies: [ |
|
|
)
|
|
|
```
|
|
|
|
|
|
Lately, add a meson option in the meson_options.txt file for the profile:
|
|
|
Lastly, add a meson option in the meson_options.txt file for the profile:
|
|
|
```
|
|
|
option(
|
|
|
'profile',
|
... | ... | @@ -364,7 +369,7 @@ gtk_show_about_dialog (window ? GTK_WINDOW (window) : NULL, |
|
|
NULL);
|
|
|
|
|
|
```
|
|
|
And lately, if you have a Shell search provider, pass the correct id too:
|
|
|
And lastly, if you have a Shell search provider, pass the correct id too:
|
|
|
```
|
|
|
g_dbus_interface_skeleton_export (G_DBUS_INTERFACE_SKELETON (self->skeleton),
|
|
|
connection,
|
... | ... | |