shared-zerv-versioning.yml,
that installs zerv, generates ZERV RON for the current commit, and emits every format you
configure as job outputs.
Basic usage
Call it from any workflow in your repository:versions is a JSON object mapping each output name to its rendered version string:
Inputs
Keys must be unique across the three output inputs: the workflow fails on duplicates.
Under the hood the workflow pins the version to the event metadata (pull request head SHA
and branch name via
--bumped-branch / --bumped-commit-hash) rather than whatever the
runner checked out, so PR builds are versioned even before merge. It uses
actions/checkout with fetch-depth: 0 and installs zerv via uv tool install zerv-version
followed by uv tool upgrade --all, so a cached install still picks up the latest release.
Three ways to shape an output
The three output inputs (output_formats, output_templates, custom_outputs) each map an
output name to one shaping mechanism:
1. output_formats: a named output format:
output_templates: a Tera template per output:
custom_outputs: full zerv command arguments, for anything that needs more than one
flag (e.g. a custom schema):
branch.distance.g<hash>) traces any artifact back to the exact commit. The
fan-out pattern works the same way
locally.
Pin the version
Reference the workflow by a release tag rather thanmain so CI updates are deliberate:
cd.yml for a live
example.
Where to go next
- Coexisting with semantic-release - zerv for CI builds, semantic-release for releases
- zerv-flow - working demo repo: PR pre-release tags and multi-environment deploys