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#

  1. As changes land, write them in CHANGELOG.md under ## 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.

  2. Run Prepare Release on main with a bump (patch, minor, major) or an explicit version (1.2.3, or a pre-release such as 0.9.0rc1). It:

    1. works out the version (make next-version) and fails if it is not newer than the current one,

    2. fails if ## Unreleased has no entries (make changelog-release),

    3. runs every test (make test: service tests, JS unit tests, the UI smoke test and screenshots),

    4. runs make release: turns ## Unreleased into ## vX.Y.Z - <date> (with a fresh, empty ## Unreleased above it), sets neuralui/version.py, commits “Release X.Y.Z”, tags vX.Y.Z and pushes both to main in one atomic push.

  3. The tag push starts Release (.github/workflows/release.yml). Its build job, with a read-only token:

    1. checks the tagged commit is on main, and the tag matches neuralui/version.py (make check-version),

    2. takes the release notes from the version’s CHANGELOG entry (make release-notes; no entry, no release),

    3. runs the service tests (make test-svc), builds the sdist and wheel (make build-py) and the docs site (make docs, packed as docs.tar.gz).

    Then its publish job, the only one with write permissions:

    1. builds the container image and pushes it to ghcr.io/<owner>/neuralui:X.Y.Z (and :latest for 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),

    2. creates the GitHub release with the notes, the Python packages and docs.tar.gz (pre-releases are marked as such),

    3. tells docs.gormo.co, which pulls the release’s docs.tar.gz into docs.gormo.co/neuralui/ (with DOCS_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:

  1. 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, owner gormaniac, repository neuralui, workflow release.yml, environment pypi.

  2. In this repository, Settings → Environments → New environment pypi. Optionally limit it to v* 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 on gormaniac/docs.gormo.co (repository dispatch needs it), as the other projects there use. The docs site also needs NeuralUI in its projects.txt, and its DOCS_RELEASE_TOKEN must 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 version prints it). The Python package, the neuralui Storm 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 neuralui Storm package in the Cortex is updated by the service when it reconnects (it is registered with service.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.