- File:
src-tauri/tauri.conf.json - Updater enabled with GitHub Releases endpoint
- Public key placeholder for signature verification
- Version set to 1.0.0
- File:
src-tauri/Cargo.toml - Added
updaterfeature to Tauri dependency - Version set to 1.0.0
- All required dependencies configured
lib/network.ts: Online/offline detection utilitieslib/updater.ts: Tauri updater API wrapperscomponents/ui/update-dialog.tsx: Update notification UI with progress barcomponents/ui/update-checker.tsx: Startup update check componentapp/layout.tsx: Integrated UpdateChecker for automatic checks
- File:
.github/workflows/release.yml - Automated build on push to
mainand tags - Builds Next.js + Tauri for Windows
- Signs installers with private key
- Creates GitHub Releases automatically
- Generates
latest.jsonfor updater
- Setup instructions
- Update signing explanation
- Version bump workflow
- Example
latest.json
Run this command locally:
npm run tauri signer generate -- -w ~/.tauri/attendance-system.keyExpected Output:
Your keypair was generated successfully
Private: dW50cnVzdGVkIGNvbW1lbnQ6IHJzaWdu...
Public: dW50cnVzdGVkIGNvbW1lbnQ6IG1pbmlz...
Your secret key was saved to: /Users/you/.tauri/attendance-system.key
-
Copy Private Key → Save to GitHub Secrets
- Go to:
https://github.com/YOUR_USERNAME/YOUR_REPO/settings/secrets/actions - Create secret named:
TAURI_PRIVATE_KEY - Paste the ENTIRE private key string
- Go to:
-
Copy Public Key → Update
tauri.conf.json- Open:
src-tauri/tauri.conf.json - Find:
"pubkey": "REPLACE_WITH_YOUR_PUBLIC_KEY_FROM_TAURI_SIGNER_GENERATE" - Replace with your actual public key
- Open:
-
Backup Private Key → Store securely:
- Password manager (1Password, LastPass, etc.)
- Encrypted vault
- NEVER commit to git!
Replace YOUR_USERNAME/attendance-system in these files:
.github/workflows/release.yml (line 130):
url: "https://github.com/YOUR_USERNAME/YOUR_REPO/releases/download/..."src-tauri/tauri.conf.json (line 68):
"endpoints": [
"https://github.com/YOUR_USERNAME/YOUR_REPO/releases/latest/download/latest.json"
]-
Go to:
https://github.com/YOUR_USERNAME/YOUR_REPO/settings/actions -
Under "Actions permissions":
- Select: "Allow all actions and reusable workflows"
- Click "Save"
-
Under "Workflow permissions":
- Select: "Read and write permissions"
- Check: "Allow GitHub Actions to create and approve pull requests"
- Click "Save"
Ensure version is 1.0.0 in all three files:
package.json→"version": "1.0.0"src-tauri/Cargo.toml→version = "1.0.0"src-tauri/tauri.conf.json→"version": "1.0.0"
git add .
git commit -m "chore: release v1.0.0"
git tag v1.0.0
git push origin main
git push origin v1.0.0- Go to:
https://github.com/YOUR_USERNAME/YOUR_REPO/actions - Watch the "Release" workflow
- Wait ~10-15 minutes for completion
Go to: https://github.com/YOUR_USERNAME/YOUR_REPO/releases
You should see:
- ✅ Release
v1.0.0 - ✅
.exeinstaller (NSIS) - ✅
.msiinstaller - ✅
latest.json - ✅
.sigsignature files
- Download the installer from GitHub Releases
- Run the installer
- Launch the app
# Update versions in all 3 files to 1.0.1
npm version patch
#Commit and push
git add .
git commit -m "chore: release v1.0.1"
git tag v1.0.1
git push origin main --tagsWait for GitHub Actions to complete the v1.0.1 build.
In the running v1.0.0 app:
- Wait 3 seconds (auto-check on startup)
- OR manually restart the app
- Verify "Update Available" dialog appears
- Click "Download and Install"
- Watch progress bar
- App restarts automatically with v1.0.1
attendance-system-v2/
├── .github/
│ └── workflows/
│ └── release.yml ✅ CI/CD workflow
├── app/
│ ├── layout.tsx ✅ Updated with UpdateChecker
│ ├── admin/
│ │ └── page.tsx
│ └── ...
├── components/
│ └── ui/
│ ├── update-dialog.tsx ✅ Update UI
│ └── update-checker.tsx ✅ Startup check
├── lib/
│ ├── network.ts ✅ Online detection
│ ├── updater.ts ✅ Update API
│ └── ...
├── src-tauri/
│ ├── Cargo.toml ✅ v1.0.0, updater feature
│ ├── tauri.conf.json ✅ Updater config
│ ├── installer.nsi
│ └── src/
│ ├── main.rs
│ ├── commands.rs
│ └── db.rs
├── package.json ✅ v1.0.0
├── latest.json.example ✅ Example manifest
└── README.md
- Tauri builds the app
- Signs with private key (from GitHub Secrets)
- Generates
.sigfile - Uploads to GitHub Releases
- App checks for updates
- Downloads
latest.json - Verifies signature using public key in
tauri.conf.json - If valid → downloads and installs
- If invalid → rejects update (security!)
- Only updates signed with YOUR private key can install
- Prevents tampering and man-in-the-middle attacks
- Signature verification happens before download
npm version patch
git add .
git commit -m "chore: release v1.0.1"
git tag v1.0.1
git push origin main --tagsnpm version minor
git add .
git commit -m "feat: release v1.1.0"
git tag v1.1.0
git push origin main --tagsnpm version major
git add .
git commit -m "feat!: release v2.0.0"
git tag v2.0.0
git push origin main --tagsSolution:
- Verify public key in
tauri.conf.jsonmatches your generated key - Ensure
TAURI_PRIVATE_KEYin GitHub Secrets is complete
Solution:
- Check workflow permissions (Step 2.2)
- Verify
TAURI_PRIVATE_KEYsecret exists - Review Actions logs for specific errors
Solution:
- Verify
latest.jsonexists in GitHub Releases - Check app actually has internet connection
- Ensure new version > installed version
Solution:
# Clean and rebuild
rm -rf node_modules .next
npm install
npm run build
npm run tauri buildBefore releasing to production:
- Private key stored in GitHub Secrets
- Public key added to
tauri.conf.json - Repository name updated in all files
- All placeholders replaced
- Workflow permissions configured correctly
- Test update flow works (v1.0.0 → v1.0.1)
- Version numbers consistent across files
- Release notes prepared
- Private key backed up securely
- First Install: Download installer from GitHub Releases
- App Launches: Automatic update check after 3 seconds
- Update Available: Dialog appears with version info
- One Click: "Download and Install" button
- Progress Bar: Real-time download progress
- Auto Restart: App relaunches with new version
No manual downloads. No confusion. Just seamless updates.
- Tauri Updater Docs: https://tauri.app/v1/guides/distribution/updater
- GitHub Actions Docs: https://docs.github.com/en/actions
- Semantic Versioning: https://semver.org/
🚀 You're all set! Your app now has enterprise-grade auto-updates.