drivine, drivine4j and drivine-python are released the same way, by CI. Each repository has this file, differing only in its publish step. Each library keeps its own version. A release train, named by date ("Drivine 2026.11"), records which versions of the three, and which Cypher spec tag, ship together. The train controller, liberation-data/drivine-release, runs the steps below in all three repositories at once.
- Prepare release. In the Actions tab, run "Prepare release" (
.github/workflows/prepare-release.yml) with abumpofpatch,minor,majororprerelease, or an exactversion. It bumps the version (build.gradle / package.json / pyproject.toml) on a branchrelease/vX.Y.Z, and opens a PR "Release vX.Y.Z" that lists the commits since the last tag. - Review and merge the release PR. It passes CI like any other PR. Merging it is the release point.
- CI publishes. The merge, a push to the default branch that changes the version file, runs
.github/workflows/release.yml. It runs the full gate, unless CI has already passed on the same tree, builds, checks, publishes, and creates the GitHub release with its tagvX.Y.Zon the merge commit. Nothing is built from a laptop. - Credentials. Repository secrets or trusted publishing (OIDC), held in a GitHub environment named
release. Give that environment required reviewers: now that merging publishes, their approval of the run is the human checkpoint before anything goes out.
A PR that "Prepare release" opens with the default GITHUB_TOKEN starts no workflows, so CI doesn't run on it by
itself. Push an empty commit to its branch, or close and reopen it, to start CI. With a RELEASE_PR_TOKEN secret set
(below), the PR is opened with that token and CI runs. "Prepare release" fails, saying why, when the version is
already tagged, isn't later than the last release, or its release/vX.Y.Z branch already exists.
Tagging by hand is the fallback. A pushed tag vX.Y.Z still releases the tagged commit. Use it when a
merge didn't release, for example when the bump was merged before the release machinery was in place:
git switch master && git pull
git tag vX.Y.Z
git push origin vX.Y.Z
checkworks out the version: the tag without itsvon a tag push, or the build file's version otherwise.- On a push to the default branch that changes the version file, it releases when the version is new: no tag
vX.Y.Zexists yet, and the version is later than everyvX.Y.Ztag (a prereleasevX.Y.Z-rc.Nsorts belowvX.Y.Z). Otherwise the run releases nothing, and its notice says why: a change to the file that isn't a version bump, for example. - On a tag push it fails, saying why, unless the tag is
vX.Y.Z(orvX.Y.Z-suffix), its version equals the build file's, and the tagged commit is on the default branch.
- On a push to the default branch that changes the version file, it releases when the version is new: no tag
trustlooks for aci.ymlrun that has already passed on the git tree being released (git rev-parse HEAD^{tree}of the commit the run checked out), so thatgateneedn't run CI again. Trees are compared, not commits: a squash merge of a release PR that was up to date with the default branch has the tree its pull request run tested.scripts/ci-trust.jsdoes it, reading the GitHub API withactions: read.- A run counts when it is from a push or a pull request (the nightly, which runs without the pins, doesn't), its
head commit has this tree, and every job of its latest attempt concluded success. A pull request run tests the
pull request's merge ref, not its head, so
ci.yml's first job records the tree it checked out as an artifact,ci-tree-<tree>, and a pull request run counts only when it recorded this tree as well. A pull request run that left out the nightly suites, as one not labelledfull-cidoes, recordsci-tree-pr-set-<tree>and doesn't count; "Prepare release" labels its PRfull-ci. A run of a fork's pull request is believed for the same reason: its head has this tree, so theci.ymlit ran is the one being released. - When one has passed,
gateis skipped. When one is still going, as the push run on the merge commit is when the release starts beside it,trustwaits for it, up to an hour: if it passesgateis skipped, and if it fails or is cancelled the release fails, linking it. Re-running the release's failed jobs then runsgate, unless that CI run has been re-run too, whichtrustthen waits for or trusts. When none counts, or the wait runs out, or the API can't be asked,gateruns as before. - The run's summary links the run trusted, or says of each run it looked at why it didn't count.
- A run counts when it is from a push or a pull request (the nightly, which runs without the pins, doesn't), its
head commit has this tree, and every job of its latest attempt concluded success. A pull request run tests the
pull request's merge ref, not its head, so
gateruns the repository's full CI,ci.ymlwithfull: true, nightly suites included, unlesstrustfound it has already passed on this tree. A push to the default branch that releases nothing skips both, asci.ymlruns on that push anyway.buildbuilds the release artifacts from the checked-out ref, checks them, runs a smoke test, and uploads them as the run's artifact.publishruns on a release alone, in thereleaseenvironment. It publishes the exact filesbuildmade.github-releasethen creates the GitHub release, with generated notes, marked a prerelease when the version has a-suffix. On a push to the default branch it also creates the tagvX.Y.Z, on the commit that was released. A tag made this way starts no workflow, so it doesn't release again.
A tag that fails check publishes nothing. Delete it (git push origin :refs/tags/vX.Y.Z), fix what the message
says, and tag again. A tag pushed by hand for a version that merging has already released fails in build, as the
registry already has that version; nothing is published twice. If a release failed after publishing, re-run its
failed jobs.
A dry run is everything but publish and github-release. Run it from the Actions tab (Release, Run workflow,
on any branch or tag), and it runs by itself on a pull request that changes the release machinery, a release PR
included. Only a merged version bump or a pushed tag publishes. trust skips its gate as it does a release's: a
manual run on the default branch trusts the push run on its commit, and a pull request's dry run the pull request's
own run, when the pull request is up to date with its base.
- Version:
versioninpackage.json. The tag must bevand that version, character for character:v3.4.0for3.4.0.package-lock.jsonrecords the version too; Prepare release updates both withnpm version --no-git-tag-version --ignore-scripts. The model files,sample/.drivine/model.jsonandtest/1.Unit/codegen/fixture/.drivine/model.json, name it as their generator's, and a unit test fails when they aren't what the generator writes now, so Prepare release then runsnode scripts/release-version.js refs <version>, which sets it in each and fails when one isn't where it expects. A new file that names the version goes in that script'sREFERENCES. - Push trigger: a push to
masterthat changespackage.json. - Build:
npm cithennpm run build, which makesdist/: the compiled package, withpackage.json, the README and the licence copied in.dist/is what is published. - Checks:
dist/package.jsonis the version being released.npm pack ./distholds the entry points (index.js,index.d.ts,codegen/cli.js,testing/andnest/) and no sources or tests. The smoke test installs the tarball into an empty project, loads the package and runsdrivine --help. Thennpm publish ./dist --dry-run.buildfails a release whose version npm already has. npm refuses even a dry run of a version it has, so a dry run on a released version tries a copy under a throwaway versionX.Y.Z-dryrun.<run id>, with--dry-runstill: nothing is published. - Publish:
npm publish ./dist --provenance --access public, with npm 11.21.1 (trusted publishing needs 11.5.1 or later). A prerelease (v3.4.0-rc.1) is published under thenextdist-tag, solateststays on the last release. - Dry run: leaves two artifacts on the run:
dist, the directory that would be published, andnpm-package, the tarball with its file list.
The same checks, locally, publishing nothing:
npm ci && npm run build
npm pack ./dist --dry-run
- GitHub: Settings, Environments, a
releaseenvironment, with required reviewers. Its deployment branches and tags, if limited, must allow both the branchmaster(a merged bump) and the tagsv*(a tag pushed by hand). - GitHub Actions and PRs: Settings, Actions, General, "Allow GitHub Actions to create and approve pull requests",
so "Prepare release" can open its PR with
GITHUB_TOKEN. - Optional, a
RELEASE_PR_TOKENsecret: a fine-grained personal access token with Contents and Pull requests read and write on this repository. "Prepare release" pushes its branch and opens its PR with it, so CI runs on the PR. The train controller passes its own token the same way. - npm trusted publishing: on npmjs.com,
@liberation-data/drivine, Settings, Trusted publishing, a GitHub Actions publisher with organizationliberation-data, repositorydrivine, workflowrelease.ymland environmentrelease. No token is held then. Once a release has gone out this way, the package's publishing access can be set to disallow tokens. - Or an
NPM_TOKENsecret in thereleaseenvironment: an npm granular access token that can publish@liberation-data/drivine. It is used only when it is set, and only if trusted publishing isn't configured.