diff --git a/.github/workflows/release-desktop.yml b/.github/workflows/release-desktop.yml new file mode 100644 index 0000000..be60c1d --- /dev/null +++ b/.github/workflows/release-desktop.yml @@ -0,0 +1,106 @@ +name: Build and Release Desktop Apps + +on: + push: + tags: + - 'v*.*.*' # Trigger on version tags like v2.1.0 + workflow_dispatch: # Allow manual triggering + +permissions: + contents: write # Required to create GitHub Releases + +jobs: + build-desktop: + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, windows-latest, macos-latest] + include: + - os: ubuntu-latest + platform: linux + artifact: ODIA-*.AppImage + - os: windows-latest + platform: windows + artifact: ODIA-Setup-*.exe + - os: macos-latest + platform: mac + artifact: ODIA-*.dmg + + runs-on: ${{ matrix.os }} + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: '20' + cache: 'npm' + cache-dependency-path: desktop/package-lock.json + + - name: Setup Python + uses: actions/setup-python@v5 + with: + python-version: '3.11' + cache: 'pip' + + - name: Install system dependencies (Linux) + if: matrix.os == 'ubuntu-latest' + run: | + sudo apt-get update + sudo apt-get install -y build-essential fakeroot rpm libfuse2 + + - name: Install Python dependencies + run: | + python -m pip install --upgrade pip + pip install -e ".[dev]" + pip install pyinstaller + + - name: Build Python backend + working-directory: desktop + run: | + npm ci + npm run build:backend + + - name: Build frontend for Electron + working-directory: frontend + shell: bash + env: + ELECTRON_BUILD: '1' + run: | + npm ci + npx next build + + - name: Copy frontend to desktop build + shell: bash + run: | + mkdir -p desktop/build/frontend + if [ -d "frontend/out" ]; then + cp -r frontend/out/. desktop/build/frontend/ + else + echo "Error: frontend/out not found. Ensure ELECTRON_BUILD=1 was set." >&2 + exit 1 + fi + + - name: Build Electron installer + working-directory: desktop + run: npm run build + + - name: Upload artifacts + uses: actions/upload-artifact@v4 + with: + name: odia-desktop-${{ matrix.platform }} + path: desktop/dist/${{ matrix.artifact }} + retention-days: 7 + + - name: Upload to Release + if: startsWith(github.ref, 'refs/tags/v') + uses: softprops/action-gh-release@v1 + with: + files: desktop/dist/* + draft: false + prerelease: false + generate_release_notes: true + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/README.md b/README.md index bf7a6a1..0625011 100644 --- a/README.md +++ b/README.md @@ -17,16 +17,21 @@ Legistar-based jurisdiction or custom legal corpus. **Desktop App (no installation prerequisites):** -Download the standalone desktop application — no Python, Docker, or command line -required. All analysis runs locally on your machine. +Pre-built installers will be available in the [Releases](https://github.com/SynTechRev/ODIA/releases) section soon. For now, build the desktop application locally: -| Platform | Download | -|----------|----------| -| Windows | [ODIA-Setup.exe](https://github.com/SynTechRev/ODIA/releases/latest/download/ODIA-Setup.exe) | -| macOS | [ODIA.dmg](https://github.com/SynTechRev/ODIA/releases/latest/download/ODIA.dmg) | -| Linux | [ODIA.AppImage](https://github.com/SynTechRev/ODIA/releases/latest/download/ODIA.AppImage) | +```bash +# Build desktop application +cd desktop +npm install +npm run build:backend # Build Python backend +cd ../frontend +npm ci +ELECTRON_BUILD=1 npm run build # Build frontend for Electron +cd ../desktop +npm run build # Create installer for your platform +``` -See [desktop/README.md](desktop/README.md) for usage instructions and troubleshooting. +Installers are output to `desktop/dist/`. See [desktop/README.md](desktop/README.md) for detailed build instructions and platform-specific requirements. **With Docker (no Python/Node required):** ```bash diff --git a/docs/RELEASING.md b/docs/RELEASING.md new file mode 100644 index 0000000..d6db8b1 --- /dev/null +++ b/docs/RELEASING.md @@ -0,0 +1,78 @@ +# Release Process + +## Automated Desktop Releases + +Desktop application releases are automated via GitHub Actions +(`.github/workflows/release-desktop.yml`). + +### Creating a New Release + +1. **Update version** in relevant package files: + + ```bash + # Update desktop/package.json version field to X.Y.Z + # Update pyproject.toml version field to X.Y.Z + ``` + +2. **Commit version bump:** + + ```bash + git add desktop/package.json pyproject.toml + git commit -m "chore: bump version to X.Y.Z" + git push + ``` + +3. **Create and push tag:** + + ```bash + git tag vX.Y.Z + git push origin vX.Y.Z + ``` + +4. **GitHub Actions automatically:** + - Builds desktop installers for Windows, macOS, and Linux + - Creates a GitHub Release + - Uploads installers as release assets + - Generates release notes + +5. **Verify release:** + - Check + - Test download links work + - Download and test installers on each platform + +### Manual Release (Fallback) + +If the automated release fails: + +```bash +# Build locally for your platform +cd desktop +npm run build:win # Windows +npm run build:mac # macOS +npm run build:linux # Linux + +# Manually create a release on GitHub and upload installers from desktop/dist/ +``` + +## Release Checklist + +- [ ] Version bumped in `desktop/package.json` +- [ ] Version bumped in `pyproject.toml` +- [ ] CHANGELOG updated (if maintained) +- [ ] All tests passing (`pytest` and `cd desktop && npm test`) +- [ ] Desktop app builds successfully locally +- [ ] Tag created and pushed (`git tag vX.Y.Z && git push origin vX.Y.Z`) +- [ ] GitHub Actions workflow completes without errors +- [ ] Release appears on +- [ ] Download links tested +- [ ] Installers tested on target platforms (Windows, macOS, Linux) + +## Workflow Overview + +The release workflow (`.github/workflows/release-desktop.yml`) runs on: + +- **Version tags** matching `v*.*.*` (e.g., `v2.1.0`) — full build + release +- **Manual dispatch** — full build + artifact upload (no release created unless on a tag) + +The existing CI workflow (`.github/workflows/desktop-build.yml`) handles +continuous integration builds for pull requests and branch pushes.