|
| 1 | +# GitHub Actions Release Workflow Fix Implementation Plan |
| 2 | + |
| 3 | +## Problem Statement |
| 4 | +The GitHub Actions release workflows are failing across multiple platforms (Linux, macOS, Windows) preventing successful builds and releases. The issues include: |
| 5 | +- 1Password CLI installation failures on Windows |
| 6 | +- Svelte/Vite build errors in the Tauri desktop app |
| 7 | +- Docker multi-architecture build failures |
| 8 | +- Cross-compilation issues for different architectures |
| 9 | +- Missing or incorrect configuration for Debian package builds |
| 10 | + |
| 11 | +## Current State Analysis |
| 12 | + |
| 13 | +### Failed Workflows |
| 14 | +1. **publish-tauri.yml** (Last run: 19119603861) |
| 15 | + - Windows: 1Password CLI installation fails with "No such file or directory" |
| 16 | + - Ubuntu/macOS: Svelte build fails with CSS identifier error in `node_modules/svelma/src/components/Tooltip.svelte` |
| 17 | + |
| 18 | +2. **release-comprehensive.yml** (Last run: 19078632924) |
| 19 | + - Windows: PowerShell parser error during Rust installation |
| 20 | + - Ubuntu 22.04: yarn cache dependency resolution failure |
| 21 | + - Docker 24.04: Missing `/desktop/yarn.lock` file |
| 22 | + |
| 23 | +### Project Structure |
| 24 | +- **Main workspace**: `/Users/alex/projects/terraphim/terraphim-ai/Cargo.toml` |
| 25 | +- **Server binary**: `terraphim_server` (path: `terraphim_server/`) |
| 26 | +- **TUI binary**: `terraphim_tui` (path: `crates/terraphim_tui/`) |
| 27 | +- **Desktop app**: `terraphim-ai-desktop` (path: `desktop/src-tauri/`) |
| 28 | +- **Docker builds**: Multi-arch support for Ubuntu 18.04, 20.04, 22.04, 24.04 |
| 29 | + |
| 30 | +## Proposed Changes |
| 31 | + |
| 32 | +### 1. Fix 1Password CLI Installation (publish-tauri.yml) |
| 33 | +**File**: `.github/workflows/publish-tauri.yml` |
| 34 | +```yaml |
| 35 | +# Line 30-31: Fix the 1Password CLI action version |
| 36 | +- name: Install 1Password CLI |
| 37 | + uses: 1password/install-cli-action@v1.1.0 # Use specific version |
| 38 | +``` |
| 39 | +
|
| 40 | +### 2. Fix Svelte Build Errors |
| 41 | +**File**: `desktop/package.json` |
| 42 | +- Update or patch the `svelma` dependency causing CSS parsing errors |
| 43 | +- Consider using a fork or different UI library if the issue persists |
| 44 | +- Add build error handling to continue despite warnings |
| 45 | + |
| 46 | +### 3. Fix Docker Build (Dockerfile.multiarch) |
| 47 | +**File**: `docker/Dockerfile.multiarch` |
| 48 | +```dockerfile |
| 49 | +# Line 14: Fix yarn.lock copy path |
| 50 | +COPY desktop/package.json desktop/yarn.lock* ./ |
| 51 | +# Use optional copy or create empty file if missing |
| 52 | +``` |
| 53 | + |
| 54 | +### 4. Add Cross-Compilation Configuration |
| 55 | +**File**: Create `Cross.toml` in project root |
| 56 | +```toml |
| 57 | +[build] |
| 58 | +default-target = "x86_64-unknown-linux-gnu" |
| 59 | +
|
| 60 | +[target.x86_64-unknown-linux-musl] |
| 61 | +image = "ghcr.io/cross-rs/x86_64-unknown-linux-musl:latest" |
| 62 | +
|
| 63 | +[target.aarch64-unknown-linux-musl] |
| 64 | +image = "ghcr.io/cross-rs/aarch64-unknown-linux-musl:latest" |
| 65 | +
|
| 66 | +[target.armv7-unknown-linux-musleabihf] |
| 67 | +image = "ghcr.io/cross-rs/armv7-unknown-linux-musleabihf:latest" |
| 68 | +``` |
| 69 | + |
| 70 | +### 5. Fix Windows Build Issues (release-comprehensive.yml) |
| 71 | +**File**: `.github/workflows/release-comprehensive.yml` |
| 72 | +```yaml |
| 73 | +# Lines 83-88: Fix Windows artifact preparation |
| 74 | +- name: Prepare artifacts (Windows) |
| 75 | + if: matrix.os == 'windows-latest' |
| 76 | + shell: bash # Use bash instead of default PowerShell |
| 77 | + run: | |
| 78 | + mkdir -p artifacts |
| 79 | + cp target/${{ matrix.target }}/release/terraphim_server.exe artifacts/terraphim_server-${{ matrix.target }}.exe |
| 80 | + cp target/${{ matrix.target }}/release/terraphim-tui.exe artifacts/terraphim-tui-${{ matrix.target }}.exe |
| 81 | +``` |
| 82 | + |
| 83 | +### 6. Update GitHub Actions Dependencies |
| 84 | +**File**: All workflow files |
| 85 | +- Update `actions/checkout@v5` → `actions/checkout@v4` (stable) |
| 86 | +- Update `actions/upload-artifact@v5` → `actions/upload-artifact@v4` (stable) |
| 87 | +- Update `actions/download-artifact@v4` (already correct) |
| 88 | +- Replace deprecated `actions-rs/toolchain@v1` with `dtolnay/rust-toolchain@stable` |
| 89 | + |
| 90 | +### 7. Fix Tauri Build Configuration (tauri-build.yml) |
| 91 | +**File**: `.github/workflows/tauri-build.yml` |
| 92 | +```yaml |
| 93 | +# Line 63: Fix Ubuntu 20.04 webkit package |
| 94 | +- platform: ubuntu-20.04 |
| 95 | + webkit-package: "libwebkit2gtk-4.0-dev" # Ensure correct package for Ubuntu 20.04 |
| 96 | +``` |
| 97 | + |
| 98 | +### 8. Add Workflow Testing Script |
| 99 | +**File**: Create `scripts/test-workflows.sh` |
| 100 | +```bash |
| 101 | +#!/bin/bash |
| 102 | +# Test workflows locally using act |
| 103 | +act -j build-binaries -P ubuntu-latest=ghcr.io/catthehacker/ubuntu:act-latest |
| 104 | +act -j build-tauri -P ubuntu-latest=ghcr.io/catthehacker/ubuntu:act-latest |
| 105 | +``` |
| 106 | + |
| 107 | +## Implementation Steps |
| 108 | + |
| 109 | +1. **Create a feature branch** |
| 110 | + ```bash |
| 111 | + git checkout -b fix/github-actions-release-workflows |
| 112 | + ``` |
| 113 | + |
| 114 | +2. **Apply all fixes listed above** |
| 115 | + - Update workflow files with correct action versions |
| 116 | + - Fix Docker build configuration |
| 117 | + - Add Cross.toml for cross-compilation |
| 118 | + - Fix Windows-specific issues |
| 119 | + |
| 120 | +3. **Test workflows locally** |
| 121 | + ```bash |
| 122 | + # Install act if not present |
| 123 | + brew install act |
| 124 | + # Run test script |
| 125 | + ./scripts/test-workflows.sh |
| 126 | + ``` |
| 127 | + |
| 128 | +4. **Create pull request and test** |
| 129 | + ```bash |
| 130 | + gh pr create --title "Fix GitHub Actions release workflows for all platforms" \ |
| 131 | + --body "Fixes build failures across Linux, macOS, Windows, and Docker" |
| 132 | + ``` |
| 133 | + |
| 134 | +5. **Monitor workflow runs on PR** |
| 135 | + ```bash |
| 136 | + gh run watch |
| 137 | + ``` |
| 138 | + |
| 139 | +## Success Criteria |
| 140 | +- ✅ All platforms (Linux, macOS, Windows) build successfully |
| 141 | +- ✅ Docker multi-arch images build for all Ubuntu versions |
| 142 | +- ✅ Debian packages are created correctly |
| 143 | +- ✅ Tauri desktop app builds and packages for all platforms |
| 144 | +- ✅ Release artifacts are uploaded to GitHub Releases |
| 145 | +- ✅ No workflow failures in the release pipeline |
| 146 | + |
| 147 | +## Monitoring Commands |
| 148 | +```bash |
| 149 | +# Check workflow status |
| 150 | +GH_PAGER=cat gh run list --limit=10 |
| 151 | +
|
| 152 | +# View specific workflow logs |
| 153 | +GH_PAGER=cat gh run view <run-id> --log-failed |
| 154 | +
|
| 155 | +# Watch ongoing runs |
| 156 | +gh run watch |
| 157 | +``` |
| 158 | + |
| 159 | +## Risk Mitigation |
| 160 | +- Keep the existing workflows as backups (rename with .bak extension) |
| 161 | +- Test changes incrementally on feature branch |
| 162 | +- Use workflow dispatch for manual testing before merging |
| 163 | +- Ensure all secrets are properly configured in repository settings |
0 commit comments