Skip to content

Commit 52f60f0

Browse files
feat: enhance Tauri build configuration, add updater artifact generation, and update README for new commands
1 parent 53d5993 commit 52f60f0

10 files changed

Lines changed: 122 additions & 24 deletions

.env.example

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# CommDesk local environment template
2+
# Copy this file to .env and set values before running signed builds.
3+
# Example: cp .env.example .env
4+
5+
# Preferred for local signed builds: path to private key file generated by Tauri signer.
6+
# Generate it with: pnpm tauri:keys:generate
7+
# TAURI_SIGNING_PRIVATE_KEY_PATH=/home/your-user/.tauri/commdesk.key
8+
9+
# Set if your private key is password-protected, otherwise keep empty.
10+
TAURI_SIGNING_PRIVATE_KEY_PASSWORD=
11+
12+
# Optional alternative: provide full private key content directly (advanced/CI usage).
13+
# If set, this takes precedence over TAURI_SIGNING_PRIVATE_KEY_PATH in scripts.
14+
TAURI_SIGNING_PRIVATE_KEY=
15+
16+
# Optional for local release tooling that talks to GitHub API.
17+
# GITHUB_TOKEN=

.github/workflows/tauri-all-platforms.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ jobs:
2121
matrix:
2222
include:
2323
- os: ubuntu-24.04
24-
args: ""
24+
args: "--config src-tauri/tauri.release.conf.json"
2525
- os: windows-latest
26-
args: ""
26+
args: "--config src-tauri/tauri.release.conf.json"
2727
- os: macos-latest
28-
args: ""
28+
args: "--config src-tauri/tauri.release.conf.json"
2929

3030
runs-on: ${{ matrix.os }}
3131

.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,11 @@ dist-ssr
2222
*.njsproj
2323
*.sln
2424
*.sw?
25+
26+
build-dir
27+
.flatpak-builder
28+
29+
# Environment variables (local secrets)
30+
.env
31+
.env.*
32+
!.env.example

README.md

Lines changed: 28 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,8 @@ pnpm install
122122
| build | `pnpm build` | Type-check + production frontend build |
123123
| preview | `pnpm preview` | Preview built frontend |
124124
| tauri | `pnpm tauri` | Run Tauri CLI commands |
125+
| tauri:keys:generate | `pnpm tauri:keys:generate` | Generate updater signing keys |
126+
| tauri:build:signed | `pnpm tauri:build:signed` | Build signed updater artifacts |
125127
| lint | `pnpm lint` | Run ESLint |
126128
| lint:fix | `pnpm lint:fix` | Auto-fix lint issues |
127129
| format | `pnpm format` | Format all files with Prettier |
@@ -149,16 +151,20 @@ pnpm install
149151
# Run app in development mode
150152
pnpm tauri dev
151153

152-
# Build production desktop bundles (current OS)
154+
# Build production desktop bundles (current OS, unsigned/local)
153155
pnpm tauri build
154156

157+
158+
pnpm tauri signer generate
159+
155160
# Generate updater signing keys (IMPORTANT)
156-
pnpm tauri signer generate -- -w ~/.tauri/commdesk.key
161+
pnpm tauri:keys:generate
157162

158-
# Use signing keys for local signed build
159-
export TAURI_SIGNING_PRIVATE_KEY="$(cat ~/.tauri/commdesk.key)"
160-
export TAURI_SIGNING_PRIVATE_KEY_PASSWORD=""
161-
pnpm tauri build
163+
# Direct equivalent (important: do not add an extra `--` before `-w`)
164+
pnpm tauri signer generate -w ~/.tauri/commdesk.key
165+
166+
# Build signed updater artifacts (uses ~/.tauri/commdesk.key by default)
167+
pnpm tauri:build:signed
162168

