52 lines
1.0 KiB
Bash
52 lines
1.0 KiB
Bash
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
SRC_DIR="/tmp/flux-src"
|
|
APPDIR="/tmp/Flux.AppDir"
|
|
OUT_APPIMAGE="/workspace/Flux-x86_64.AppImage"
|
|
|
|
rm -rf "${SRC_DIR}" "${APPDIR}"
|
|
mkdir -p "${SRC_DIR}"
|
|
|
|
tar -C /workspace \
|
|
--exclude='./.git' \
|
|
--exclude='./build' \
|
|
--exclude='./.dart_tool' \
|
|
--exclude='./*.AppImage' \
|
|
--exclude='./*.AppDir' \
|
|
--exclude='./appimagetool*' \
|
|
-cf - . | tar -C "${SRC_DIR}" -xf -
|
|
|
|
cd "${SRC_DIR}"
|
|
|
|
flutter pub get
|
|
flutter build linux --release
|
|
|
|
mkdir -p "${APPDIR}"
|
|
cp -r build/linux/x64/release/bundle/* "${APPDIR}/"
|
|
cp assets/icon/icon.png "${APPDIR}/flux.png"
|
|
|
|
cat << 'EOF' > "${APPDIR}/AppRun"
|
|
#!/bin/sh
|
|
cd "$(dirname "$0")"
|
|
exec ./flux "$@"
|
|
EOF
|
|
chmod +x "${APPDIR}/AppRun"
|
|
|
|
cat << 'EOF' > "${APPDIR}/Flux.desktop"
|
|
[Desktop Entry]
|
|
Version=1.0
|
|
Type=Application
|
|
Terminal=false
|
|
Name=Flux
|
|
Exec=flux %u
|
|
Icon=flux
|
|
Categories=Utility;
|
|
EOF
|
|
|
|
ARCH=x86_64 appimagetool "${APPDIR}" "${OUT_APPIMAGE}"
|
|
|
|
if [ -n "${HOST_UID:-}" ] && [ -n "${HOST_GID:-}" ]; then
|
|
chown "${HOST_UID}:${HOST_GID}" "${OUT_APPIMAGE}"
|
|
fi
|