# Releasing Gesprächsrekorder A release consists of: - the Windows NSIS installer (per-user, no admin rights), cross-built on Debian, - the Debian `.deb`, - an updater signature (`.sig`) for each of them, - `latest.json`, the update feed the installed Windows apps read. `scripts/build-release.sh` builds all of this locally into `dist-release//` (gitignored). It never tags, pushes or publishes anything: tagging and creating the Gitea release are manual steps (below). Installed Windows apps check the feed at startup and every 6 hours. If a newer version exists, the main window shows "Update verfügbar (vX.Y.Z) → Installieren & neu starten". Installing is only possible while no recording runs and no call is being processed. The installer then runs in passive mode (progress bar only) and restarts the app. Debian builds do not update themselves. ## One-time setup 1. **Generate the updater key pair** (once, never again): ```sh cargo tauri signer generate -w ~/.tauri/call-recorder.key ``` Pick a password. Keep `~/.tauri/call-recorder.key` and its password safe (e.g. in the password manager) and **never commit it** (the repository is public). If the key is lost, the installed apps cannot be updated anymore: every user would have to install a new version by hand. 2. **Public key**: it is already in `src-tauri/tauri.conf.json` under `plugins.updater.pubkey` (key id `203A35A215098DED`). Change it only if you rotate the key. 3. **Tools** on the Debian build machine: the rustup toolchain with the `x86_64-pc-windows-msvc` target, `cargo-xwin`, `makensis` (NSIS), `tauri-cli` 2 (`cargo tauri`), `pnpm`, `jq`. ## Where releases live: `scripts/release.env` `scripts/release.env` is the single source of truth for the release URLs: - `RELEASE_BASE_URL`: the Gitea repository, `https://gitea.euvino.eu/public/call-recorder`. The download URLs in `latest.json` point to `${RELEASE_BASE_URL}/releases/download/v/`. - `UPDATE_JSON_URLS`: where the app looks for `latest.json`. `build-release.sh` writes them into `plugins.updater.endpoints` in `src-tauri/tauri.conf.json`. Do not edit the endpoints in `tauri.conf.json` by hand. Change `release.env`; the next release build writes them into `tauri.conf.json`. The repository and its releases must be readable without logging in: the app downloads anonymously. ### The feed URL Verified on Gitea 1.27.3: `releases/latest/download/` does **not** redirect to a release's assets, even for the newest non-draft, non-prerelease release — requesting it returns `404`. So the feed lives only at ``` https://gitea.euvino.eu/public/call-recorder/raw/branch/master/latest.json ``` `latest.json` committed to the root of `master`. This makes committing `latest.json` after every release **mandatory**, not optional (step 8 below) — there is no redirect to fall back on. Versions 0.1.0 and 0.1.1 were built with both URLs compiled in (the endpoints are fixed at build time; installed apps keep asking the URLs they were built with). They still try `releases/latest/download/latest.json` first on every check; that is harmless — it 404s and the app falls through to the `raw/branch/master` URL, which answers normally. ## Releasing a version Example: version `0.1.1`. Versions are semantic versions and must be greater than the installed one. The script refuses a version that is not greater than the committed one. The committed version itself is allowed while there is no tag `v` yet, e.g. for the first release `0.1.0`. 1. Start from `master` with no uncommitted changes to tracked files (the script refuses otherwise; untracked files do not matter) and the tests passing (`cargo test --workspace`). If a build failed after the script had set the version, reset that first: `git checkout src-tauri/tauri.conf.json src-tauri/Cargo.toml Cargo.lock ui/package.json`. 2. Build (works in fish and bash; without `TAURI_SIGNING_PRIVATE_KEY_PASSWORD` the script asks for the password): ```sh env TAURI_SIGNING_PRIVATE_KEY_PATH=$HOME/.tauri/call-recorder.key scripts/build-release.sh 0.1.1 ``` The script: - checks that the tree is clean and the version is greater (see above), - checks the key and password by signing a probe file, and stops if the key does not belong to `plugins.updater.pubkey`, - sets the version in `src-tauri/tauri.conf.json`, `src-tauri/Cargo.toml` and `ui/package.json` (the build updates `Cargo.lock` too), and writes the endpoints from `release.env` into `tauri.conf.json`, - builds the Windows installer (`scripts/build-windows.sh`) and the `.deb`, each with its `.sig`, - copies them to `dist-release/0.1.1/` under ASCII names (`Gespraechsrekorder_…`) and writes `latest.json` with `scripts/make-latest-json.sh`. `TAURI_SIGNING_PRIVATE_KEY` (the key itself or a path) works instead of `TAURI_SIGNING_PRIVATE_KEY_PATH`. 3. Check `dist-release/0.1.1/`. It should contain: | File | Purpose | |------------------------------------------------------|--------------------------------------| | `Gespraechsrekorder_0.1.1_x64-setup.exe` (+ `.sig`) | Windows installer and update package | | `Gespraechsrekorder_0.1.1_amd64.deb` (+ `.sig`) | Debian package | | `latest.json` | Update feed | 4. Commit the version bump the script left in the working tree: ```sh git add src-tauri/tauri.conf.json src-tauri/Cargo.toml Cargo.lock ui/package.json git commit -m "chore #: release 0.1.1" ``` 5. Tag and push: ```sh git tag v0.1.1 git push origin master v0.1.1 ``` 6. Create the release `v0.1.1` for the tag on . Do not mark it as a draft or a pre-release, otherwise it is not the "latest" release. 7. Upload the installer, the `.deb` and their `.sig` files from `dist-release/0.1.1/` as release assets, keeping the file names (`latest.json` points to them). `latest.json` itself does not need to be uploaded as a release asset: the feed is served from the committed file (step 8), not from `releases/latest/download/latest.json` (see "The feed URL" above). 8. Only after all assets from step 7 are uploaded and downloadable (their URLs are what the feed will point to), commit the feed: ```sh cp dist-release/0.1.1/latest.json latest.json git add latest.json git commit -m "chore #: update feed 0.1.1" git push origin master ``` Committing `latest.json` is mandatory for every release — it is the only place the feed lives. 9. Check the feed: ```sh curl -sL https://gitea.euvino.eu/public/call-recorder/raw/branch/master/latest.json | jq . ``` It must show the new version, and the `url` entry must download. ## Checking an update on Windows 11 After publishing 0.1.0 and then 0.1.1: 1. Install 0.1.0 as a normal user and start it. 2. Within a few seconds the main window shows "Update verfügbar (v0.1.1) → Installieren & neu starten". 3. Start a manual recording: the button is disabled and the banner says "Nach der laufenden Aufnahme/Verarbeitung möglich". Stop the recording and discard it: the button is enabled again. 4. Click it: the banner shows the download progress. Then the installer shows only a progress bar, asks for no admin rights, and the app restarts as 0.1.1. The banner is gone. The app also shows its main window on the first start of a new version, even if it was started with `--autostart` (the installer restarts it with its old arguments). Failed checks (offline, no release yet) are not shown. They are retried after 1, 5 and 30 minutes, then every 6 hours. The log (`%LOCALAPPDATA%\eu.euvino.callrecorder\logs`) has an Info line `update check failed: …`. ## Notes - `scripts/build-windows.sh` alone builds an unsigned test installer without updater artifacts when no signing key is set. - `RELEASE_ALLOW_DIRTY=1` lets `build-release.sh` build with uncommitted changes to tracked files, and `RELEASE_ALLOW_NOT_NEWER=1` lets it build a version that is not greater than the committed one. Use them only for test builds; never publish one. - `RELEASE_ALLOW_KEY_MISMATCH=1` lets `build-release.sh` build with a key that does not match `plugins.updater.pubkey`. Use it only to test the pipeline with a throwaway key. Installed apps reject such a release, so never publish it. - `latest.json` only lists `windows-x86_64`. Debian installs from the `.deb` and does not self-update, so Linux has no entry in the feed.