From 5f9f7a71568dd77b91b30a4c0a4cc24b5f5dec42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Dvo=C5=99=C3=A1k?= <150935816+Dvorinka@users.noreply.github.com> Date: Sun, 20 Sep 2026 11:49:53 +0200 Subject: [PATCH] feat(desktop): release workflow + fix tauri build hooks (#205) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - beforeBuildCommand/beforeDevCommand run from the project root, not ui/ — use `yarn --cwd ui` so `tauri build`/`tauri dev` work again - bundle.targets was [] which produces no artifacts; set "all" so each host OS emits its native bundles - new desktop-release.yml: matrix build on ubuntu/windows/macos via tauri-action on `desktop-v*` tags — ships .msi/.exe, .dmg, .deb/.AppImage attached to the GitHub release - ROADMAP Phase D updated to verified state Verified locally on Linux: cargo test --workspace (49 tests) and cargo tauri build -> Cloudreve_0.2.0_amd64.deb + .AppImage. Generated with [Devin](https://devin.ai) Co-authored-by: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com> --- .github/workflows/desktop-release.yml | 60 +++++++++++++++++++++++++++ ROADMAP.md | 5 ++- desktop/src-tauri/tauri.conf.json | 6 +-- 3 files changed, 66 insertions(+), 5 deletions(-) create mode 100644 .github/workflows/desktop-release.yml diff --git a/.github/workflows/desktop-release.yml b/.github/workflows/desktop-release.yml new file mode 100644 index 00000000..9f45993c --- /dev/null +++ b/.github/workflows/desktop-release.yml @@ -0,0 +1,60 @@ +name: Desktop Release + +# Tag `desktop-v*` builds and publishes the Tauri desktop app for +# Windows, macOS and Linux. Server releases stay on the `v*` tags +# handled by release.yml (goreleaser). +on: + push: + tags: ['desktop-v*'] + workflow_dispatch: + +permissions: + contents: write + +jobs: + bundle: + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, windows-latest, macos-latest] + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-node@v4 + with: + node-version: 22 + cache: yarn + cache-dependency-path: desktop/ui/yarn.lock + + - uses: dtolnay/rust-toolchain@stable + - uses: Swatinem/rust-cache@v2 + with: + workspaces: desktop + + - name: Install Linux dependencies + if: runner.os == 'Linux' + run: | + sudo apt-get update + sudo apt-get install -y libwebkit2gtk-4.1-dev libayatana-appindicator3-dev libgtk-3-dev librsvg2-dev patchelf + + - name: Install UI dependencies + working-directory: desktop/ui + run: yarn install --frozen-lockfile + + # tauri-action runs `tauri build` (which triggers beforeBuildCommand -> + # the UI build), produces the platform bundles and attaches them to the + # GitHub release for the pushed tag: + # Windows -> .msi + .exe (NSIS), macOS -> .dmg + .app.tar.gz, + # Linux -> .deb + .AppImage + # MSIX requires separate packaging + store signing; not covered here. + - uses: tauri-apps/tauri-action@v0 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + projectPath: desktop + tagName: ${{ github.ref_name }} + releaseName: 'Cloudreve Desktop ${{ github.ref_name }}' + releaseBody: 'Cloudreve Desktop for Linux, macOS, and Windows.' + releaseDraft: false + prerelease: false diff --git a/ROADMAP.md b/ROADMAP.md index 033d90ca..0a6cbd22 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -225,10 +225,11 @@ Goal: Windows + macOS + Linux from the `desktop/` tree in this repo. |---|---|---|---| | Placeholders/hydration | cfapi (keep) | File Provider ext (Swift bridge) | FUSE (`fuser`) or plain sync folder | | Shell integration | shellext (keep) | Finder sync extension | Nautilus/Dolphin plugin (later) | -| Notifications | win32_notif → replace | `tauri-plugin-notification` (all platforms) | same | +| Notifications | win32_notif | `mac_notification_sys` | `notify_rust` | | Sync core | shared: `cloudreve-api`, `inventory`, `tasks`, `uploader`, `drive/sync` | same | same | -- Port order: (1) strip `win32_notif`→tauri notifications (all platforms benefit), (2) abstract `drive/` behind a `HydrationProvider` trait (cfapi impl on Windows, stub→FUSE on Linux, FileProvider on macOS), (3) CI matrix build all 3, (4) MSIX→also ship .dmg/.AppImage/.deb. +- Status: (1) notifications already per-OS (`win32_notif` / `notify_rust` / `mac_notification_sys`) — no abstraction needed; (2) hydration abstracted via `drive/placeholder` cfg swap — `cfapi` on Windows, `placeholder_non_windows` full-sync adapter elsewhere (FUSE / File Provider still open); (3) CI matrix builds + tests all 3 OSes; (4) packaging: `desktop-release.yml` on `desktop-v*` tags ships .msi/.exe (Windows), .dmg (macOS), .deb/.AppImage (Linux) — MSIX deferred (needs store signing). +- Verified on Linux: `cargo test --workspace` green (49 tests), `cargo tauri build` produces working .deb + .AppImage. - Feature fallback on Linux/macOS until providers land: full sync without placeholders (download-on-access still works via sync engine). ## 7. Phase E — Android app (native, no iOS) diff --git a/desktop/src-tauri/tauri.conf.json b/desktop/src-tauri/tauri.conf.json index f7784ee3..2d329384 100644 --- a/desktop/src-tauri/tauri.conf.json +++ b/desktop/src-tauri/tauri.conf.json @@ -6,8 +6,8 @@ "build": { "frontendDist": "../ui/dist", "devUrl": "http://localhost:5173", - "beforeDevCommand": "yarn run dev", - "beforeBuildCommand": "yarn run build" + "beforeDevCommand": "yarn --cwd ui run dev", + "beforeBuildCommand": "yarn --cwd ui run build" }, "app": { "enableGTKAppId": true, @@ -38,7 +38,7 @@ }, "bundle": { "active": true, - "targets": [], + "targets": "all", "icon": [ "icons/32x32.png", "icons/128x128.png",