Skip to content

Plugin: updater-go

Updates a Go source file that exposes the project version. It is typically used to keep a version.go constant in sync with the SemRel release version.

Terminal window
semrel plugin install @semrel/updater-go

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-go:latest

Verify the image signature with cosign:

Terminal window
cosign verify ghcr.io/semrels/updater-go:latest \
--certificate-identity-regexp 'https://github.com/SemRels/updater-go/.github/workflows/release.yml.*' \
--certificate-oidc-issuer https://token.actions.githubusercontent.com
version: 1
plugins:
- uses: @semrel/updater-go
args:
file: version.go
variable: Version
NameRequiredDefaultDescription
SEMREL_PLUGIN_FILEnoversion.goGo source file to update.
SEMREL_PLUGIN_VARIABLEnoVersionVariable or constant name that holds the version string.
  • SEMREL_NEXT_VERSION
  • SEMREL_CURRENT_VERSION
  • SEMREL_TAG_NAME
  • SEMREL_DRY_RUN

For a 1.4.0 release, the updater can change const Version = "1.3.2" to const Version = "1.4.0".