From 1b368f3197506907b7d0415d857659a01c0dbb16 Mon Sep 17 00:00:00 2001 From: Charlie Garrison Date: Sat, 7 Dec 2024 13:09:09 +1100 Subject: [PATCH] Squashed commit of the following: commit 88dae4ea573d8dab70c3d856316dd27fe0ef7e68 Author: Charlie Garrison Date: Sat Dec 7 13:08:44 2024 +1100 main branch too commit 370e5c370f536414287773aeb33fe3aaf014cf36 Author: Charlie Garrison Date: Sat Dec 7 13:04:42 2024 +1100 Documented Windows and Linux release planning for Beyond Better DUI Applied changes from BB to 1 file Files modified: - docs/development/windows_linux_release_planning.md commit affa89ca32dd48d4102df6f3cd544d208439aedb Author: Charlie Garrison Date: Sat Dec 7 13:04:18 2024 +1100 Added macOS entitlements configuration to Tauri config Applied changes from BB to 1 file Files modified: - dui/src-tauri/tauri.conf.json commit 05e156ae5c3b6f9e3b54eced4ea152033e84d9ab Author: Charlie Garrison Date: Sat Dec 7 13:04:12 2024 +1100 Added entitlements for macOS app to enable file access, network access, executing user-selected binaries, and running JIT-compiled code. Applied changes from BB to 1 file Files modified: - dui/src-tauri/macos/entitlements.plist commit 4d78360289f555e5c3e7b987914dadaf05da4e68 Author: Charlie Garrison Date: Sat Dec 7 13:04:01 2024 +1100 docs: Add macOS release process documentation Applied changes from BB to 1 file Files modified: - docs/development/macos_release_process.md commit 9c68a1a061a8ba7e55c83c3927e777b293451cca Author: Charlie Garrison Date: Sat Dec 7 13:01:36 2024 +1100 Updated the macOS release workflow to build and release DUI for both Apple Silicon and Intel architectures. Applied changes from BB to 1 file Files modified: - .github/workflows/dui-macos-release.yml commit 998763a0aa9e6939252cda51d8b7f0cd9f413728 Author: Charlie Garrison Date: Sat Dec 7 13:01:01 2024 +1100 Updated Tauri configuration with new product name, version, and build settings Applied changes from BB to 1 file Files modified: - dui/src-tauri/tauri.conf.json commit a152b115f444e94d271a18a81439be02f29ecf14 Author: Charlie Garrison Date: Sat Dec 7 13:00:32 2024 +1100 Added macOS release workflow for DUI Applied changes from BB to 1 file Files modified: - .github/workflows/dui-macos-release.yml commit 120e3f40283193f8890048bf2d37a7ecb85f5164 Author: Charlie Garrison Date: Sat Dec 7 13:00:11 2024 +1100 Updated tauri.conf.json with new product name, version, and build configuration. Applied changes from BB to 1 file Files modified: - dui/src-tauri/tauri.conf.json commit 20f15df3a1815a01faa223444f29912f65b6b1c3 Author: Charlie Garrison Date: Sat Dec 7 12:58:29 2024 +1100 Updated Tauri configuration with new product name and version Applied changes from BB to 1 file Files modified: - dui/src-tauri/tauri.conf.json commit cbf76c4ee4604ccdbd50638a39580f1629b5898b Author: Charlie Garrison Date: Sat Dec 7 12:58:16 2024 +1100 Updated localization strings for Beyond Better DUI installer Applied changes from BB to 1 file Files modified: - dui/src-tauri/windows/locales/en-US.wxl commit 4fc6c8aaa4af41479e93c159e569e0c43e77e517 Author: Charlie Garrison Date: Sat Dec 7 12:57:58 2024 +1100 Updated tauri.conf.json with product name, version, and build configuration. Applied changes from BB to 1 file Files modified: - dui/src-tauri/tauri.conf.json commit fea85b52082e2ae8e64b1374ad863e9b58d00018 Author: Charlie Garrison Date: Sat Dec 7 12:55:45 2024 +1100 Updated Tauri configuration with new product name, version, and build settings. Applied changes from BB to 1 file Files modified: - dui/src-tauri/tauri.conf.json commit beb3f8655a8743f510b68fb5898b8fcff5644fbb Author: Charlie Garrison Date: Sat Dec 7 12:55:02 2024 +1100 Updated tauri.conf.json with version 0.4.1 and build configuration Applied changes from BB to 1 file Files modified: - dui/src-tauri/tauri.conf.json commit b5c15f2e0003788c90e52ce427df4463dc49829a Author: Charlie Garrison Date: Sat Dec 7 12:54:21 2024 +1100 Updated Tauri configuration with new product name, version, and build settings. Applied changes from BB to 1 file Files modified: - dui/src-tauri/tauri.conf.json commit b8b566d832422c01030c84bef0c5052027f2bfd6 Author: Charlie Garrison Date: Sat Dec 7 12:53:07 2024 +1100 Updated tauri.conf.json with new product name and version Applied changes from BB to 1 file Files modified: - dui/src-tauri/tauri.conf.json commit 98f60f72f2219e8a4ccd7edae82d9e7446585706 Author: Charlie Garrison Date: Sat Dec 7 12:52:48 2024 +1100 Simplified Windows installer configuration in tauri.conf.json Applied changes from BB to 1 file Files modified: - dui/src-tauri/tauri.conf.json commit 211a8e50c813d1c0a9034bc478c8ce2d111c135a Author: Charlie Garrison Date: Sat Dec 7 12:51:11 2024 +1100 Updated the DUI release workflow to build and publish releases for multiple platforms. Applied changes from BB to 1 file Files modified: - .github/workflows/dui-release.yml commit 596780eec5961bb3478b815a7c5a06c1f4e83cbe Author: Charlie Garrison Date: Sat Dec 7 12:50:54 2024 +1100 Added registry fragment and component references to tauri.conf.json Applied changes from BB to 1 file Files modified: - dui/src-tauri/tauri.conf.json commit c9b47cfc2b476d803082d8709d821ddd20c924fb Author: Charlie Garrison Date: Sat Dec 7 12:50:36 2024 +1100 Added registry entries for application registration, information, and first-run path update. Applied changes from BB to 1 file Files modified: - dui/src-tauri/windows/fragments/registry.wxs commit 91070f6af2dfa486d932082224cfe7154e4bad14 Author: Charlie Garrison Date: Sat Dec 7 12:39:08 2024 +1100 deploy config for v2 --- .github/workflows/deploy.yml | 28 +-- .github/workflows/dui-macos-release.yml | 183 ++++++++++++++++ docs/development/macos_release_process.md | 95 ++++++++ .../windows_linux_release_planning.md | 203 ++++++++++++++++++ dui/src-tauri/macos/entitlements.plist | 37 ++++ dui/src-tauri/tauri.conf.json | 23 +- dui/src-tauri/windows/fragments/registry.wxs | 32 +++ dui/src-tauri/windows/locales/en-US.wxl | 17 ++ 8 files changed, 602 insertions(+), 16 deletions(-) create mode 100644 .github/workflows/dui-macos-release.yml create mode 100644 docs/development/macos_release_process.md create mode 100644 docs/development/windows_linux_release_planning.md create mode 100644 dui/src-tauri/macos/entitlements.plist create mode 100644 dui/src-tauri/windows/fragments/registry.wxs create mode 100644 dui/src-tauri/windows/locales/en-US.wxl diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 3f4c33d..3f5c25a 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -22,32 +22,32 @@ jobs: run: | mkdir -p .bb cat << EOF > .bb/config.yaml + version: 2.0.0 myPersonsName: bb myAssistantsName: Claude noBrowser: false + bbExeName: bb + bbApiExeName: bb-api api: environment: local - apiHostname: localhost - apiPort: 3000 - apiUseTls: false + hostname: localhost + port: 3162 ignoreLLMRequestCache: false usePromptCaching: true + tls: + useTls: false logFile: api.log logLevel: info - anthropicApiKey: >- - sk-not-a-valid-key-not-a-valid-key-not-a-valid-key-not-a-valid-key-not-a-valid-key + llmKeys: + anthropic: >- + sk-not-a-valid-key-not-a-valid-key-not-a-valid-key-not-a-valid-key-not-a-valid-key bui: environment: local - buiHostname: localhost - buiPort: 8000 - buiUseTls: false + hostname: localhost + port: 8000 + tls: + useTls: false cli: {} - repoInfo: - ctagsAutoGenerate: false - tokenLimit: 1024 - project: - name: bb - type: git EOF - name: Build site diff --git a/.github/workflows/dui-macos-release.yml b/.github/workflows/dui-macos-release.yml new file mode 100644 index 0000000..3471fde --- /dev/null +++ b/.github/workflows/dui-macos-release.yml @@ -0,0 +1,183 @@ +name: "DUI macOS Release" + +on: + push: + branches: ["main","release-build-testing"] + workflow_dispatch: + inputs: + version: + description: 'Version to release' + required: true + default: '0.0.0' + +jobs: + build-macos: + permissions: + contents: write + strategy: + fail-fast: false + matrix: + include: + - target: "aarch64-apple-darwin" + arch: "aarch64" + name: "Apple Silicon" + - target: "x86_64-apple-darwin" + arch: "x86_64" + name: "Intel" + runs-on: macos-latest + steps: + - uses: actions/checkout@v4 + + - name: Setup Deno + uses: denoland/setup-deno@v1 + with: + deno-version: v2.x + + - name: Install Rust stable + uses: dtolnay/rust-toolchain@stable + with: + targets: ${{ matrix.target }} + + - name: Rust cache + uses: swatinem/rust-cache@v2 + with: + workspaces: './dui/src-tauri -> target' + + - name: Install frontend dependencies + run: | + cd dui + deno task build + + - name: Build DUI (Tauri) + uses: tauri-apps/tauri-action@v0 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + projectPath: './dui' + args: --target ${{ matrix.target }} + + # Verify build artifacts exist + - name: Verify build artifacts + id: verify_artifacts + run: | + DMG_COUNT=$(find dui/src-tauri/target/${{ matrix.target }}/release/bundle/dmg -name "*.dmg" | wc -l) + APP_COUNT=$(find dui/src-tauri/target/${{ matrix.target }}/release/bundle/macos -name "*.app" | wc -l) + if [ "$DMG_COUNT" -eq 0 ] || [ "$APP_COUNT" -eq 0 ]; then + echo "::error::Missing build artifacts for ${{ matrix.name }} (${{ matrix.target }})" + exit 1 + fi + echo "Found $DMG_COUNT .dmg and $APP_COUNT .app files" + + # Upload artifacts for both architectures + - name: Upload artifacts + uses: actions/upload-artifact@v4 + with: + name: dui-macos-${{ matrix.arch }} + path: | + dui/src-tauri/target/${{ matrix.target }}/release/bundle/dmg/*.dmg + dui/src-tauri/target/${{ matrix.target }}/release/bundle/macos/*.app + + # Create release with all artifacts + release: + needs: build-macos + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Get version from config + id: get_version + run: | + CONFIG_VERSION=$(cat dui/src-tauri/tauri.conf.json | jq -r .version) + echo "CONFIG_VERSION=$CONFIG_VERSION" >> $GITHUB_OUTPUT + + # If triggered by workflow_dispatch, verify version matches + if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then + if [[ "$CONFIG_VERSION" != "${{ github.event.inputs.version }}" ]]; then + echo "::error::Version mismatch: $CONFIG_VERSION (config) != ${{ github.event.inputs.version }} (input)" + exit 1 + fi + fi + + - name: Download all artifacts + uses: actions/download-artifact@v4 + + - name: Create Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: dui-v${{ steps.get_version.outputs.CONFIG_VERSION }} + release_name: "Beyond Better DUI v${{ steps.get_version.outputs.CONFIG_VERSION }}" + body: | + Beyond Better DUI v${{ steps.get_version.outputs.CONFIG_VERSION }} + + This release includes: + - macOS .app bundles: + * Apple Silicon (M1/M2) version + * Intel version + - macOS disk images (.dmg): + * Apple Silicon (M1/M2) version + * Intel version + + Installation: + 1. Download the appropriate version for your Mac + 2. Open the .dmg file + 3. Drag the Beyond Better app to your Applications folder + draft: true + prerelease: false + + - name: Upload Release Assets + run: | + # Function to handle upload with retry + upload_asset() { + local file="$1" + local attempt=1 + local max_attempts=3 + + while [ $attempt -le $max_attempts ]; do + echo "Uploading $file (attempt $attempt of $max_attempts)" + if gh release upload "dui-v${{ steps.get_version.outputs.CONFIG_VERSION }}" "$file"; then + return 0 + fi + attempt=$((attempt + 1)) + if [ $attempt -le $max_attempts ]; then + echo "Retrying in 5 seconds..." + sleep 5 + fi + done + + echo "::error::Failed to upload $file after $max_attempts attempts" + return 1 + } + + for arch in x86_64 aarch64; do + case $arch in + "x86_64") arch_name="intel" ;; + "aarch64") arch_name="apple-silicon" ;; + esac + + cd "dui-macos-$arch" + + # Upload DMG files + for f in *.dmg; do + if [ -f "$f" ]; then + new_name="BB-dui-${{ steps.get_version.outputs.CONFIG_VERSION }}-macos-$arch_name.dmg" + cp "$f" "../$new_name" + upload_asset "../$new_name" + fi + done + + # Create and upload app archive + for app in *.app; do + if [ -d "$app" ]; then + new_name="BB-dui-${{ steps.get_version.outputs.CONFIG_VERSION }}-macos-$arch_name.app.tar.gz" + tar -czf "../$new_name" "$app" + upload_asset "../$new_name" + fi + done + + cd .. + done + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/docs/development/macos_release_process.md b/docs/development/macos_release_process.md new file mode 100644 index 0000000..9258acd --- /dev/null +++ b/docs/development/macos_release_process.md @@ -0,0 +1,95 @@ +# macOS Release Process + +This document describes the process for building and releasing the Beyond Better DUI for macOS. + +## Overview + +The DUI (Desktop User Interface) is built using Tauri and supports both Intel (x86_64) and Apple Silicon (aarch64) architectures. The release process is automated through GitHub Actions. + +## Release Assets + +Each release includes: +- `.app` bundles (archived as `.tar.gz`) + * Intel (x86_64) version + * Apple Silicon (aarch64) version +- `.dmg` disk images + * Intel (x86_64) version + * Apple Silicon (aarch64) version + +## Build Configuration + +The build configuration is defined in `dui/src-tauri/tauri.conf.json` and includes: +- DMG installer window layout +- Minimum macOS version (10.13) +- Required entitlements +- Icon configurations + +## Release Process + +### Automated Release (GitHub Actions) + +1. Trigger a release by either: + - Pushing to the `release` branch + - Using the "DUI macOS Release" workflow manually with a version number + +2. The workflow will: + - Build for both Intel and Apple Silicon + - Create `.app` bundles and `.dmg` installers + - Create a draft release + - Upload all assets with architecture-specific names + +### Manual Release Steps + +If needed, you can build locally using: +```bash +cd dui +# For Intel Macs +deno task tauri build --target x86_64-apple-darwin + +# For Apple Silicon Macs +deno task tauri build --target aarch64-apple-darwin +``` + +## Asset Naming Convention + +Release assets follow this naming pattern: +- `BB-dui-{version}-macos-intel.dmg` +- `BB-dui-{version}-macos-intel.app.tar.gz` +- `BB-dui-{version}-macos-apple-silicon.dmg` +- `BB-dui-{version}-macos-apple-silicon.app.tar.gz` + +## Version Management + +- The version number is managed in `dui/src-tauri/tauri.conf.json` +- When using manual workflow triggers, the input version must match the config +- Git tags are created in the format `dui-v{version}` + +## Requirements + +### Build Environment +- macOS machine (for local builds) +- Xcode Command Line Tools +- Rust with appropriate targets +- Deno + +### Signing and Notarization +- Apple Developer account (for future signing implementation) +- Developer certificate +- App-specific password for notarization + +## Future Enhancements + +1. Code Signing + - Implementation pending Apple Developer account + - Will require additional workflow secrets + - Will enable notarization + +2. Notarization + - To be implemented after signing + - Required for distribution outside App Store + - Will add additional build time + +3. App Store Distribution + - Future consideration + - Will require additional configuration + - Separate distribution process \ No newline at end of file diff --git a/docs/development/windows_linux_release_planning.md b/docs/development/windows_linux_release_planning.md new file mode 100644 index 0000000..c26e81d --- /dev/null +++ b/docs/development/windows_linux_release_planning.md @@ -0,0 +1,203 @@ +# Windows and Linux Release Planning + +This document outlines the planned implementation for Windows and Linux releases of the Beyond Better DUI. + +## Windows Release Plan + +### Phase 1: Basic MSI Installer +1. Configuration Requirements: + - WiX Toolset integration + - Registry entries for: + * Application registration + * Installation path tracking + * First-run configuration + - WebView2 bootstrapper (embedded) + - Per-machine installation in Program Files + - Standard uninstaller integration + +2. Build Environment: + - GitHub Actions Windows runner + - WiX Toolset v3 + - Rust with MSVC target + - Required system dependencies + +3. Release Assets: + - MSI installer for x64 systems + - Support for both per-user and per-machine installation + - Automated binary download on first run + +### Phase 2: Enhanced Windows Integration +1. Features: + - Windows "Apps & Features" integration + - Start menu shortcuts + - Optional desktop shortcut + - Protocol handler registration + - File association setup (if needed) + +2. User Experience: + - Silent installation option + - Custom installation directory option + - Progress indicators for binary downloads + - Proper elevation requests + +3. Updates: + - Auto-update support + - Delta updates if possible + - Update notification system + +## Linux Release Plan + +### Phase 1: AppImage Support +1. Configuration: + - Basic AppImage bundling + - Desktop entry integration + - Icon integration + - MIME type handling + +2. Build Requirements: + - GitHub Actions Ubuntu runner + - AppImage tooling + - Required system libraries + - Build matrix for architectures: + * x86_64 + * aarch64 (if supported) + +3. Release Assets: + - AppImage files + - SHA256 checksums + - GPG signatures (future) + +### Phase 2: Distribution Packages +1. Debian/Ubuntu (.deb): + - Package configuration + - Dependencies management + - Post-install scripts + - Repository setup (future) + +2. Red Hat/Fedora (.rpm): + - Package configuration + - Dependencies handling + - Post-install scripts + - Repository setup (future) + +3. Other Distributions: + - Arch Linux (AUR) + - Flatpak consideration + - Snap consideration + +## Common Requirements + +### Security Considerations +1. Windows: + - Code signing + - SmartScreen reputation + - Anti-virus compatibility + +2. Linux: + - Package signing + - Repository security + - Sandboxing options + +### Automation Requirements +1. Build Process: + - Separate workflows per platform + - Dependency caching + - Build artifacts validation + - Version consistency checks + +2. Testing: + - Installation testing + - Upgrade path testing + - Uninstallation testing + - Integration tests + +3. Release Process: + - Automated asset uploading + - Release notes generation + - Changelog management + - Version tracking + +### Documentation Needs +1. Installation Guides: + - Windows installation steps + - Linux distribution-specific guides + - Troubleshooting guides + +2. Build Documentation: + - Build environment setup + - Local build instructions + - Release process documentation + +3. Development Guides: + - Platform-specific considerations + - Testing requirements + - Release checklist + +## Implementation Priorities + +1. Windows MSI Installer: + - Basic installation functionality + - Registry integration + - Binary management + +2. AppImage Support: + - Basic functionality + - Desktop integration + - Binary management + +3. Enhanced Windows Features: + - Full system integration + - Update system + - User experience improvements + +4. Distribution Packages: + - Debian packages + - RPM packages + - Repository setup + +## Timeline Considerations + +- Phase 1 (Windows): 2-3 weeks +- Phase 1 (Linux/AppImage): 1-2 weeks +- Phase 2 (Windows): 2-3 weeks +- Phase 2 (Linux/Packages): 2-3 weeks + +Total estimated timeline: 7-11 weeks + +## Dependencies and Prerequisites + +1. Windows: + - WiX Toolset knowledge + - Windows installer experience + - Code signing certificate + +2. Linux: + - Package maintenance experience + - Repository management + - Build system knowledge + +## Risk Factors + +1. Windows: + - SmartScreen reputation building + - Anti-virus false positives + - WebView2 installation issues + +2. Linux: + - Distribution differences + - Dependency management + - Repository maintenance + +## Success Criteria + +1. Windows: + - Silent installation support + - Clean uninstallation + - Proper system integration + - Efficient binary management + +2. Linux: + - Distribution package standards + - Clean package management + - Desktop environment integration + - Efficient binary management \ No newline at end of file diff --git a/dui/src-tauri/macos/entitlements.plist b/dui/src-tauri/macos/entitlements.plist new file mode 100644 index 0000000..db4533c --- /dev/null +++ b/dui/src-tauri/macos/entitlements.plist @@ -0,0 +1,37 @@ + + + + + + com.apple.security.files.user-selected.read-write + + + + com.apple.security.network.client + + + + com.apple.security.network.server + + + + com.apple.security.files.downloads.read-write + + + + com.apple.security.cs.allow-unsigned-executable-memory + + + + com.apple.security.cs.allow-jit + + + + com.apple.security.cs.disable-library-validation + + + + com.apple.security.cs.allow-dyld-environment-variables + + + \ No newline at end of file diff --git a/dui/src-tauri/tauri.conf.json b/dui/src-tauri/tauri.conf.json index e8823b7..b627e09 100644 --- a/dui/src-tauri/tauri.conf.json +++ b/dui/src-tauri/tauri.conf.json @@ -23,7 +23,26 @@ }, "bundle": { "active": true, - "targets": "all", + "targets": ["app", "dmg"], + "macOS": { + "frameworks": [], + "minimumSystemVersion": "10.13", + "entitlements": "macos/entitlements.plist", + "dmg": { + "windowSize": { + "width": 660, + "height": 400 + }, + "appPosition": { + "x": 180, + "y": 170 + }, + "applicationFolderPosition": { + "x": 480, + "y": 170 + } + } + }, "icon": [ "icons/32x32.png", "icons/128x128.png", @@ -32,4 +51,4 @@ "icons/icon.ico" ] } -} +} \ No newline at end of file diff --git a/dui/src-tauri/windows/fragments/registry.wxs b/dui/src-tauri/windows/fragments/registry.wxs new file mode 100644 index 0000000..be11432 --- /dev/null +++ b/dui/src-tauri/windows/fragments/registry.wxs @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/dui/src-tauri/windows/locales/en-US.wxl b/dui/src-tauri/windows/locales/en-US.wxl new file mode 100644 index 0000000..d995c02 --- /dev/null +++ b/dui/src-tauri/windows/locales/en-US.wxl @@ -0,0 +1,17 @@ + + + Launch Beyond Better DUI + A newer version of Beyond Better DUI is already installed. + Add Beyond Better DUI to the system PATH + Install Beyond Better DUI + Install BB binaries + Choose the folder in which to install Beyond Better DUI. + Installation Folder + Install Beyond Better DUI to: + Welcome to the Beyond Better DUI Setup Wizard + This wizard will guide you through the installation of Beyond Better DUI, a desktop manager for the BB AI assistant. + Beyond Better DUI Installation Complete + The installation was completed successfully. + Beyond Better DUI Installation Cancelled + Setup was interrupted. Your system has not been modified. + \ No newline at end of file