-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add script for building AppImage with correct version
- Loading branch information
Showing
1 changed file
with
37 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |