~comcloudway/melon

594b8cb290b541164c566c9de9aae1b0501a98a6 — Jakob Meier 2 months ago 35a9f39
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.
4 files changed, 74 insertions(+), 3 deletions(-)

A .builds/flatpak-nightly.yml
M README.md
M flatpak/README.md
A flatpak/melon-nightly.flatpakrepo
A .builds/flatpak-nightly.yml => .builds/flatpak-nightly.yml +44 -0
@@ 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: <access-key>:<secret_access_key>
  - 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

M README.md => README.md +23 -2
@@ 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/), 

M flatpak/README.md => flatpak/README.md +0 -1
@@ 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

A flatpak/melon-nightly.flatpakrepo => flatpak/melon-nightly.flatpakrepo +7 -0
@@ 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