The installer and the release flow
Two scripts, both in scripts/ (ADMIN-10): release-stack.sh makes a release, install.sh installs, updates, rolls back and removes it. Neither tags, pushes or...
Two scripts, both in scripts/ (ADMIN-10): release-stack.sh makes a release, install.sh installs, updates, rolls back and removes it. Neither tags, pushes or publishes anything. The first release, v0.1.0, was published on GitHub with the tarball, SHA256SUMS and install.sh attached. Home's own installer is a separate path, described in integrations.md; this is for a Stack with no Home.
Make a release
bash scripts/release-stack.sh v0.1.0The tag must look like v0.1.0 (letters, digits, dots, dashes and underscores only). The script runs scripts/build-binary.sh into a temporary folder (SKIP_VERIFY=1 by default, since the live verify downloads models; run it by hand), then writes to release/:
maipai-stack-<tag>-<platform>-<arch>.tar.gz, one folder inside holding the binary,admin-ui/,migrations/,ort-wasm/,backend-src/and aVERSIONfile.SHA256SUMS, one line per tarball. Lines for other platforms of the same tag are kept.install.sh, a copy of the installer.
BUILD_DIR=<dir> reuses an existing build and skips the compile. RELEASE_DIR=<dir> writes elsewhere. The build needs bun, and scripts/build-binary.sh expects the sibling getmaipai/commons checkout the backend's file: dependencies point at.
To publish, create a GitHub release for the tag on this repo and attach the tarball and SHA256SUMS. install.sh downloads from https://github.com/getmaipai/stack/releases/download/<tag>/. Set STACK_RELEASE_BASE_URL to use another host or a file:// folder that holds <tag>/SHA256SUMS and the tarball.
Install, update, roll back, remove
bash scripts/install.sh install --tag v0.1.0
bash ~/.maipai-stack/install.sh update --tag v0.2.0
bash ~/.maipai-stack/install.sh rollback
bash ~/.maipai-stack/install.sh status
bash ~/.maipai-stack/install.sh uninstall [--remove-data]- Download. The only network use is
SHA256SUMSand the tarball. The tarball's checksum is verified before anything is unpacked.--sha256 <value>pins it against a value you got elsewhere, which matters because the checksum list comes from the same host as the tarball. - Layout under the prefix (default
~/.maipai-stack, orSTACK_PREFIX, or--prefix):releases/<tag>/holds one build each,currentlinks to the running one,previousto the build before the last update,data/holds the Stack's data and is never touched by update or rollback. - Service.
installruns the binary's owninstall-service: a launchd agentcom.maipai.stackon macOS, asystemd --userunit on Linux. The installer writes no unit.STACK_SERVICE_LABELchanges the label. - Update points
previousat the old build andcurrentat the new one, restarts, and waits for/healthzfor about 30 seconds. If it does not answer,updatepointscurrentback, restarts, and exits with the reason. A passing update prunes every build exceptcurrentandprevious. - Rollback swaps
currentandprevious, so running it again returns. - First run. After a healthy start the Stack writes
<data>/admin-setup-code(mode 0600).installprints the admin addresshttp://127.0.0.1:<port>/admin/and the file path.
Environment: STACK_PREFIX, STACK_PORT (default 8770), STACK_RELEASE_BASE_URL, STACK_BUN_BIN (the bun the stt worker runs through, found on PATH if unset), STACK_SERVICE_LABEL.
Tests and what is untried
backend/tests/standaloneInstall.test.ts drives the scripts against a fake build and a file:// release folder. The real macOS run (install, /admin/ answers 200, update, rollback, a bad tag, a tampered checksum, uninstall) was done in a scratch prefix and port. The Linux systemd path is untried on a Linux machine. PINNED_TAG in install.sh is v0.1.0, so the installer attached to a release installs that release with no --tag. Raise it in the commit you tag for each new release. There is no stack update command in the binary: the engine pin-and-rollback code swaps engines, not the Stack's own binary.

