Add Flatpak build workflows - #15935
Conversation
|
This looks straight forward. Thank you. We have discussed to pride different streams for our branches and for stable builds like we do on our PPA. How does it relate to: |
|
Indeed, this looking very good already. One thing I would like to see is the flatpak uploaded to the For that reason, it might be easier to merge the new job to the existing Finally, we should look into automating the upload of a flatpak install https://downloads.mixxx.org/snapshots/2.5/mixxx-2.5.4-10-ga161b85ea9-x86_64.flatpakrefOf course, we will also claim the Flathub repo for stable release, but allowing these flatpakref to be easily tested would be really good for user IMO. I'll try to spin a PR to your repo when time allows it, but feel free to get a head start too :) |
|
Yeah, the Flatpak build tools and containers are easy to use. I like them a lot! For hosting a Mixxx Flatpak repo, we could run flat-manager on the download server or just rsync new OSTree repo structures after a daily build or a release. The latter approach is simple, but AFIK only the latest build would then be available on the repo. In this case we could keep an archive of https://github.com/flatpak/flat-manager Gnome likely uses flat-manager since they have multiple releases ( Installs from different branches can be switched using For Flathub we could eventually request direct upload credentials and ask for the flathub/org.mixxx.Mixxx repo to be archived. But that's definitely something for later. 😅 |
I was tinkering with this earlier, but quite a few steps in the matrix needed to be skipped for Flatpak build. So I was having many nested if: statements and my spider-senses started to tingle. Maybe there's a neat way to split things into even more separate jobs? It's always difficult to figure out a clean solution with limited knowledge of what is even possible. Anyway, I'll keep on working with this and add debug extension builds next. And PRs are most welcome! 🤗 |
We don't have that yet for the other targets. Since it comes with some challenges I think we should go for Is the KDE solution a matter of sharing a directory? Would it be possible to maintain this directly on out download server without any active server component? Lets go in small steps. This is already great because it has the flatpaks as artefacts for PRs. There is only one thing we need to double check. How do they play with RPM/Debian install and future possible release streams. How is signing handled? |
|
Sure thing, let's go with branches. They're quite flexible. 👍 The way Flatpak branches seem to work is that you can have multiple installations with the same app ID, provided they use different branches. And to make things even more flexible (and sometimes confusing), that limitation is separate for system-wide / user installations. Branch name of The KDE nightly Flatpak repos are indeed just directories on a standard web server. I took a peek at the build jobs and they use But yeah, we prolly should take small steps and limit the scope of this PR. Should we just finish up the artifact builds or add anything else? I'll test next how the |
|
That sounds great. I think the only part we need to consider here to have the naming convention correct that it fits to your future plans. |
|
Alrighty, I managed to get signing working after figuring out it's not possible to use GitHub secrets in a forked repo. It does make sense. 😄 Signing works well for Flatpak repositories. We build a repo and use It's also possible to build bundles for x86_64 and aarch64, create a new repo with For bundle names I was thinking of using the same convention that other Mixxx packages use. Looks like I'll add the new bundle naming and repo signing steps next. Shall we use the existing Ubuntu PPA GPG key also for Flatpak signing? |
Yes. |
So only a limited number of people will do this. Is there a different way in the flatpak eco system to verify integrity? |
|
Installs from Flatpak repositories are validated automatically unless the repo is configured with |
|
Ah ok, so we probably need to do the reposity thing than, right? |
|
Yeah, definitely. Flatpak is very much based on repositories, so we should use them wherever possible. For Flatpaks the public key is included in .flatpakrepo and .flatpakref files, so it's automatically configured for repositories. Installs are then refused if repo commits and summary is not signed with the private key. |
|
I did some testing and it's possible to do a PR repo for each build - kinda like what Flathub does on their build service. First we build for x86_64 and aarch64 and import the bundle artifacts into a unified repo. Then we sign the repo, create a .flatpakref file and rsync everything to a uniquely named directory on the download server. When the build is done, we print the .flatpakref URL into the logs for easy installation. Each repo uses about 500 MB of disc space, so the download server should periodically purge old builds. But storing even a weeks worth of PR builds is a lot, especially if we keep builds for every run. Maybe having one repo for each PR and just keeping the latest build is more feasible. 🤔 |
|
Great to hear the progress and sorry I didn't help much till now. I should have some time over the weekend to help getting this over the line. Two elements:
What do you think? |
|
No worries! 🙏 Flathub does a build delete after two weeks, so that's prolly enough time for dev builds. Plus we have the bundle artifacts as a backup and those apparently stay around for three whole months. The second option does sound better and might be easier to extend for other publishing tasks (releases, scheduled daily builds, Flathub etc.). It would be awesome to have everything modular and pass options to the build / publish jobs, depending on how the build was called. OBS does something like this with their Flatpak workflows, but it's difficult to follow how everything is actually connected. Here's a simple job I used for testing a PR repo. It uses the upload / download artifact actions and creates a unified repo directory. It worked great with just a standard web server, so we can totally do this. 🤩 |
|
I have prepared the automation in https://github.com/mixxxdj/mixxx/tree/refs/heads/chore/prepare-flatpak-ci You should be able to test it with flatpak remote-add mixxx https://downloads.mixxx.org/flatpak/repo.flatpakrepoIt will have 4 channels:
Only need to add some doc about the newly introduced Note that I am new to |
|
On our PPA we have also "patches" for the not yet releases stable branch. |
|
This PR focusses to upload unsigned flatpacks as GitHub artefact. Is this a sufficient goal for PRs? Let's go in small steps. |
|
It works, let's gooo! So it's cloning the repo locally, importing the new bundles and rsyncing the changes back. That means we can have a single repo with multiple branches, even without flat-manager. 🥳 I'm not entirely sure, but it's possible that the build step needs a I think we can also have the repo signed by adding a But let's test things! The new prepare-flatpak-ci branch already has everything, so we can discuss things here and work on it directly too. Or we can keep this PR as just the artifact build feature and start a follow-up for the repo stuff. It's all good. |
The main repo prolly should not have PR builds, unless they're all in their own branches (say, org.mixxx.Mixxx//PR12345). Using separate repos for each PR build is another possibility, or we can just rely on the bundle artifacts and use the main repo for releases / daily builds. |
|
It seems to be the symbol files only. How is the naming conventions? Maybe rename: |
Yep, agreed!
Technically, and if I understood how every works together, we shouldn't need to do this in the This was written according to ostree doc, so under reserve of my correct understanding. It does mean that we need a predictable branch name.
This is not the expected behaviour. PRs would be published under a different channel, so user are not expected to receive updates. |
|
Ah excellent, hopefully the branches / bundle imports are flexible like that. I may have just messed up something in my testing. There's very little information on running a custom Flatpak repo and using OSTree directly, so a lot of trial and error is involved. I'll change the Debug extension naming to be more descriptive. Other than that this PR is pretty much ready for the artifact upload feature. Right now the bundle artifacts should get signed, but it's not that useful since their verification is not automatic. Shall we keep things simple and leave them unsigned for now? |
Yes. Artefact self have a high level of trust via GitHub. An attacker can file an evil PR. We should not sign it. Do you want to remove the Draft stet of this PR now. I think I can merge than. |
|
Okay, I think this should be good to go now. |
daschuer
left a comment
There was a problem hiding this comment.
Looks Good now. I nice step for our upcoming flatpak repository. Thank you.

We have Flatpak manifests in the tree now, so let's put them to good use! 🏗️
Right now this PR has the basics for creating single-file Mixxx bundles and uploading them as build artifacts. It's using the official Flatpak actions and containers from Flathub. The container images have all the necessary tools and SDKs included, saving on download time.
https://github.com/flatpak/flatpak-github-actions
https://github.com/flathub-infra/actions-images
These can be used for many things - verifying manifests and metadata, creating a package on other events, building Mixxx releases, uploading to repositories and even to Flathub.
There's a lot to do and my GitHub workflow experience is limited, so help is very much appreciated. 🙏