* update release #83
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 Linux (deb) Release | |
| on: | |
| push: | |
| branches: [ main ] | |
| workflow_dispatch: | |
| env: | |
| PICOCLAW_FLUTTER_BUILD_ARGS: >- | |
| --dart-define=PICOCLAW_ANALYTICS_PROVIDER=firebase | |
| --dart-define=PICOCLAW_FIREBASE_APP_ID=${{ secrets.PICOCLAW_FIREBASE_APP_ID }} | |
| --dart-define=PICOCLAW_FIREBASE_API_KEY=${{ secrets.PICOCLAW_FIREBASE_API_KEY }} | |
| --dart-define=PICOCLAW_FIREBASE_PROJECT_ID=${{ secrets.PICOCLAW_FIREBASE_PROJECT_ID }} | |
| --dart-define=PICOCLAW_FIREBASE_MESSAGING_SENDER_ID=${{ secrets.PICOCLAW_FIREBASE_MESSAGING_SENDER_ID }} | |
| --dart-define=PICOCLAW_UMENG_APP_KEY=${{ secrets.PICOCLAW_UMENG_APP_KEY }} | |
| --dart-define=PICOCLAW_UMENG_CHANNEL=${{ secrets.PICOCLAW_UMENG_CHANNEL }} | |
| jobs: | |
| build-linux-deb: | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Setup Flutter | |
| uses: subosito/flutter-action@v2 | |
| with: | |
| channel: 'stable' | |
| - name: Install Linux build dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y --no-install-recommends \ | |
| clang cmake ninja-build pkg-config build-essential \ | |
| libgtk-3-dev libwebkit2gtk-4.1-dev libayatana-appindicator3-dev \ | |
| lld binutils libstdc++-12-dev libglu1-mesa | |
| - name: Verify pkg-config modules | |
| run: | | |
| pkg-config --modversion webkit2gtk-4.1 || true | |
| pkg-config --modversion ayatana-appindicator3-0.1 || pkg-config --modversion appindicator3-0.1 || true | |
| - name: Cache pub | |
| uses: actions/cache@v5 | |
| with: | |
| path: | | |
| ~/.pub-cache | |
| key: ${{ runner.os }}-pub-${{ hashFiles('**/pubspec.yaml') }} | |
| - name: Flutter pub get | |
| run: flutter pub get | |
| - name: Fetch core and build Linux release | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| flutter pub run tools/fetch_core_local.dart --repo sipeed/picoclaw --tag latest --out-dir app/bin --platform linux --arch x86_64 --build-mode release --install-to-build || true | |
| flutter build linux --release $PICOCLAW_FLUTTER_BUILD_ARGS | |
| - name: Package Linux as .deb | |
| id: package | |
| run: | | |
| set -e | |
| PKG_NAME=picoclaw_fui | |
| TAG=$(date -u +%y%m%d)-$(git rev-parse --short=6 $GITHUB_SHA) | |
| DEST=${PKG_NAME}-${TAG}-linux-x86_64.deb | |
| PKGROOT=$PWD/pkg_root | |
| rm -rf "$PKGROOT" "$DEST" | |
| BUNDLE_DIR=build/linux/x64/release/bundle | |
| if [ ! -d "$BUNDLE_DIR" ]; then echo "Bundle not found: $BUNDLE_DIR"; ls -la build/linux || true; exit 1; fi | |
| mkdir -p "$PKGROOT/opt/${PKG_NAME}/${TAG}" | |
| cp -r "$BUNDLE_DIR"/* "$PKGROOT/opt/${PKG_NAME}/${TAG}/" | |
| # Include any fetched core binaries installed to app/bin | |
| if [ -d app/bin ]; then | |
| mkdir -p "$PKGROOT/opt/${PKG_NAME}/${TAG}/app/bin" | |
| cp -r app/bin/* "$PKGROOT/opt/${PKG_NAME}/${TAG}/app/bin/" || true | |
| fi | |
| mkdir -p "$PKGROOT/usr/bin" | |
| printf '%s\n' \ | |
| '#!/bin/sh' \ | |
| 'set -e' \ | |
| 'BASE=/opt/picoclaw_fui' \ | |
| 'if [ -d "$BASE" ]; then' \ | |
| ' DIRNAME=$(ls -1 "$BASE" 2>/dev/null | sort -V | tail -n1)' \ | |
| ' if [ -n "$DIRNAME" ] && [ -d "$BASE/$DIRNAME" ]; then' \ | |
| ' DIR="$BASE/$DIRNAME"' \ | |
| ' else' \ | |
| ' DIR="$BASE"' \ | |
| ' fi' \ | |
| 'else' \ | |
| ' DIR="$BASE"' \ | |
| 'fi' \ | |
| '# Ensure plugin/shared libs in the bundle are discoverable' \ | |
| 'cd "$DIR" || true' \ | |
| 'export BASE="$DIR"' \ | |
| 'export LD_LIBRARY_PATH="$DIR/lib:$DIR/plugins:$LD_LIBRARY_PATH"' \ | |
| 'exec "$DIR/picoclaw_flutter_ui" "$@"' > "$PKGROOT/usr/bin/${PKG_NAME}" | |
| chmod 0755 "$PKGROOT/usr/bin/${PKG_NAME}" | |
| mkdir -p "$PKGROOT/DEBIAN" | |
| mkdir -p "$PKGROOT/usr/share/icons/hicolor/128x128/apps" | |
| mkdir -p "$PKGROOT/usr/share/applications" | |
| if [ -f assets/app_icon.png ]; then | |
| cp assets/app_icon.png "$PKGROOT/usr/share/icons/hicolor/128x128/apps/picoclaw_fui.png" | |
| fi | |
| printf '%s\n' \ | |
| "[Desktop Entry]" \ | |
| "Name=PicoClaw FUI" \ | |
| "Exec=/usr/bin/picoclaw_fui %U" \ | |
| "Icon=picoclaw_fui" \ | |
| "Type=Application" \ | |
| "Categories=Utility;" \ | |
| "Terminal=false" > "$PKGROOT/usr/share/applications/picoclaw_fui.desktop" | |
| printf '%s\n' \ | |
| "Package: picoclaw-fui" \ | |
| "Version: ${TAG}" \ | |
| "Section: utils" \ | |
| "Priority: optional" \ | |
| "Architecture: amd64" \ | |
| "Maintainer: GitHub Actions <actions@github.com>" \ | |
| "Description: PicoClaw FUI" > "$PKGROOT/DEBIAN/control" | |
| if command -v gtk-update-icon-cache >/dev/null 2>&1; then | |
| gtk-update-icon-cache -f "$PKGROOT/usr/share/icons/hicolor" || true | |
| fi | |
| dpkg-deb --build "$PKGROOT" "$DEST" | |
| - name: Upload Linux .deb artifact | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: picoclaw_fui-${{ env.RELEASE_BASE }}-linux-x86_64.deb | |
| path: picoclaw_fui-${{ env.RELEASE_BASE }}-linux-x86_64.deb |