From 594b8cb290b541164c566c9de9aae1b0501a98a6 Mon Sep 17 00:00:00 2001 From: Jakob Meier Date: Wed, 17 Jul 2024 09:35:28 +0200 Subject: [PATCH] Use sourcehut CI to build an unstable flatpak version The CI is currently running directly on the main branch, building usigned flatpaks and pushing them into an s3 bucket. --- .builds/flatpak-nightly.yml | 44 +++++++++++++++++++++++++++++++ README.md | 25 ++++++++++++++++-- flatpak/README.md | 1 - flatpak/melon-nightly.flatpakrepo | 7 +++++ 4 files changed, 74 insertions(+), 3 deletions(-) create mode 100644 .builds/flatpak-nightly.yml create mode 100644 flatpak/melon-nightly.flatpakrepo diff --git a/.builds/flatpak-nightly.yml b/.builds/flatpak-nightly.yml new file mode 100644 index 0000000..bc22f13 --- /dev/null +++ b/.builds/flatpak-nightly.yml @@ -0,0 +1,44 @@ +--- +image: alpine/edge +packages: + # prepare dependencies + - flatpak + # build dependencies + - flatpak-builder + - appstream-compose + # upload dependencies + - s3fs-fuse +environment: + app_id: "icu.ccw.Melon" + repo_dir: "/home/build/repo" + s3_url: "https://s3.ccw.icu" + s3_bucket: "melon.flatpak-nightly" +sources: + - https://git.hut.ccw.icu/~comcloudway/melon +secrets: + # s3fs passwd file + # format: : + - 46ce8da6-9e44-4e6c-a5fa-2e25d05fe3bb +tasks: + # Adapted from https://docs.flatpak.org/en/latest/hosting-a-repository.html + - s3fs-setup: | + sudo modprobe fuse + sudo mv ~/.passwd-s3fs /etc/passwd-s3fs + mkdir -p $repo_dir-live + sudo s3fs $s3_bucket $repo_dir-live -o url=$s3_url -o use_path_request_style -o umask=0007,uid=$(id -u) -o allow_other + cp -r $repo_dir-live $repo_dir + - prepare: | + flatpak remote-add --user --if-not-exists flathub "https://flathub.org/repo/flathub.flatpakrepo" + # XXX: consider signing the build using pgp + - build-dependencies: | + cd melon + flatpak-builder build --user --install-deps-from=flathub --disable-rofiles-fuse --disable-updates --force-clean --repo=$repo_dir flatpak/$app_id.yml + - build-bundle: | + cd melon + flatpak build-bundle $repo_dir $repo_dir/$app_id.flatpak --runtime-repo="https://flathub.org/repo/flathub.flatpakrepo" $app_id + - build-update-repo: | + cd melon + flatpak build-update-repo --generate-static-deltas --prune $repo_dir + - cleanup: | + cp -r $repo_dir/* $repo_dir-live + sudo umount $repo_dir-live diff --git a/README.md b/README.md index cbe4877..2c1eebb 100644 --- a/README.md +++ b/README.md @@ -40,8 +40,29 @@ head over to [Weblate](https://translate.codeberg.org/engage/melon/) [![Translation status](https://translate.codeberg.org/widget/melon/multi-auto.svg)](https://translate.codeberg.org/engage/melon/) ## 📦 Packages -There are currently no prebuilt packages available, -however you can build [the Flatpak yourself](./flatpak/README.md). +There are currently no per-release prebuilt packages available. + +You can build [the Flatpak yourself](./flatpak/README.md) +or install a nigthly version from our unsigned nightly repo. +[![builds.sr.ht status](http://builds.hut.ccw.icu/~comcloudway/melon/commits/main/flatpak-nightly.yml.svg)](http://builds.hut.ccw.icu/~comcloudway/melon/commits/main/flatpak-nightly.yml?) \ +The easiest way to do this is to download the `.flatpak` bundle file +[from the s3 bucket](https://flatpak-nightly.melon.ccw.icu/icu.ccw.Melon.flatpak) +and install it using a GUI software manager +or by opening a terminal in the same directory as the file and running +```sh +flatpak install --user icu.ccw.Melon.flatpak +``` +If you want auto updates, you have to add the flatpak repository +```sh +# if you have cloned the repository +flatpak remote-add --user --if-not-exists melon-nightly flatpak/melon-nightly.flatpakrepo +# or without cloning the repository +flatpak remote-add --user --if-not-exists melon-nightly https://codeberg.org/comcloudway/melon/raw/branch/main/flatpak/melon-nightly.flatpakrepo +``` +Afterwards, all you have to do is run the install command, and flatpak should automatically resolve the repo. +```sh +flatpak install --user icu.ccw.Melon +``` If you are running an [Alpine Linux](https://alpinelinux.org/) based distro, like [postmarketOS](https://postmarketos.org/), diff --git a/flatpak/README.md b/flatpak/README.md index 080df75..2447914 100644 --- a/flatpak/README.md +++ b/flatpak/README.md @@ -25,7 +25,6 @@ navigate into the `flatpak` directory of the `melon` source cd flatpak ``` - If you have never used flatpak before, or haven't added the flathub repo, you have to add it before building the manifest ``` sh diff --git a/flatpak/melon-nightly.flatpakrepo b/flatpak/melon-nightly.flatpakrepo new file mode 100644 index 0000000..4b2366a --- /dev/null +++ b/flatpak/melon-nightly.flatpakrepo @@ -0,0 +1,7 @@ +[Flatpak Repo] +Title=Melon +Url=https://flatpak-nightly.melon.ccw.icu/ +Homepage=https://codeberg.org/comcloudway/melon +Comment=Nightly Melon build repository +Description=Nightly Melon build repository +Icon=https://codeberg.org/comcloudway/melon/raw/branch/main/data/icu.ccw.Melon.svg -- 2.38.5