1
0
mirror of https://github.com/bpozdena/OneDriveGUI.git synced 2026-10-24 04:59:17 +03:00
Files
OneDriveGUI/build_appimage.sh
Boris Pozdena 8a781a7e18 Fix packaging follow-ups from PR #301
- Fix autostart Exec fallback: the package now uses relative imports, so
  a desktop entry pointing at the script path fails at login. Use
  "-m onedrive_gui" with PYTHONPATH instead, and recognise the pip
  console script "onedrive-gui" when it is on PATH.
- AppImageBuilder.yml: revert accidental python3.10 -> python3.12 change,
  drop the now-redundant "cp src AppDir/usr" (the wheel install covers
  it), quote the *.whl glob.
- pyproject.toml: read version dynamically from options.py so it is not
  duplicated in a third place; declare runtime dependencies; remove the
  pyproject sed step from build_appimage.sh.
- MANIFEST.in: ship the resources/ directory only; stop packaging .ui
  sources and remove the stray mainwindow.ui.autosave.
- Ignore build/, dist/ and *.egg-info; update README wheel filename.
2026-09-15 14:26:13 +02:00

53 lines
1.3 KiB
Bash
Executable File

#!/bin/bash
# Step 1: Function to extract version from OneDriveGUI.py without importing
get_version() {
FILE_PATH="src/onedrive_gui/options.py"
VERSION=$(grep -Po '^version\s*=\s*"\K[^\"]+' "$FILE_PATH")
if [ -z "$VERSION" ]; then
echo "Failed to extract version from $FILE_PATH"
exit 1
fi
echo "Extracted version: $VERSION"
}
# Step 2: Update the indented version line in AppImageBuilder.yml
update_yaml() {
YAML_FILE="AppImageBuilder.yml"
if [ -f "$YAML_FILE" ]; then
echo "Updating version in $YAML_FILE..."
# Use sed to match the indented version line 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
build_appimage() {
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
}
# Main script execution
get_version
update_yaml
build_appimage