Add position drift monitoring and re-application for Linux #27
This file contains hidden or 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
| name: Build SimpleAI (Linux Only) | |
| permissions: | |
| contents: write | |
| on: | |
| push: | |
| branches: | |
| - "**" # prerelease builds on every push | |
| tags: | |
| - "v*" # full releases on version tags | |
| workflow_dispatch: | |
| jobs: | |
| build-linux: | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Install Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: "1.22" | |
| check-latest: false | |
| - name: Install Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "20" | |
| - name: Install Linux dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y build-essential libgtk-3-dev libwebkit2gtk-4.0-dev fuse libfuse2 file imagemagick | |
| wget -O /tmp/appimagetool https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage | |
| chmod +x /tmp/appimagetool | |
| - name: Install Wails | |
| timeout-minutes: 15 | |
| env: | |
| GOFLAGS: "-v" | |
| GOTOOLCHAIN: "local" | |
| run: go install -v github.com/wailsapp/wails/v2/cmd/wails@latest | |
| - name: Build Wails app | |
| run: | | |
| VERSION=$(jq -r '.info.productVersion' wails.json).PRE | |
| wails build -clean -ldflags "-X main.Version=$VERSION" | |
| - name: Create AppImage | |
| run: | | |
| VERSION=$(jq -r '.info.productVersion' wails.json).PRE | |
| # Create AppDir structure | |
| mkdir -p AppDir/usr/{bin,share/{applications,metainfo,icons/hicolor/{256x256,128x128,64x64,48x48}/apps}} | |
| # Copy binary | |
| cp build/bin/SimpleAI AppDir/usr/bin/ | |
| # Resize and copy icons | |
| for size in 256 128 64 48; do | |
| convert build/appicon.png -resize ${size}x${size} AppDir/usr/share/icons/hicolor/${size}x${size}/apps/simpleai.png | |
| done | |
| # Copy icon to AppImage root | |
| cp AppDir/usr/share/icons/hicolor/256x256/apps/simpleai.png AppDir/simpleai.png | |
| cp AppDir/simpleai.png AppDir/.DirIcon | |
| # Create AppStream metadata (removes build warning and helps software centers) | |
| cat > AppDir/usr/share/metainfo/io.lepthien.SimpleAI.appdata.xml << 'EOF' | |
| <?xml version="1.0" encoding="UTF-8"?> | |
| <component type="desktop-application"> | |
| <id>io.lepthien.SimpleAI</id> | |
| <metadata_license>CC0-1.0</metadata_license> | |
| <project_license>AGPL-3.0-or-later</project_license> | |
| <name>SimpleAI</name> | |
| <summary>Lightweight desktop launcher for AI chatbot services</summary> | |
| <description> | |
| <p>SimpleAI provides quick access to popular AI chatbot services in standalone windows.</p> | |
| <p>Supported services: ChatGPT, Claude, Copilot, Deepseek, Gemini, Grok, Meta AI, and Perplexity.</p> | |
| </description> | |
| <developer_name>Christian Lepthien</developer_name> | |
| <url type="homepage">https://github.com/chrilep/SimpleAI</url> | |
| <url type="bugtracker">https://github.com/chrilep/SimpleAI/issues</url> | |
| <categories> | |
| <category>Network</category> | |
| <category>Utility</category> | |
| </categories> | |
| <releases> | |
| <release version="VERSION_PLACEHOLDER" date="2026-01-23"/> | |
| </releases> | |
| </component> | |
| EOF | |
| # Insert actual version | |
| sed -i "s/VERSION_PLACEHOLDER/$VERSION/" AppDir/usr/share/metainfo/io.lepthien.SimpleAI.appdata.xml | |
| # Create desktop file | |
| cat > AppDir/SimpleAI.desktop << 'EOF' | |
| [Desktop Entry] | |
| Version=1.0 | |
| Type=Application | |
| Name=SimpleAI | |
| GenericName=AI Chatbot Launcher | |
| Comment=Quick access to ChatGPT, Claude, Gemini and other AI services | |
| Exec=SimpleAI %U | |
| Icon=simpleai | |
| Terminal=false | |
| Categories=Network;Utility;Chat; | |
| Keywords=AI;ChatGPT;Claude;Gemini;Copilot;DeepSeek;Grok;Perplexity; | |
| StartupNotify=true | |
| StartupWMClass=SimpleAI | |
| EOF | |
| cp AppDir/SimpleAI.desktop AppDir/usr/share/applications/ | |
| # Create integration script for manual system integration | |
| cat > AppDir/integrate.sh << 'EOF' | |
| #!/bin/bash | |
| # SimpleAI System Integration Script | |
| # Usage: ./integrate.sh /path/to/SimpleAI.AppImage | |
| # Run this to add SimpleAI to your application menu with icon | |
| if [ $# -eq 0 ]; then | |
| echo "Error: Please provide the path to SimpleAI.AppImage" | |
| echo "Usage: $0 /path/to/SimpleAI.AppImage" | |
| exit 1 | |
| fi | |
| APPIMAGE_PATH="$(readlink -f "$1")" | |
| if [ ! -f "$APPIMAGE_PATH" ]; then | |
| echo "Error: AppImage not found at: $APPIMAGE_PATH" | |
| exit 1 | |
| fi | |
| echo "Installing SimpleAI to system menu..." | |
| echo "AppImage location: $APPIMAGE_PATH" | |
| # Copy desktop file | |
| mkdir -p ~/.local/share/applications | |
| cp usr/share/applications/SimpleAI.desktop ~/.local/share/applications/ | |
| sed -i "s|Exec=SimpleAI|Exec=$APPIMAGE_PATH|" ~/.local/share/applications/SimpleAI.desktop | |
| # Copy icons | |
| for size in 256 128 64 48; do | |
| mkdir -p ~/.local/share/icons/hicolor/${size}x${size}/apps | |
| cp usr/share/icons/hicolor/${size}x${size}/apps/simpleai.png ~/.local/share/icons/hicolor/${size}x${size}/apps/ | |
| done | |
| # Update icon cache | |
| if command -v gtk-update-icon-cache &> /dev/null; then | |
| gtk-update-icon-cache ~/.local/share/icons/hicolor/ -f 2>/dev/null || true | |
| fi | |
| # Update desktop database | |
| if command -v update-desktop-database &> /dev/null; then | |
| update-desktop-database ~/.local/share/applications/ 2>/dev/null || true | |
| fi | |
| echo "✓ Integration complete!" | |
| echo "SimpleAI should now appear in your application menu." | |
| echo "" | |
| echo "To uninstall:" | |
| echo " rm ~/.local/share/applications/SimpleAI.desktop" | |
| echo " rm ~/.local/share/icons/hicolor/*/apps/simpleai.png" | |
| EOF | |
| chmod +x AppDir/integrate.sh | |
| # Create AppRun script | |
| cat > AppDir/AppRun << 'EOF' | |
| #!/bin/bash | |
| SELF=$(readlink -f "$0") | |
| HERE=${SELF%/*} | |
| export PATH="${HERE}/usr/bin:${PATH}" | |
| export LD_LIBRARY_PATH="${HERE}/usr/lib:${LD_LIBRARY_PATH}" | |
| exec "${HERE}/usr/bin/SimpleAI" "$@" | |
| EOF | |
| chmod +x AppDir/AppRun | |
| # Build AppImage | |
| ARCH=x86_64 /tmp/appimagetool AppDir "build/bin/SimpleAI.AppImage" | |
| - name: Upload Prerelease AppImage | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: SimpleAI-linux | |
| path: "build/bin/SimpleAI.AppImage" | |
| - name: Publish into repo | |
| if: github.ref_type == 'branch' | |
| run: | | |
| VERSION=$(jq -r '.info.productVersion' wails.json).PRE | |
| git config user.name "github-actions" | |
| git config user.email "github-actions@github.com" | |
| mkdir -p automated-prereleases | |
| cp build/bin/SimpleAI.AppImage automated-prereleases/ | |
| git add automated-prereleases/SimpleAI.AppImage | |
| git commit -m "Update Linux prerelease $VERSION" | |
| git pull --rebase --autostash | |
| git push |