Template repository for SemRels plugins built as standalone Go subprocess binaries.
This template reflects the current SemRels plugin architecture: semrel executes a plain Go CLI binary as a subprocess, passes plugin configuration through SEMREL_PLUGIN_* variables, passes release context through SEMREL_* variables, reads plugin output from standard output, and treats exit code 0 as success and any non-zero exit code as failure. There is no gRPC transport, no network listener, and no protobuf plumbing to wire up.
The scaffolded example is intentionally phase-agnostic. It reads SEMREL_VERSION and SEMREL_DRY_RUN, writes the required schema handshake to standard error, and prints a confirmation message to standard output:
stderr: plugin_schema_version=1
stdout: example plugin invoked for version 1.2.3 (dry-run: false)
| Item | Behavior |
|---|---|
plugin_schema_version=1 |
The first line written to stderr must be plugin_schema_version=1. |
SEMREL_VERSION |
Required release version for this example plugin. |
SEMREL_DRY_RUN |
Optional boolean (true/false) indicating dry-run mode. |
SEMREL_PLUGIN_* |
Reserved for your phase-specific plugin configuration. |
| stdout | Write the plugin's functional output here. |
| stderr | Write diagnostics, validation errors, and logs here. |
| exit code | 0 means success; any non-zero code means failure. |
cmd/plugin/ Thin environment-variable wrapper and process entry point
internal/plugin/ Pure, testable plugin logic with no os/env dependencies
.github/workflows/ CI, release, security, template-sync, and semrel self-release automation
.semrel.yaml semrel dogfooding configuration for this repository
- Create a new repository from this template or copy it into your plugin repository.
- Rename the Go module in
go.modtogithub.com/SemRels/<your-plugin-repo>. - Rename the binary/package descriptions from
plugin-templateto your plugin name. - Implement your phase-specific logic in
internal/plugin/as pure Go. - Keep
cmd/plugin/main.gothin: readSEMREL_*/SEMREL_PLUGIN_*withos.Getenv(or an injectedgetenvin tests), translate them into a config struct, then call the internal package. - Extend the README tables with every
SEMREL_PLUGIN_*andSEMREL_*variable your plugin consumes. - Update
.semrel.yamland replace the example phase assignment comments/configuration with the plugins and phases your real plugin release process needs.
go build ./...
go test ./...plugins:
- name: example-plugin
path: ~/.semrel/plugins/semrel-plugin-example
env:
SEMREL_PLUGIN_SAMPLE_OPTION: "value"Apache-2.0