feat: add multi-platform packaging and auto-update infrastructure
- Add PyInstaller configuration (clide.spec) for cross-platform builds - Add build scripts for macOS (DMG), Linux (AppImage), and Windows (Inno Setup) - Add Gitea Actions CI/CD workflow for automated releases - Add auto-update service with Gitea API integration - Add 'clide update' CLI command for checking and installing updates Packaging outputs: - macOS: Signed/notarized .app bundle in DMG - Linux: Portable AppImage (glibc 2.17+) - Windows: Inno Setup installer Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.5
parent
8b1a84e7e2
commit
aff03a2e9b
Executable
+85
@@ -0,0 +1,85 @@
|
||||
#!/bin/bash
|
||||
# Build script for Linux AppImage distribution
|
||||
# Creates a portable AppImage that runs on most Linux distributions
|
||||
#
|
||||
# Prerequisites:
|
||||
# - wget (for downloading appimagetool)
|
||||
# - FUSE (for running appimagetool)
|
||||
#
|
||||
# Usage: ./scripts/build-linux.sh [VERSION]
|
||||
|
||||
set -e
|
||||
|
||||
VERSION="${1:-1.0.0}"
|
||||
ARCH=$(uname -m)
|
||||
|
||||
echo "========================================"
|
||||
echo "Building Clide $VERSION for Linux ($ARCH)"
|
||||
echo "========================================"
|
||||
|
||||
# Ensure we're in the project root
|
||||
cd "$(dirname "$0")/.."
|
||||
|
||||
# Build with PyInstaller
|
||||
echo "Building with PyInstaller..."
|
||||
pyinstaller clide.spec --clean --noconfirm
|
||||
|
||||
# Create AppDir structure
|
||||
echo "Creating AppDir structure..."
|
||||
rm -rf dist/Clide.AppDir
|
||||
mkdir -p dist/Clide.AppDir/usr/bin
|
||||
mkdir -p dist/Clide.AppDir/usr/share/applications
|
||||
mkdir -p dist/Clide.AppDir/usr/share/icons/hicolor/256x256/apps
|
||||
|
||||
# Copy binary
|
||||
cp dist/clide dist/Clide.AppDir/usr/bin/
|
||||
|
||||
# Copy desktop file
|
||||
cp packaging/clide.desktop dist/Clide.AppDir/
|
||||
cp packaging/clide.desktop dist/Clide.AppDir/usr/share/applications/
|
||||
|
||||
# Create placeholder icon (TODO: Replace with actual icon)
|
||||
# For now, create a simple placeholder
|
||||
if [ ! -f packaging/clide.png ]; then
|
||||
echo "Note: No icon found at packaging/clide.png, AppImage will have no icon"
|
||||
else
|
||||
cp packaging/clide.png dist/Clide.AppDir/clide.png
|
||||
cp packaging/clide.png dist/Clide.AppDir/usr/share/icons/hicolor/256x256/apps/clide.png
|
||||
fi
|
||||
|
||||
# Create AppRun launcher
|
||||
cat > dist/Clide.AppDir/AppRun << 'EOF'
|
||||
#!/bin/bash
|
||||
# AppRun - Entry point for AppImage
|
||||
SELF=$(readlink -f "$0")
|
||||
HERE=${SELF%/*}
|
||||
export PATH="${HERE}/usr/bin:${PATH}"
|
||||
export TERM="${TERM:-xterm-256color}"
|
||||
exec "${HERE}/usr/bin/clide" "$@"
|
||||
EOF
|
||||
chmod +x dist/Clide.AppDir/AppRun
|
||||
|
||||
# Download appimagetool if needed
|
||||
APPIMAGETOOL="appimagetool-${ARCH}.AppImage"
|
||||
if [ ! -f "$APPIMAGETOOL" ]; then
|
||||
echo "Downloading appimagetool..."
|
||||
wget -q "https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-${ARCH}.AppImage" \
|
||||
-O "$APPIMAGETOOL"
|
||||
chmod +x "$APPIMAGETOOL"
|
||||
fi
|
||||
|
||||
# Create AppImage
|
||||
echo "Creating AppImage..."
|
||||
rm -f "dist/Clide-$VERSION-linux-$ARCH.AppImage"
|
||||
ARCH=$ARCH ./"$APPIMAGETOOL" dist/Clide.AppDir "dist/Clide-$VERSION-linux-$ARCH.AppImage"
|
||||
|
||||
# Clean up AppDir
|
||||
rm -rf dist/Clide.AppDir
|
||||
|
||||
echo ""
|
||||
echo "========================================"
|
||||
echo "Build complete!"
|
||||
echo "Output: dist/Clide-$VERSION-linux-$ARCH.AppImage"
|
||||
echo ""
|
||||
echo "To run: chmod +x dist/Clide-$VERSION-linux-$ARCH.AppImage && ./dist/Clide-$VERSION-linux-$ARCH.AppImage"
|
||||
echo "========================================"
|
||||
Reference in New Issue
Block a user