App Updater
GitLab Releases & Tauri v2 Auto-Updater
This document explains how Prompt Builder builds, signs, and publishes desktop installers to GitLab Releases, and how the Tauri v2 app automatically checks for and installs updates.
Architecture Overview
- Tag Push (
vX.Y.Z) triggers the GitLab CI/CD pipeline. - Build Jobs (
build_linuxandbuild_windows_exe) compile the Nuxt frontend and Tauri Rust binary, signing the updater bundles (.AppImageand NSIS.exe) usingTAURI_SIGNING_PRIVATE_KEYto produce.sigsignature files. - Publish Job (
publish):- Verifies that the Git tag matches
versioninpackage.jsonandsrc-tauri/tauri.conf.json. - Uploads installers to the GitLab Generic Package Registry.
- Generates
latest.jsoncontaining the version, release date, download URLs, and raw.sigcontents forlinux-x86_64andwindows-x86_64. - Uploads
latest.jsonand creates a GitLab Release withfilepath: "/latest.json".
- Verifies that the Git tag matches
- In-App Updater queries GitLab's permanent latest-release asset URL on startup:
https://gitlab.example.com/example/repo/-/releases/permalink/latest/downloads/latest.json
1. Signing Keys & GitLab CI/CD Variables
Tauri v2 requires cryptographic signatures on all update bundles.
Generating Keys (One-Time)
pnpm tauri signer generate -w ~/.tauri/prompt-builder.key
- Public key (
.key.pub): Stored insrc-tauri/tauri.conf.jsonunderplugins.updater.pubkey. - Private key (
.key): Stored only in GitLab CI/CD Variables. Never commit this file.
If you lose the private key, existing installations will not be able to verify future updates.
GitLab CI/CD Variable Configuration
Add the following under Settings → CI/CD → Variables:
| Key | Type | Visibility | Protect variable | Expand variable reference | Value |
|---|---|---|---|---|---|
TAURI_SIGNING_PRIVATE_KEY |
Variable | Masked and hidden | Optional* | Unchecked | Single-line contents of prompt-builder.key (no trailing newline) |
TAURI_SIGNING_PRIVATE_KEY_PASSWORD |
Variable | Masked and hidden | Optional* | Unchecked | Key password (only if set during generation) |
Protected Variables & Tags: If Protect variable is checked, you must also protect release tags (e.g.,
v*) under Settings → Repository → Protected tags. Otherwise, tag pipelines will not receive the signing key and thepublishjob will fail.
2. Tauri Configuration
Plugins & Capabilities
- Rust (
src-tauri/src/lib.rs): Registerstauri_plugin_process::init()andtauri_plugin_updater::Builder::new().build(). - Permissions (
src-tauri/capabilities/desktop.json): Grantsupdater:defaultandprocess:defaultto themainwindow onmacOS,windows, andlinux.
src-tauri/tauri.conf.json
{
"bundle": {
"active": true,
"targets": "all",
"createUpdaterArtifacts": true
},
"plugins": {
"updater": {
"requireSignedVersion": true,
"pubkey": "<PUBLIC_KEY_FROM_KEY_PUB>",
"endpoints": [
"https://gitlab.example.com/example/repo/-/releases/permalink/latest/downloads/latest.json"
],
"windows": {
"installMode": "passive"
}
}
}
}
3. Frontend Update Check
Update checks run on startup in app/app.vue via checkForAppUpdates() in app/lib/updater.ts:
import { check } from '@tauri-apps/plugin-updater';
import { relaunch } from '@tauri-apps/plugin-process';
import { confirmDialog, DialogCancelledError } from './dialog';
export async function checkForAppUpdates(): Promise<void> {
if (typeof window === 'undefined' || !('__TAURI_INTERNALS__' in window)) {
return;
}
try {
const update = await check();
if (!update) return;
await confirmDialog({
title: `Update available (v${update.version})`,
message: update.body
? `${update.body}\n\nDownload and install now?`
: `Version ${update.version} is available. Download and install now?`,
confirmLabel: 'Update & Restart',
cancelLabel: 'Later',
});
await update.downloadAndInstall();
await relaunch();
} catch (error) {
if (error instanceof DialogCancelledError) {
return;
}
console.debug('Updater check skipped:', error);
}
}
On Windows, the NSIS installer automatically exits the application during
downloadAndInstall(). On Linux,relaunch()restarts the updated AppImage.
4. GitLab CI/CD Pipeline (.gitlab-ci.yml)
Build Artifacts
build_linuxexports.deb,.rpm,.AppImage, and.AppImage.sig.build_windows_execross-compiles on Linux viacargo-xwinand exports NSIS.exeand.exe.sig.
publish Job & latest.json
The publish job runs only on tags matching /^v\d+\.\d+\.\d+([-.].+)?$/:
- Validates
CI_COMMIT_TAG(withoutv) equalsversioninpackage.jsonandsrc-tauri/tauri.conf.json. - Uploads installers to
${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/${PACKAGE_NAME}/${TAG_VERSION}/.... - Builds
latest.json:{ "version": "0.2.0", "notes": "Release v0.2.0", "pub_date": "2026-11-29T16:35:00.000Z", "platforms": { "linux-x86_64": { "signature": "<contents of .AppImage.sig>", "url": "<Generic Package URL for .AppImage>" }, "windows-x86_64": { "signature": "<contents of .exe.sig>", "url": "<Generic Package URL for .exe>" } } } - Uploads
latest.jsonand attaches it to the GitLab Release with"filepath": "/latest.json"so/-/releases/permalink/latest/downloads/latest.jsonalways resolves to the latest release.
Private Repositories: Anonymous
GETrequests to/-/releases/permalink/latest/downloads/latest.jsonand Generic Package URLs require the project (or its Releases) to be publicly accessible. For private projects, pass a read-only token header incheck({ headers: { ... } }).
5. How to Publish a New Release
- Update
"version"to the new SemVer (e.g.,0.2.1) in:package.jsonsrc-tauri/tauri.conf.jsonsrc-tauri/Cargo.toml
- Commit the version bump:
git add package.json src-tauri/tauri.conf.json src-tauri/Cargo.toml git commit -m "chore: bump version to 0.2.1" - Create and push the matching tag:
git tag v0.2.1 git push origin main v0.2.1 - Monitor the pipeline in GitLab (Build → Pipelines) and verify the new release appears under Deploy → Releases with
latest.jsonand all installers attached.