163169
# Release version
164170
git add .
@@ -180,6 +186,8 @@ flatpak-builder --force-clean flatpak-build org.commdesk.CommDesk.json
180186
pnpm tauri build
181187
```
182188

189+
Use `pnpm tauri:build:signed` when you need updater artifacts/signatures.
190+
183191
Artifacts are generated in:
184192

185193
- `src-tauri/target/release/`
@@ -216,7 +224,13 @@ Configured in:
216224
### 1) Generate updater signing keys
217225

218226
```bash
219-
pnpm tauri signer generate -- -w ~/.tauri/commdesk.key
227+
pnpm tauri:keys:generate
228+
```
229+
230+
Direct command equivalent:
231+
232+
```bash
233+
pnpm tauri signer generate -w ~/.tauri/commdesk.key
220234
```
221235

222236
This creates:
@@ -227,11 +241,15 @@ This creates:
227241
### 2) Local signed build environment
228242

229243
```bash
230-
export TAURI_SIGNING_PRIVATE_KEY="$(cat ~/.tauri/commdesk.key)"
231-
export TAURI_SIGNING_PRIVATE_KEY_PASSWORD=""
232-
pnpm tauri build
244+
pnpm tauri:build:signed
233245
```
234246

247+
The signed build script resolves key path in this order:
248+
249+
1. `TAURI_SIGNING_PRIVATE_KEY` (if already set)
250+
2. `TAURI_SIGNING_PRIVATE_KEY_PATH` (custom key file path)
251+
3. `~/.tauri/commdesk.key` (default)
252+
235253
### 3) GitHub Actions secrets
236254

237255
Set in repository secrets:

docs/Tauri_Auto_Update_Production_Guide.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ Key behavior:
123123
Run once on a secure machine:
124124

125125
```bash
126-
pnpm tauri signer generate -- -w ~/.tauri/commdesk.key
126+
pnpm tauri signer generate -w ~/.tauri/commdesk.key
127127
```
128128

129129
This outputs:

org.commdesk.CommDesk.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323
"name": "commdesk",
2424
"buildsystem": "simple",
2525
"build-commands": [
26-
"pnpm install",
27-
"pnpm run build",
26+
"npm install",
27+
"npm run build",
2828
"cargo build --manifest-path src-tauri/Cargo.toml --release",
2929
"install -Dm755 src-tauri/target/release/apex-circle-dasktop-application /app/bin/commdesk"
3030
],

src-tauri/.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,7 @@
55
# Generated by Tauri
66
# will have schema files for capabilities auto-completion
77
/gen/schemas
8+
9+
10+
node_modules
11+
dist

src-tauri/tauri.conf.json

Lines changed: 51 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,86 @@
11
{
22
"$schema": "https://schema.tauri.app/config/2",
3+
34
"productName": "CommDesk",
45
"version": "0.1.0",
56
"identifier": "com.abhishekg.commdesk",
7+
68
"build": {
79
"beforeDevCommand": "pnpm dev",
810
"devUrl": "http://localhost:1420",
911
"beforeBuildCommand": "pnpm build",
1012
"frontendDist": "../dist"
1113
},
14+
1215
"app": {
1316
"windows": [
1417
{
1518
"title": "CommDesk",
16-
"width": 800,
17-
"height": 600
19+
"width": 1200,
20+
"height": 800,
21+
"resizable": true,
22+
"fullscreen": false
1823
}
1924
],
25+
2026
"security": {
2127
"csp": null
2228
}
2329
},
30+
2431
"bundle": {
2532
"active": true,
26-
"targets": "all",
27-
"createUpdaterArtifacts": true,
28-
"icon": ["icons/logoWithoutText.png"]
33+
34+
"targets": [
35+
"appimage",
36+
"deb",
37+
"rpm",
38+
"msi",
39+
"nsis",
40+
"dmg"
41+
],
42+
43+
"icon": [
44+
"icons/32x32.png",
45+
"icons/128x128.png",
46+
"icons/128x128@2x.png",
47+
"icons/icon.icns",
48+
"icons/icon.ico"
49+
],
50+
51+
"category": "DeveloperTool",
52+
53+
"shortDescription": "Community and event management platform",
54+
55+
"longDescription": "CommDesk is a desktop platform for managing communities, hackathons, teams, and events in a single workspace.",
56+
57+
"linux": {
58+
"deb": {
59+
"depends": []
60+
}
61+
},
62+
63+
"windows": {
64+
"digestAlgorithm": "sha256",
65+
"timestampUrl": "http://timestamp.digicert.com"
66+
},
67+
68+
"macOS": {
69+
"minimumSystemVersion": "10.13"
70+
}
2971
},
72+
3073
"plugins": {
3174
"updater": {
3275
"pubkey": "dW50cnVzdGVkIGNvbW1lbnQ6IG1pbmlzaWduIHB1YmxpYyBrZXk6IDc3MjdGODk5Q0JBREJCMkMKUldRc3U2M0xtZmduZDh5QkVrdW8zd25wYllnN2tWR1RGalpLMFhtZ01vRVhtU0VPRVNxcHNqbWQK",
76+
3377
"endpoints": [
3478
"https://github.com/NexGenStudioDev/CommDesk/releases/latest/download/latest.json"
3579
],
80+
3681
"windows": {
3782
"installMode": "passive"
3883
}
3984
}
4085
}
41-
}
86+
}

src-tauri/tauri.release.conf.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"$schema": "https://schema.tauri.app/config/2",
3+
"bundle": {
4+
"createUpdaterArtifacts": true
5+
}
6+
}

vite.config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ export default defineConfig(async () => ({
3333
}
3434
: undefined,
3535
watch: {
36-
// 3. tell Vite to ignore watching `src-tauri`
37-
ignored: ["**/src-tauri/**"],
36+
// 3. tell Vite to ignore non-frontend directories
37+
ignored: ["**/src-tauri/**", "**/.flatpak-builder/**"],
3838
},
3939
},
4040
}));

0 commit comments

Comments
 (0)