Releasing NeuralUI#
A release is an annotated git tag vX.Y.Z on main, made by Actions → Prepare Release → Run workflow.
Nobody pushes tags by hand. Every step is a make target (see the Makefile), so a release can also be cut
locally with the same code.
Cutting a release#
As changes land, write them in
CHANGELOG.mdunder## Unreleased(### Features,### Fixes, or another###heading such as### Security). If a stored format changed, bump its version, add the migration (see FORMATS.md) and say so there.Run Prepare Release on
mainwith a bump (patch,minor,major) or an explicit version (1.2.3, or a pre-release such as0.9.0rc1). It:works out the version (
make next-version) and fails if it is not newer than the current one,fails if
## Unreleasedhas no entries (make changelog-release),runs every test (
make test: service tests, JS unit tests, the UI smoke test and screenshots),runs
make release: turns## Unreleasedinto## vX.Y.Z - <date>(with a fresh, empty## Unreleasedabove it), setsneuralui/version.py, commits “Release X.Y.Z”, tagsvX.Y.Zand pushes both tomainin one atomic push.
The tag push starts Release (
.github/workflows/release.yml). Its build job, with a read-only token:checks the tagged commit is on
main, and the tag matchesneuralui/version.py(make check-version),takes the release notes from the version’s CHANGELOG entry (
make release-notes; no entry, no release),runs the service tests (
make test-svc), builds the sdist and wheel (make build-py) and the docs site (make docs, packed asdocs.tar.gz).
Then its publish job, the only one with write permissions:
builds the container image and pushes it to
ghcr.io/<owner>/neuralui:X.Y.Z(and:latestfor releases without a pre-release suffix) (make build-docker,make push-docker), with signed build provenance once the repository is public (gh attestation verify oci://ghcr.io/<owner>/neuralui:X.Y.Z --repo <owner>/neuralui; GitHub keeps no attestations for a user’s private repository),creates the GitHub release with the notes, the Python packages and
docs.tar.gz(pre-releases are marked as such),tells docs.gormo.co, which pulls the release’s
docs.tar.gzintodocs.gormo.co/neuralui/(withDOCS_DISPATCH_TOKEN; not for pre-releases).
Last, its pypi job publishes the same Python packages to PyPI with trusted publishing (below).
A failed Release can be run again for its tag with the workflow as it is on
main: Actions → Release → Run workflow, with the tag (v1.2.3).
The container image is the main way to install NeuralUI; PyPI is there for those who install with pip.
The RELEASE_TOKEN secret#
Prepare Release pushes the release commit and tag with the RELEASE_TOKEN repository secret, not
GITHUB_TOKEN: a tag pushed with GITHUB_TOKEN would not start the Release workflow. Use a fine-grained
personal access token for this repository with Contents: read and write (and Workflows: read and
write if a release could ever touch .github/workflows/). Once main is protected, the token’s account
must also be allowed to bypass the protection rule (or the rule must let it push), or the release push is
refused.
PyPI: trusted publishing#
No PyPI token is stored: PyPI trusts the Release workflow of this repository, run in its pypi
environment, to publish the neuralui project. Set up once:
On PyPI, Your projects → Publishing → Add a new pending publisher (before the first release; for an existing project, its Settings → Publishing): PyPI project name
neuralui, ownergormaniac, repositoryneuralui, workflowrelease.yml, environmentpypi.In this repository, Settings → Environments → New environment
pypi. Optionally limit it tov*tags (deployment branches and tags) and add yourself as a required reviewer, so each PyPI upload waits for an approval.
The first release after that creates the project on PyPI. If the pypi job fails (the publisher is not
set up yet, say), the image and GitHub release are already out: fix it and run Release again for the
tag (below), or re-run the failed job.
The other secret#
DOCS_DISPATCH_TOKEN(optional: without it, that step says so and is skipped): a fine-grained token with Contents: read and write ongormaniac/docs.gormo.co(repository dispatch needs it), as the other projects there use. The docs site also needs NeuralUI in itsprojects.txt, and itsDOCS_RELEASE_TOKENmust be able to read this repository’s releases while it is private.
Pinned build inputs#
Every action in the workflows is pinned by commit SHA, the container’s base image by digest, and the
image’s Python dependencies by version and hash in requirements.lock (make lock remakes it from
pyproject.toml). Dependabot (.github/dependabot.yml) proposes updates to all three each week. Once the
repository allows it, add a tag ruleset so only the release account can create v* tags.
Locally#
The same steps, from a clean checkout of main with push access:
make next-version BUMP=minor # e.g. 0.9.0
make test # needs make setup and make setup-ui
make release VERSION=0.9.0 # CHANGELOG, version, commit, tag, push
make release refuses a working tree with changes, a tag that already exists, and an empty
## Unreleased.
Version numbers#
The version is set in one place,
neuralui/version.py(make versionprints it). The Python package, theneuraluiStorm package and the UI build id all follow it.While NeuralUI is 0.x, a minor release (0.6.0) may change behavior or stored formats; a patch release (0.5.1) only fixes bugs.
Pre-releases use a suffix:
0.6.0rc1. They get an image tag but not:latest. A patch, minor or major bump from a pre-release releases it (0.6.0rc1 → 0.6.0).
Upgrading a deployment#
Container: pull the new image and restart. The service directory (
/vertex/storage) carries over; the store migrates itself on start.pip: install the wheel attached to the GitHub release (
pip install --upgrade neuralui-X.Y.Z-py3-none-any.whl), then restart the service. (NeuralUI is not published to PyPI.)The
neuraluiStorm package in the Cortex is updated by the service when it reconnects (it is registered withservice.add); nothing to do in the Cortex.Open browsers show a “NeuralUI has been updated” banner and reload with their tabs kept.
Downgrading is not supported once a newer version has migrated the store; keep a backup of the service directory before upgrading.