Producing AppImages on Gitlab CI¶
appimage-builder
can be easily integrated into a gitlab-ci recipe. Here you will learn how to do it.
Docker Images¶
There is an appimage-builder
docker image ready to be used on gitlab-ci you can find it here. It’s based on
Ubuntu 18.04 and brings all the dependencies required by the tool. The docker image name is:
appimagecrafters/appimage-builder
.
Recipe¶
The usual approach while writing a gitlab-ci recipe for building AppImages is to use the before_script section to install the application dependencies. In the script section we will do the project configuration, binary building and the AppImage generation.
In the code snippet below you can find a complete gitlab-ci.yml
recipe for building an AppImage for a
Hello World Qt project using the latest Qt from the KDE Neon repositories
appimage-amd64:
image: appimagecrafters/appimage-builder
before_script:
# update appimage-builder (optional)
- apt-get update
- apt-get install -y git wget
- pip3 install --upgrade git+https://www.opencode.net/azubieta/appimagecraft.git
# app build requirements
- echo 'deb http://archive.neon.kde.org/user/ bionic main' > /etc/apt/sources.list.d/neon.list
- wget -qO - https://archive.neon.kde.org/public.key | apt-key add -
- apt-get update
- apt-get install -y qt5-default qtdeclarative5-dev cmake
script:
- cmake . -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr
- make install DESTDIR=AppDir
- appimage-builder --skip-test
artifacts:
paths:
- '*.AppImage*'
expire_in: 1 week
OpenCode¶
Any Gitlab instance can be used to host your AppImage builds but it’s recommended to do it on opencode.net. This instance part of the OpenDesktop ecosystem were the AppImageHub project lives. This will allow to mark published binaries as “OFFICIAL”.