Commit 92990616 authored by Martin Höher's avatar Martin Höher

Merge branch '215-build-the-app-as-flatpak' into 'master'

Resolve "Build the app as Flatpak"

Closes #215

See merge request !104
parents fcef0485 862667a8
Pipeline #43778606 passed with stages
in 13 minutes and 27 seconds
......@@ -23,3 +23,6 @@ config.tests/*/*.o
config.tests/qtkeychain/qtkeychain
.qmake.stash
CMakeLists.txt.user*
/fp-app
/fp-repo
.flatpak-builder
......@@ -3,6 +3,7 @@ variables:
WIN64_IMAGE: registry.gitlab.com/rpdev/opentodolist:win64
UBUNTU_IMAGE: registry.gitlab.com/rpdev/opentodolist:ubuntu
ANDROID_IMAGE: registry.gitlab.com/rpdev/opentodolist:android
FLATPAK_IMAGE: registry.gitlab.com/rpdev/opentodolist:flatpak
NEXTCLOUD_IMAGE: nextcloud
OWNCLOUD_IMAGE: owncloud
CTEST_OUTPUT_ON_FAILURE: 1
......@@ -75,6 +76,20 @@ build_image_android:
when: manual
# Build the Flatpak Image
build_image_flatpak:
stage: images
image: docker:git
services:
- docker:dind
script:
- cd ci/docker/flatpak
- docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN registry.gitlab.com
- docker build --pull -t $FLATPAK_IMAGE .
- docker push $FLATPAK_IMAGE
when: manual
################################################################################
# Build Stage
################################################################################
......@@ -159,6 +174,18 @@ android_x86:
expire_in: 1 week
# Build the app as Flatpak
build_flatpak:
stage: build
image: $FLATPAK_IMAGE
script:
- ci/flatpak-build.sh
artifacts:
paths:
- fp-repo
expire_in: 1 week
################################################################################
# Installer Stage
################################################################################
......@@ -192,8 +219,6 @@ github:
- cp build-ubuntu/OpenTodoList-x86_64.AppImage uploads
- cp deploy-win32/OpenTodoList-Windows-32bit.exe uploads
- cp deploy-win64/OpenTodoList-Windows-64bit.exe uploads
- cp build-win32-vs/OpenTodoList-Windows-32bit-MSVC.exe uploads || echo "Skip deploying MSVC 32bit installer"
- cp build-win64-vs/OpenTodoList-Windows-64bit-MSVC.exe uploads || echo "Skip deploying MSVC 64bit installer"
- cp build-android-*/*-aligned.apk uploads
- cp build-macos/app/OpenTodoList.dmg uploads
- ./ci/github-upload.py mhoeher opentodolist $CI_COMMIT_REF_NAME $GITHUB_ACCESS_TOKEN ./uploads/*
......@@ -201,3 +226,24 @@ github:
only:
- tags
pages:
stage: deploy
image: fedora
script:
- mkdir public
- cp -r fp-repo public
- cp build-ubuntu/OpenTodoList-x86_64.AppImage public
- cp deploy-win32/OpenTodoList-Windows-32bit.exe public
- cp deploy-win64/OpenTodoList-Windows-64bit.exe public
- cp build-android-*/*-aligned.apk public
- cp build-macos/app/OpenTodoList.dmg public
- dnf install -y --nogpgcheck git
- git describe --tags > public/version.txt
- cd public
- sha256sum * > sha256sums.txt
artifacts:
paths:
- public
only:
- master
......@@ -47,6 +47,30 @@ if(ANDROID)
endif()
set(QLMDB_WITH_BUILTIN_LMDB ON CACHE BOOL "Use built in lmdb library")
# Install data files:
set(APPLICATION_NAME OpenTodoList)
set(APPLICATION_EXECUTABLE OpenTodoList)
configure_file(
OpenTodoList.desktop.in
${CMAKE_CURRENT_BINARY_DIR}/OpenTodoList.desktop
)
include(GNUInstallDirs)
install(
DIRECTORY templates/icons/hicolor
DESTINATION ${CMAKE_INSTALL_DATADIR}/icons/
)
install(
FILES net.rpdev.OpenTodoList.appdata.xml
DESTINATION ${CMAKE_INSTALL_DATADIR}/appdata
)
install(
FILES ${CMAKE_CURRENT_BINARY_DIR}/OpenTodoList.desktop
DESTINATION ${CMAKE_INSTALL_DATADIR}/applications
)
# Disable building translations in QtKeychain:
set(BUILD_TRANSLATIONS NO CACHE BOOL "")
# Include sub-directories:
add_subdirectory(3rdparty)
......@@ -57,9 +81,12 @@ add_subdirectory(test)
# Show other, project-related files:
file(GLOB_RECURSE OTHER_FILES
OpenTodoList.desktop.in
README.md
COPYING
Doxyfile
net.rpdev.OpenTodoList.json
net.rpdev.OpenTodoList.appdata.xml
doc/*
.gitlab-ci.yml
bin/*
......
[Desktop Entry]
Categories=Utility;
Type=Application
Exec=@APPLICATION_EXECUTABLE@
Name=@APPLICATION_NAME@
Comment=@APPLICATION_NAME@ todo list and note taking application
GenericName=Todo List and Note Taking Application
Icon=@APPLICATION_ICON_NAME@
Keywords=@APPLICATION_NAME@;todo;note;
X-GNOME-Autostart-Delay=3
......@@ -136,3 +136,10 @@ add_custom_target(opentodolist-translations
${QM_FILES}
translations-copy.qrc
)
# Install the app:
install(
TARGETS OpenTodoList
DESTINATION ${CMAKE_INSTALL_BINDIR}
)
FROM fedora
RUN \
dnf install -y --nogpgcheck \
flatpak \
flatpak-builder \
libappstream-glib \
&& \
\
flatpak remote-add \
--if-not-exists \
flathub https://flathub.org/repo/flathub.flatpakrepo \
&& \
\
flatpak install -y flathub org.kde.Platform//5.12 \
&& \
\
flatpak install -y flathub org.kde.Sdk//5.12
IMAGE ?= registry.gitlab.com/rpdev/opentodolist:flatpak
help:
@echo "Targets:"
@echo " build - Build the image."
@echo " publish - Upload the image to GitLab."
build:
buildah bud --pull -t ${IMAGE} .
publish:
buildah push docker://${IMAGE}
login:
podman login registry.gitlab.com
#!/bin/bash
set -e
if [ -n "$CI" ]; then
echo "$FLATPAK_SIGNING_KEY" > flatpak-signing-key.asc
gpg2 --import ./flatpak-signing-key.asc
rm flatpak-signing-key.asc
fi
appstream-util validate-relax net.rpdev.OpenTodoList.appdata.xml
mkdir -p fp-app fp-repo
flatpak-builder \
--ccache \
--repo=fp-repo \
--subject="Build of OpenTodoList `date`" \
--gpg-sign 3D5B6355C13D18AB \
fp-app \
net.rpdev.OpenTodoList.json
......@@ -27,7 +27,7 @@ add_custom_target(
COMMAND
cp -r ${CMAKE_CURRENT_SOURCE_DIR}/templates/icons/* AppImageBuild/usr/share/icons/hicolor/
COMMAND
cp -r ${CMAKE_CURRENT_SOURCE_DIR}/templates/icons/64x64/apps/OpenTodoList.png AppImageBuild/
cp -r ${CMAKE_CURRENT_SOURCE_DIR}/templates/icons/hicolor/64x64/apps/OpenTodoList.png AppImageBuild/
COMMAND
${LINUXDEPLOYQT} --appimage-extract
COMMAND
......
......@@ -137,3 +137,9 @@ target_link_libraries(opentodolist-common
qt5keychain
qlmdb
)
install(
TARGETS opentodolist-common
DESTINATION ${CMAKE_INSTALL_LIBDIR}
)
<?xml version="1.0" encoding="UTF-8"?>
<component type="desktop-application">
<id>net.rpdev.OpenTodoList.desktop</id>
<name>OpenTodoList</name>
<project_license>GPL-3.0+</project_license>
<summary>Todo list and note taking application</summary>
<metadata_license>CC0-1.0</metadata_license>
<description>
<p>OpenTodoList is an todo list and note taking application. Create todo
lists, notes and put other resources, arranging them in libraries.
These libraries can be kept locally or synchronized with services
such as NextCloud or ownCloud to sync them across your devices.</p>
</description>
<screenshots>
<screenshot type="default">
<caption>A library</caption>
<image>https://opentodolist.rpdev.net/images/v3.7/material-1.png</image>
</screenshot>
</screenshots>
<url type="homepage">https://opentodolist.rpdev.net/</url>
</component>
[Flatpak Ref]
Name=net.rpdev.OpenTodoList
Branch=master
Title=net.rpdev.OpenTodoList from Continuous Integration
Url=https://rpdev.gitlab.io/opentodolist/fp-repo/
RuntimeRepo=https://flathub.org/repo/flathub.flatpakrepo
IsRuntime=false
GPGKey=LS0tLS1CRUdJTiBQR1AgUFVCTElDIEtFWSBCTE9DSy0tLS0tCgptUUlOQkZ3L2R4Y0JFQUNod1dXWWhnY3ZBb1UrMTk0aWIxSFlkbXp6OG9ZZmIraU5zdjNqVGx6R2g2dGVSRFRrCi94Q1RrcTNqalFCbUJSdmM3RVQxVzhabkIzL21DUmhFVWhoWU9FMGJkODdsa1hBZnRDbjE4MTNYMVppd0MwcWwKQkRXaVZPQ1hYYzl3TkFDc1hDVUFqTy9sQ01iM1JqS0prR0hPTjE2V2tBaUtCUkVZRnNUSW5VZ1kxM2NvMVVGTwphVlZRT05zQnZLVndDc1VRampJTUNxVGszK0o4RjZES3pDWW1teWFDcDJ6eGQ1WE1VcmtJeFUvendGVE9la0QvCmhEWDFnRHBTQUJZOTNCSENTM0dCSVc0dmN6akFtSEl0Zm9RYzRuQ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tzRWJQWVVNdEZHUDZ6UUEKc2R2aFFtVzJuMDZGVXdZc085eGMreDNwTHN5dmRqcG5lUERXdnJzMitlTURvdEVXYjBlaHhpbkgySGtnTjl5cwoyMklHekNLV2dzQzdSNWltVDI3R2tZaDhuNmlhY0FLV1lZT094YzE4Y0pXVVJXUloyM05LN2hESlljdWo5ZjZLCjA3UmpxbnNsMTF5cWJrd2Y4Z0EvWnN1MGtjVTJ6SlJuTGpzWW5qNExjVjcrbVFwTU1kYUlpYWpkc2JKcnJTS3cKdGpZUFVkaFBWQWpmb01HTWlTVE1iRlVOMmg2S2oyNUtqUlZHdmtocnhDK3VKblZsODNQNDRQa0FxNEtWU1NFbwovRllLVUFia3dpYkhkVUl0cGF4d2k4VzZQN0NHYmwwaHFoNVY0SERESExZYVcrc1N5bWlxU0hkSWNzd3I4QnozClFjU3o3alRRVWd6Wk8xTUplYy9EaThKbnNuMnVrN2NQdk9ITVFDMlVkOTMvMmNhRDJhN1JTTnFwSGNNUHVZbFcKOHNMQXNpb3N6aTJVUGNwa0c1eTlqekNQbmpZa2w2blF2aDc1Cj1IVTVUCi0tLS0tRU5EIFBHUCBQVUJMSUMgS0VZIEJMT0NLLS0tLS0K
{
"id": "net.rpdev.OpenTodoList",
"rename-icon": "OpenTodoList",
"rename-desktop-file": "OpenTodoList.desktop",
"runtime": "org.kde.Platform",
"runtime-version": "5.12",
"sdk": "org.kde.Sdk",
"command": "OpenTodoList",
"finish-args": [
"--share=ipc",
"--socket=x11",
"--socket=wayland",
"--filesystem=host",
"--socket=pulseaudio",
"--socket=session-bus",
"--share=network",
"--device=dri"
],
"modules": [
{
"name": "libsecret",
"config-opts": [
"--disable-static",
"--disable-gtk-doc",
"--disable-manpages"
],
"sources": [
{
"type": "archive",
"url": "https://gitlab.gnome.org/GNOME/libsecret/-/archive/0.18.6/libsecret-0.18.6.tar.gz",
"sha256": "f4fa198d4e131f94d9ec84cfeaf6c124245e7ff3c0af11c76cc35332bfae5585"
}
]
},
{
"name": "opentodolist",
"buildsystem": "cmake-ninja",
"config-opts": [
"-DCMAKE_BUILD_TYPE=Release",
"-DCMAKE_INSTALL_LIBDIR=/app/lib",
"-DLIB_INSTALL_DIR=/app/lib"
],
"sources": [
{
"type": "dir",
"path": "."
}
]
}
]
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment