Plugin: updater-pubspec
Updates the top-level version: field in pubspec.yaml for Dart and Flutter projects, with configurable Flutter +build suffix strategies (none, increment, or release-count).
Installation
Section titled “Installation”Binary
Section titled “Binary”semrel plugin install @semrel/updater-pubspecsemrel plugin install downloads the binary to .semrel/plugins/ and updates .semrel.lock. Commit .semrel.lock to pin the version for your team.
Docker
Section titled “Docker”Pre-built, signed multi-platform images (linux/amd64, linux/arm64) are published on every release:
docker pull ghcr.io/semrels/updater-pubspec:latestVerify the image signature with cosign:
cosign verify ghcr.io/semrels/updater-pubspec:latest \ --certificate-identity-regexp 'https://github.com/SemRels/updater-pubspec/.github/workflows/release.yml.*' \ --certificate-oidc-issuer https://token.actions.githubusercontent.comConfiguration
Section titled “Configuration”version: 1plugins: - uses: @semrel/updater-pubspec phase: pre-tag args: pubspec_path: pubspec.yaml pubspec_build_strategy: incrementEnvironment Variables
Section titled “Environment Variables”| Name | Required | Default | Description |
|---|---|---|---|
SEMREL_PLUGIN_PUBSPEC_PATH | no | ./pubspec.yaml | Path to the pubspec.yaml file to update. |
SEMREL_PLUGIN_PUBSPEC_BUILD_STRATEGY | no | none | Build suffix strategy: none, increment, or release-count. |
SEMREL_PLUGIN_PUBSPEC_BUILD_NUMBER | no | — | Explicit build number override (<semver>+<number>). |
Release Context Variables
Section titled “Release Context Variables”SEMREL_VERSIONSEMREL_NEXT_VERSIONSEMREL_DRY_RUNSEMREL_RELEASE_COUNTSEMREL_BUILD_NUMBER
Behavior
Section titled “Behavior”The plugin performs a surgical line-based update of the top-level version: key so comments, indentation, and dependency blocks remain untouched:
none(default): Writes bare SemVer (e.g.version: 1.5.0).increment: Increments the existing+buildsuffix (e.g.1.4.0+42→1.5.0+43), starting at+1if none exists.release-count: UsesSEMREL_PLUGIN_PUBSPEC_BUILD_NUMBER,SEMREL_RELEASE_COUNT, orSEMREL_BUILD_NUMBER(falling back toexisting + 1).