Skip to content

Plugin: updater-zig

Updates the version field in a Zig build.zig.zon manifest. Use it to keep your Zig package version aligned with the SemRel version chosen for the release.

Terminal window
semrel plugin install @semrel/updater-zig

semrel plugin install downloads the binary to .semrel/plugins/ and updates .semrel.lock. Commit .semrel.lock to pin the version for your team.

Pre-built, signed multi-platform images (linux/amd64, linux/arm64) are published on every release:

Terminal window
docker pull ghcr.io/semrels/updater-zig:latest

Verify the image signature with cosign:

Terminal window
cosign verify ghcr.io/semrels/updater-zig:latest \
--certificate-identity-regexp 'https://github.com/SemRels/updater-zig/.github/workflows/release.yml.*' \
--certificate-oidc-issuer https://token.actions.githubusercontent.com
version: 1
plugins:
- uses: @semrel/updater-zig
args:
file: build.zig.zon
NameRequiredDefaultDescription
SEMREL_PLUGIN_FILEnobuild.zig.zonbuild.zig.zon manifest to update.
  • SEMREL_NEXT_VERSION
  • SEMREL_CURRENT_VERSION
  • SEMREL_TAG_NAME
  • SEMREL_DRY_RUN

build.zig.zon is written in ZON (Zig Object Notation): a single anonymous struct literal with no [section] headers, so the updater cannot rely on TOML-style scoping. It tracks brace depth while scanning the file and only rewrites the top-level .version = "..." field — anything nested inside .dependencies = .{ ... } is left untouched. The package identity fields .name and .fingerprint are never modified.

For a 1.4.0 release, the updater changes:

.{
.name = .my_lib,
.version = "1.3.2",
.fingerprint = 0xdeadbeefcafef00d,
.dependencies = .{ ... },
}

to:

.{
.name = .my_lib,
.version = "1.4.0",
.fingerprint = 0xdeadbeefcafef00d,
.dependencies = .{ ... },
}