forked from skilldrick/easy6502
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild-flatpak.sh
executable file
·43 lines (34 loc) · 1.38 KB
/
build-flatpak.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/bin/bash
# Exit immediately if a command exits with a non-zero status
set -e
# Application ID and manifest file
APP_ID="eu.jumplink.Learn6502"
MANIFEST_FILE="eu.jumplink.Learn6502.json"
BUILD_DIR="flatpak-build"
# Ensure Flatpak and Flatpak Builder are installed
if ! command -v flatpak-builder &> /dev/null
then
echo "flatpak-builder could not be found."
echo "Please install Flatpak and Flatpak Builder before running this script."
exit 1
fi
# Remove previous build directory if it exists
rm -rf "$BUILD_DIR"
# Build the Flatpak
echo "Building the Flatpak..."
flatpak-builder --keep-build-dirs --force-clean "$BUILD_DIR" "$MANIFEST_FILE" --install-deps-from=flathub
# Install the application locally
echo "Installing the Flatpak application locally..."
flatpak-builder --user --install --force-clean "$BUILD_DIR" "$MANIFEST_FILE"
# Export the Flatpak for Flathub
echo "Exporting Flatpak for Flathub..."
flatpak-builder --repo=repo --force-clean "$BUILD_DIR" "$MANIFEST_FILE"
# Create a tarball for Flathub
echo "Creating tarball for Flathub..."
tar -czf "$APP_ID.tar.gz" -C "$BUILD_DIR" .
echo "Build complete! The Flatpak has been installed locally and exported for Flathub."
echo "To publish to Flathub:"
echo "1. Push your changes to GitHub"
echo "2. Create a new release on GitHub"
echo "3. Upload the $APP_ID.tar.gz file to the release"
echo "4. Submit your application on Flathub"