Skip to content

Add CI steps for prebuild binaries

Julius Künzel requested to merge work/ci-prebuild into master

Summary

This adds a pipeline to automatically add a GitLab release with a prebuild Linux binary as soon as a tag is created. The prebuild binary is needed if Craft builds Software for Android.

The Problem

As discussed/investigated in the Craft Matrix channel a few months ago (beginning of November 2022) meson does not work on Android, which has its root cause in wrong python versions caused by symlinks instead of proper Shims. This happens because at the moment KShim is not available if we build for Android, because Android is not supported by KShim. However if we build the for Android we have the special case of cross building hence we don't need KShim for Android, but on the host machine.

Solution (As suggested by @vonreth)

Provide prebuild binaries in GitLab. If Craft builds for Android it can download these binaries and install them on the host.

What this MR does

  1. The existing Linux (openSUSE) CI template is modified to get the binary as artifact.
  2. In case a git tag is created, there is a pipeline that creates the sha256 sum and uploads it together with the binary to the generic package registry.
  3. In a second step a release is created that has links to the artifacts of the registry.

Why do we need the registry and a release?

We need this to get nice links. This is the approach recommended by the official GitLab documentation. The registry only generates links like https://invent.kde.org/sdk/kshim/-/package_files/324284/download with some random numbers in it. For releases on the other hand you can not upload artifacts directly but you can generate nice redirect links in the form of https://invent.kde.org/sdk/kshim/-/releases/v0.54/downloads/binaries/linux

Open Questions and TODOs

Is this approach okay from a infrastructure perspective? I remember recent discussions that it is not nice (in a KDE context) to use GitLab resources in automated scripts, CI etc. With this approach, Craft will use the GitLab package registry to download the binary.

This pipeline uses the registry.gitlab.com/gitlab-org/release-cli:latest docker image to get the release-cli which is needed to create releases automatically (see official documentation). Either this image needs to get put on the allow list for CI images or we need to install the release-cli on one of the existing KDE images such as kdeorg/ci-suse-qt515:latest

CC @vonreth @kloecker @bcooksley

Merge request reports