Tauri Plugin OTA Self Update
Self-hosted OTA updates for Tauri v2 web assets.
This project provides:
- A Rust plugin for runtime update checks and apply flow.
- A guest JS API package for frontend usage.
- A universal GitHub Action (
action.yml) for publishing OTA artifacts.
Table of contents
- Features
- Platform support
- Installation
- Usage
- Manifest contract
- Rust-side access
- Publishing
- GitHub Action
- Permissions
- Security
- Development
- License
Features
- Self-hosted OTA model (no vendor cloud lock-in).
- Update channels (
stable,beta, custom). - JS API:
check(),checkWithMeta(),setChannel(),Update.apply(). - Rust-side access via
app.ota_self_update(). - Single Rust runtime is used on all targets (no separate Kotlin/Swift OTA bridge required).
- Multiple publish targets: GitHub Releases, S3-compatible, custom HTTP server.
- Marketplace-style reusable GitHub Action in repo root (
action.yml).
Platform support
| Platform | Status |
|---|---|
| macOS | Supported |
| Windows | Supported |
| Linux | Supported |
| Android | Supported |
| iOS | Supported |
Installation
Rust (src-tauri/Cargo.toml)
[]
= "0.1"
JavaScript
Usage
Backend initialization
let context = generate_context!;
let = init;
default
.plugin
.run
.expect;
Plugin config (tauri.conf.json)
activationPolicy values:
nextLaunch: apply assets and activate them on next app start.softReload: apply assets and mark as active immediately for runtime reload flows.
Frontend flow
import { check, setChannel } from "tauri-plugin-ota-self-update-api";
await setChannel("stable");
const update = await check();
if (update) {
const applyResult = await update.apply();
if (applyResult.status === "appliedNow") {
location.reload();
}
}
Manifest contract
Example manifest/stable.json:
Rust-side access
You can call plugin logic from Rust commands/plugins through the extension trait:
use Manager;
use OtaSelfUpdateExt;
async
Publishing
Local publisher script:
OTA_PUBLISH_MODE=github \
OTA_CHANNEL=stable \
OTA_VERSION=1.2.3 \
OTA_BASE_URL=https://updates.example.com/ota \
OTA_TARGET_REPO=owner/repo \
Modes:
github: uses GitHub REST API via@octokit/rest.s3: uses AWS SDK v3 (@aws-sdk/client-s3).server: usesaxiosPUT to upload archive + manifest.
GitHub Action
This repository exposes a reusable action in action.yml.
- name: Publish OTA
uses: s00d/tauri-plugin-ota-self-update@v1
with:
mode: github
channel: stable
version: 1.2.3
dist_dir: dist
base_url: https://updates.example.com/ota
target_repo: owner/repo
Primary inputs:
mode:github | s3 | server(required)version: OTA version (required)channel,dist_dir,out_dir,base_url,notestarget_repo,release_tag,github_token(github mode)s3_bucket(s3 mode)server_token(server mode)manifest_signature,archive_signaturedry_run(true|false)
Validation workflow example is provided at .github/workflows/ota-publish.yml.
Permissions
Default permission set: ota-self-update:default.
Granular permissions are generated under permissions/ for:
check_for_updatesapply_updateset_channel
Security
- Always set
pubkeyand signatures in production. - Empty
pubkeyor empty signatures skip verification (development-only behavior). - Keep release keys in repository/org secrets and rotate periodically.
Development
License
MIT OR Apache-2.0