feat: add desktop packaging support for multiple platforms and CI workflow

This commit is contained in:
cloudwithax 2026-02-18 21:13:48 -05:00
parent f97cde8608
commit d34def24b0
4 changed files with 139 additions and 5 deletions

69
.github/workflows/desktop-packaging.yml vendored Normal file
View File

@ -0,0 +1,69 @@
name: Desktop Packaging
on:
workflow_dispatch:
push:
tags:
- "v*"
pull_request:
jobs:
bundle:
name: Bundle (${{ matrix.name }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- name: Linux
os: ubuntu-22.04
package_script: package:linux
artifact_name: dusk-linux-bundles
- name: macOS
os: macos-latest
package_script: package:macos
artifact_name: dusk-macos-bundles
- name: Windows
os: windows-latest
package_script: package:windows
artifact_name: dusk-windows-bundles
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
- name: Install Linux system dependencies
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y \
libwebkit2gtk-4.1-dev \
build-essential \
curl \
wget \
file \
libxdo-dev \
libssl-dev \
libayatana-appindicator3-dev \
librsvg2-dev
- name: Install frontend dependencies
run: bun install --frozen-lockfile
- name: Build Tauri bundles
run: bun run ${{ matrix.package_script }}
- name: Upload bundle artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.artifact_name }}
if-no-files-found: error
path: src-tauri/target/release/bundle/**

View File

@ -260,6 +260,55 @@ cd relay-server && cargo run
DUSK_RELAY_PORT=4002 cargo run
```
## desktop packaging (windows / macos / linux)
run packaging commands from the `app/` directory.
```bash
# all bundles supported by your current OS
bun run package
# linux bundles
bun run package:linux
# macOS bundles
bun run package:macos
# windows bundles
bun run package:windows
```
expected bundle outputs are written to:
```text
app/src-tauri/target/release/bundle/
```
common artifact types by platform:
- linux: `appimage`, `deb`, `rpm`
- macos: `.app`, `.dmg`
- windows: `nsis` installer, `msi`
### ci packaging workflow
cross-platform packaging is automated in:
```text
app/.github/workflows/desktop-packaging.yml
```
workflow behavior:
- runs a matrix build on `ubuntu-22.04`, `macos-latest`, and `windows-latest`
- installs bun + rust, then runs platform-specific packaging scripts from `app/package.json`
- uploads generated bundles from `app/src-tauri/target/release/bundle/**` as artifacts:
- `dusk-linux-bundles`
- `dusk-macos-bundles`
- `dusk-windows-bundles`
the workflow triggers on manual dispatch, version tags (`v*`), and pull requests that touch the app or packaging workflow.
## contributing
1. fork the repository and install dependencies as described above

View File

@ -7,8 +7,16 @@
"dev": "vite",
"build": "vite build",
"preview": "vite preview",
"tauri": "WEBKIT_DISABLE_DMABUF_RENDERER=1 GDK_BACKEND=x11 tauri",
"tauri:dev-server": "WEBKIT_DISABLE_DMABUF_RENDERER=1 GDK_BACKEND=x11 tauri dev --features dev-server"
"tauri": "tauri",
"tauri:linux": "WEBKIT_DISABLE_DMABUF_RENDERER=1 GDK_BACKEND=x11 tauri",
"tauri:dev": "tauri dev",
"tauri:dev:linux": "WEBKIT_DISABLE_DMABUF_RENDERER=1 GDK_BACKEND=x11 tauri dev",
"tauri:dev-server": "tauri dev --features dev-server",
"tauri:dev-server:linux": "WEBKIT_DISABLE_DMABUF_RENDERER=1 GDK_BACKEND=x11 tauri dev --features dev-server",
"package": "tauri build",
"package:linux": "tauri build --bundles appimage,deb,rpm",
"package:macos": "tauri build --bundles app,dmg",
"package:windows": "tauri build --bundles nsis,msi"
},
"license": "MIT",
"dependencies": {
@ -42,4 +50,4 @@
"@tailwindcss/vite": "^4.0.0",
"tailwindcss": "^4.0.0"
}
}
}

View File

@ -26,7 +26,15 @@
},
"bundle": {
"active": true,
"targets": "all",
"targets": [
"app",
"dmg",
"appimage",
"deb",
"rpm",
"msi",
"nsis"
],
"icon": [
"icons/32x32.png",
"icons/128x128.png",
@ -35,4 +43,4 @@
"icons/icon.ico"
]
}
}
}