Files
call-recorder/RELEASING.md
T
haukeandClaude Opus 5.5 bda584deda feat #14740: fallback update endpoint
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-11-06 11:41:12 +01:00

200 lines
8.2 KiB
Markdown

# Releasing Gesprächsrekorder
A release consists of:
- the Windows NSIS installer (per-user, no admin rights), cross-built on Debian,
- the Debian `.deb` and `.AppImage`,
- 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/<version>/`
(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<version>/<file>`.
- `UPDATE_JSON_URLS`: where the app looks for `latest.json`. `build-release.sh`
writes them, in this order, 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 two feed URLs
The app tries the endpoints in order and uses the first one that returns a release.
A `404` or a network error on one moves on to the next one:
1. `https://gitea.euvino.eu/public/call-recorder/releases/latest/download/latest.json`:
`latest.json` as an asset of the newest release (not a draft, not a pre-release).
This works only if Gitea redirects `releases/latest/download/<file>` to the newest
release.
2. `https://gitea.euvino.eu/public/call-recorder/raw/branch/master/latest.json`:
`latest.json` committed to the root of `master`.
Each release serves both:
- uploading the release assets covers URL 1 (step 7 below);
- committing `latest.json` to the root of `master` covers URL 2 (step 8 below).
The endpoints are compiled into the app. Installed versions keep asking the URLs
they were built with, which is why both are configured from the start.
After the first release, check which URL works:
```sh
curl -sIL https://gitea.euvino.eu/public/call-recorder/releases/latest/download/latest.json
curl -sIL https://gitea.euvino.eu/public/call-recorder/raw/branch/master/latest.json
```
The final status of a working URL is `200`. Then:
- **URL 1 works:** a later version may drop URL 2 from `UPDATE_JSON_URLS`. Every
installed version also asks URL 1, so step 8 is no longer needed.
- **Only URL 2 works:** a later version may drop URL 1. Step 8 (committing
`latest.json`) stays part of every release.
Caveat: if URL 1 answered `200` with something that is not JSON (e.g. an HTML page),
the updater would stop there instead of trying URL 2. Gitea answers a missing file
with `404`, which falls through as intended.
## Releasing a version
Example: version `0.1.1`. Versions are semantic versions and must be higher than the
installed one.
1. Start from a clean `master` with the tests passing (`cargo test --workspace`).
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 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`), the `.deb` and the
`.AppImage`, 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 |
| `Gespraechsrekorder_0.1.1_amd64.AppImage` (+ `.sig`) | Debian AppImage |
| `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 #<wp>: 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
<https://gitea.euvino.eu/public/call-recorder/releases/new>. Do not mark it as a
draft or a pre-release, otherwise it is not the "latest" release.
7. Upload **every** file from `dist-release/0.1.1/` as a release asset, including the
`.sig` files and `latest.json`. Keep the file names: `latest.json` points to them.
8. Once the assets are uploaded, publish the feed for URL 2 as well:
```sh
cp dist-release/0.1.1/latest.json latest.json
git add latest.json
git commit -m "chore #<wp>: update feed 0.1.1"
git push origin master
```
9. Check the feed:
```sh
curl -sL https://gitea.euvino.eu/public/call-recorder/releases/latest/download/latest.json | jq .
curl -sL https://gitea.euvino.eu/public/call-recorder/raw/branch/master/latest.json | jq .
```
The URL(s) that work must show the new version, and the `url` entries 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.
Failed checks (offline, no release yet) are not shown. 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_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` also lists the AppImage (`linux-x86_64`). The Debian builds do not
check for updates yet.