Skip to content

Commit

Permalink
Add script for building AppImage with correct version
Browse files Browse the repository at this point in the history
  • Loading branch information
bpozdena committed Sep 26, 2024
1 parent 09657c7 commit ac91588
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions build_appimage.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#!/bin/bash

# Step 1: Extract version from src/version.py
VERSION=$(python3 -c "from src.version import __version__; print(__version__)")
if [ -z "$VERSION" ]; then
echo "Failed to extract version from src/version.py"
exit 1
fi
echo "Extracted version: $VERSION"

# Step 2: Update the indented version line in AppImageBuilder.yml
YAML_FILE="AppImageBuilder.yml"
if [ -f "$YAML_FILE" ]; then
echo "Updating version in $YAML_FILE..."
# Use sed to match the indented version line (e.g., " version: 1.1.0") and update it
sed -i "s/^\(\s\+version:\s\).*/\1$VERSION/" "$YAML_FILE"
echo "Version updated to $VERSION in the indented version line of $YAML_FILE"
else
echo "$YAML_FILE not found."
exit 1
fi

# Step 3: Build the AppImage using appimage-builder
if ! command -v appimage-builder &> /dev/null; then
echo "appimage-builder could not be found. Please install it first."
exit 1
fi

echo "Building AppImage..."
appimage-builder --recipe "$YAML_FILE"

if [ $? -eq 0 ]; then
echo "AppImage build succeeded!"
else
echo "AppImage build failed."
exit 1
fi

0 comments on commit ac91588

Please sign in to comment.