#!/bin/sh
set -ex

# FIXME: AppImages can theoretically also be built on OBS.
# Unfortunately it only works with packages from openSUSE 15.6.
# Also, it's not trivial to build multiple AppImages on OBS.
# FIXME: This still relies on the Debian repositories provided
# via OBS. But there is no guarantee it is ready by the time
# we run this CI job.
# We should be fine, though unless committing at 6:00 in the morning.

cd AppImage
~/pkg2appimage/squashfs-root/AppRun curses.yml
mv out/*.AppImage /opt/htdocs/downloads/nightly/sciteco-curses_nightly_x86_64.AppImage
~/pkg2appimage/squashfs-root/AppRun gtk.yml
mv out/*.AppImage /opt/htdocs/downloads/nightly/sciteco-gtk_nightly_x86_64.AppImage
chmod a+x /opt/htdocs/downloads/nightly/*.AppImage
