talira

self_update

Self updates for Rust executables, from GitHub, GitLab, Gitea, Gitee, S3 or a static manifest

open sourceMITself-hostablefree

self_update is a Rust crate that lets a command-line program replace its own executable with the newest release. A builder looks up releases on GitHub (the default), GitLab, Gitea, Gitee, an S3-compatible bucket or a manifest.json on any static host, picks the asset for the running platform, downloads and extracts it, and swaps the binary in place. Optional features verify downloads against checksums or zipsign signatures, update a whole macOS .app bundle as one unit with rollback, and add async methods. It's MIT-licensed and written by James Kominick.

Problems it solves

  • add an update subcommand to my Rust CLI that downloads the latest GitHub release and replaces the binary
  • my command-line tool should upgrade itself in place without going through a package manager
  • check whether a newer version of my program exists and prompt the user before installing it
  • update a Rust binary from releases stored in a private S3 bucket
  • self-update a tool from GitLab or Gitea releases instead of GitHub
  • verify the downloaded release against a SHA-256 checksum or signature before swapping the executable
  • update a signed macOS .app bundle as a whole and roll back if the swap fails
  • run an unattended self-update from a daemon without an interactive yes/no prompt
  • serve updates for my app from a manifest.json on my own static file host

Features

  • release backends: GitHub, GitLab, Gitea, Gitee, S3-compatible storage and a static manifest.json
  • picks the release asset for the running target and replaces the executable in place
  • tar, zip, gzip, xz and bzip2 archive support behind cargo features
  • checksum verification against GitHub's per-asset digests or a SHA256SUMS file
  • zipsign signature verification
  • macOS .app bundle updates installed as one unit, restored on failure
  • reqwest or ureq HTTP clients, rustls or native TLS
  • optional async API on tokio
  • download progress bar and confirmation prompt (can be turned off)
  • ReleaseList API to list available releases

Limitations

  • Doesn't sign or notarize macOS apps: ship an already signed and notarized .app and it keeps what you shipped1
  • Doesn't install .deb or .msi packages: hand the downloaded file to dpkg or msiexec yourself1

Alternatives

The same job

These do what self_update does.

  1. dist (cargo-dist) Shippable application packaging: build, sign and publish release binaries and installers from a git tag

Compare self_update with the top 3