docs: build and release for the Rust app

This commit is contained in:
Andy Dixon
2026-10-11 17:14:40 +01:00
parent b1e18a8ffb
commit f80374db77
+49 -55
View File
@@ -1,80 +1,74 @@
# Build and Release # Build and Release
This project uses [Wails](https://wails.io/) for desktop packaging. Nexus Terminal is a Rust workspace in `rust/`:
## Ubuntu 24.04 prerequisites ```
rust/
Install the Linux build toolchain and Wails runtime headers with: ├── core/ nexus-core: storage, secrets, protocol clients, session manager, Service. No GUI.
└── app/ nexus: the egui desktop app (binary `nexus-terminal`)
```bash
sudo apt-get update
sudo apt-get install -y \
build-essential \
libgtk-3-dev \
libwebkit2gtk-4.1-dev \
libayatana-appindicator3-dev \
pkg-config \
zip
``` ```
Notes: The toolchain is pinned in `rust/rust-toolchain.toml`; `rustup` installs it on first build.
- Ubuntu 24.04 does not ship `libwebkit2gtk-4.0-dev`. ## Prerequisites
- Wails `v2.12.0` supports Ubuntu 24.04 by building with the `webkit2_41` tag.
- The local build scripts detect that package layout automatically and add the tag when needed.
You will also need these tools available in `PATH`: - **All platforms:** [rustup](https://rustup.rs).
- **Linux:** the X11/Wayland/GL headers eframe links against, and GTK for native file dialogs:
- `go`
- `node`
- `npm`
- `wails`
Install the Wails CLI with:
```bash ```bash
go install github.com/wailsapp/wails/v2/cmd/wails@latest sudo apt-get install -y build-essential pkg-config libxkbcommon-dev libgl1-mesa-dev \
export PATH="$PATH:$(go env GOPATH)/bin" libx11-dev libxcursor-dev libxrandr-dev libxi-dev libwayland-dev libgtk-3-dev zip
``` ```
## Build commands - **macOS:** Xcode command-line tools (`xcode-select --install`).
- **Windows:** the MSVC build tools (Visual Studio Build Tools, "Desktop development with C++").
Build the app binary for the current host: There are no runtime C libraries to install: SQLite is compiled in and TLS uses rustls.
## Build and run
```bash ```bash
./build.sh cd rust
cargo run --release # the app
cargo test --workspace # unit and integration tests
cargo clippy --workspace -- -D warnings
``` ```
Build packaged releases for every supported 64-bit desktop target: Useful flags (also handy for testing): `nexus-terminal [--theme pro|midnight|light]
[--data-dir DIR] [--screenshot out.png] [--size WxH] [--run-local CMD]`. `--data-dir` points at
another data directory; `--screenshot` renders the window, saves a PNG and exits (works under
`xvfb-run`); `--run-local` opens a local terminal and types `CMD` into it.
The SSH integration tests start a throwaway `sshd` as the current user on a random port; they
skip themselves when OpenSSH isn't installed.
## Release packages
```bash ```bash
./release.sh cd rust
./release.sh # this machine's platform
NEXUS_RELEASE_TARGETS=linux/amd64,windows/amd64 ./release.sh
``` ```
By default, `./release.sh` builds all six OS/architecture combinations: Artefacts land in `build/releases/<version>/` at the repo root:
- macOS (`darwin`): `amd64` and `arm64` - `NexusTerminal-<os>-<arch>.zip` — on macOS a universal-capable `.app` bundle
- Linux: `amd64` and `arm64` (`rust/packaging/macos/build-app.sh`), on Windows the `.exe` (icon and version info embedded,
- Windows: `amd64` and `arm64` GUI subsystem), on Linux the binary plus `install.sh` and a `.desktop` entry
(`rust/packaging/linux/install.sh` installs into `~/.local`).
- `manifest-<os>-<arch>.json` and `version-<os>-<arch>.txt` for the update server
(`updates/index.php`), in the same format as before.
Go calls the x86-64 architecture `amd64` and the AArch64 architecture `arm64`. The version is `<latest tag>-<short commit>` unless `NEXUS_VERSION` is set. The update manifest
URL is compiled in from `NEXUS_UPDATE_URL` (default in `release.sh`); `{platform}` and `{arch}` use
the old Go names (`darwin`/`linux`/`windows`, `amd64`/`arm64`).
On macOS, Linux builds run in architecture-matched Podman or Docker containers Cross-building `windows/amd64` from Linux works with `x86_64-pc-windows-gnu` and mingw-w64.
because Wails does not cross-compile Linux applications directly from macOS. macOS bundles must be built on a Mac. CI (`.github/workflows/release-builds.yml`) builds every
The reusable builder images keep their `node_modules` separate from the host platform natively on GitHub runners and attaches the zips to tagged releases;
checkout. `.github/workflows/ci.yml` runs tests and clippy on Linux, macOS and Windows.
## Optional targeted builds ## Signing
The release scripts disable CGO and use a pure-Go SQLite driver, so Linux and Windows cross-targets do not need C cross-compilers for the application backend. To build a smaller set, override the default targets: macOS bundles are ad-hoc signed. For distribution, sign with a Developer ID and notarize (see the
comments in `build-app.sh`). Windows binaries are unsigned.
```bash
LINK_RELEASE_TARGETS=linux/amd64,windows/amd64 ./release.sh
```
## Platform caveats
- To produce all six targets in one run, use macOS with Podman or Docker running.
- macOS targets cannot be cross-built from Linux or Windows with Wails.
- Cross-target support still depends on Wails and frontend packaging support for the requested platform.
- Tested on Ubuntu 24.04 `amd64`: `linux/amd64` and `windows/amd64` build successfully.