Skip to content

gRPC API

The semrel plugin contract is defined in api/proto/v1/semantic_release.proto. All plugin types implement one or more of the services described below.

FieldTypeDescription
majoruint32Major version component
minoruint32Minor version component
patchuint32Patch version component
pre_releasestringPre-release identifier, e.g. alpha.1, rc.2
build_metadatastringBuild metadata, e.g. 20240101
FieldTypeDescription
shastringFull commit SHA
raw_messagestringRaw commit message (subject + body)
files_changed[]stringPaths of files changed in this commit
author_namestringCommit author display name
author_emailstringCommit author email address
timestampint64Unix timestamp (seconds)

Passed to every plugin RPC. Contains all information a plugin needs.

FieldTypeDescription
repo_ownerstringRepository owner
repo_namestringRepository name
repo_urlstringClone URL
branchstringBranch being released
last_versionSemanticVersionLast released version (empty if none)
next_versionSemanticVersionNext calculated version
commits[]CommitCommits since last release
dry_runboolWhen true, plugins must not apply side-effects
configmap<string, string>Plugin args from .semrel.yaml

Abstracts VCS platform operations (GitHub, GitLab, Gitea, bare git).

Returns the last released version and its tag SHA.

rpc GetLastRelease(GetLastReleaseRequest) returns (GetLastReleaseResponse);
Response fieldTypeDescription
versionSemanticVersionLast release. Empty if no prior release exists
tag_shastringSHA of the corresponding git tag object

Returns all commits between a given ref and HEAD.

rpc GetCommitsSince(GetCommitsSinceRequest) returns (GetCommitsSinceResponse);
Request fieldTypeDescription
ctxReleaseContextRelease context
since_shastringSHA to start listing from (exclusive)

Creates (or updates) the VCS release and git tag for next_version.

rpc CreateRelease(CreateReleaseRequest) returns (CreateReleaseResponse);
Request fieldTypeDescription
ctxReleaseContextRelease context
changelogstringRendered release notes from ChangelogGeneratorPlugin

Uploads a release artifact to an existing release.

rpc UploadAsset(UploadAssetRequest) returns (UploadAssetResponse);
Request fieldTypeDescription
release_idstringPlatform-specific release identifier from CreateRelease
asset_pathstringAbsolute path on the local filesystem
asset_namestringDisplay name / filename in the release
content_typestringMIME type of the asset

Verifies the release is running in an authorised CI environment.

rpc VerifyConditions(VerifyConditionsRequest) returns (VerifyConditionsResponse);
Response fieldTypeDescription
error_messagestringNon-empty means abort. Empty means OK
detailsstringHuman-readable remediation hint

Parses commits and determines the required SemVer bump.

ValueDescription
BUMP_LEVEL_NONENo release required
BUMP_LEVEL_PATCHPatch increment (e.g. 1.0.01.0.1)
BUMP_LEVEL_MINORMinor increment (e.g. 1.0.01.1.0)
BUMP_LEVEL_MAJORMajor increment (e.g. 1.0.02.0.0)
rpc AnalyzeCommits(AnalyzeCommitsRequest) returns (AnalyzeCommitsResponse);
Response fieldTypeDescription
bumpBumpLevelRequired version bump
reasonstringHuman-readable explanation

Renders release notes from the commit list.

rpc GenerateNotes(GenerateNotesRequest) returns (GenerateNotesResponse);
Response fieldTypeDescription
notesstringRendered changelog fragment (Markdown, RST, etc.)

Writes the next version into tracked project files before the release commit.

rpc UpdateFiles(UpdateFilesRequest) returns (UpdateFilesResponse);
Response fieldTypeDescription
updated_files[]stringPaths of files that were modified
error_messagestringNon-empty indicates a failure

Lifecycle callbacks for notifications.

Called after a successful release.

rpc OnSuccess(OnSuccessRequest) returns (OnSuccessResponse);
Request fieldTypeDescription
ctxReleaseContextRelease context
release_urlstringURL of the newly created release

Called when the pipeline encounters an unrecoverable error.

rpc OnFail(OnFailRequest) returns (OnFailResponse);
Request fieldTypeDescription
ctxReleaseContextRelease context
error_messagestringError that caused the failure