Dagger
Search

l87-relctl

l87-relctl exposes the full relctl CLI as a Dagger module so that CI
pipelines can:
- Query git metadata (CommitHash, Version, NextVersion)
- Build the relctl binary from source (Binary)
- Get a pre-authenticated runtime container (Container)
- Create and publish GitHub releases (ReleaseCreate, ReleasePublish)
- Retrieve pull-request information (PrInfo)

Installation

dagger install github.com/layer87-labs/relctl@f1839dd0f23b060a3e59cb3b0e3b707e21ee5537

Entrypoint

Return Type
L87Relctl
Example
dagger -m github.com/layer87-labs/relctl@f1839dd0f23b060a3e59cb3b0e3b707e21ee5537 call \
func (m *MyModule) Example() *dagger.L87Relctl  {
	return dag.
			L87Relctl()
}
@function
def example() -> dagger.L87Relctl:
	return (
		dag.l87_relctl()
	)
@func()
example(): L87Relctl {
	return dag
		.l87Relctl()
}

Types

L87Relctl 🔗

L87Relctl is the root Dagger module type.

binary() 🔗

Binary builds the relctl binary from source and returns the compiled file. Version and commit hash are embedded at compile time via ldflags. When not provided, both values are auto-detected from the git history.

Example:

dagger call binary --source=. export --path=./out/relctl
Return Type
File !
Arguments
NameTypeDefault ValueDescription
sourceDirectory !-No description provided
versionString -No description provided
commitHashString -No description provided
Example
dagger -m github.com/layer87-labs/relctl@f1839dd0f23b060a3e59cb3b0e3b707e21ee5537 call \
 binary --source DIR_PATH
func (m *MyModule) Example(source *dagger.Directory) *dagger.File  {
	return dag.
			L87Relctl().
			Binary(source)
}
@function
def example(source: dagger.Directory) -> dagger.File:
	return (
		dag.l87_relctl()
		.binary(source)
	)
@func()
example(source: Directory): File {
	return dag
		.l87Relctl()
		.binary(source)
}

commitHash() 🔗

CommitHash returns the short (7-char) git commit hash of HEAD. Returns “unknown” when the repository has no commits or no .git directory.

Example:

dagger call commit-hash --source=.
Return Type
String !
Arguments
NameTypeDefault ValueDescription
sourceDirectory !-No description provided
Example
dagger -m github.com/layer87-labs/relctl@f1839dd0f23b060a3e59cb3b0e3b707e21ee5537 call \
 commit-hash --source DIR_PATH
func (m *MyModule) Example(ctx context.Context, source *dagger.Directory) string  {
	return dag.
			L87Relctl().
			CommitHash(ctx, source)
}
@function
async def example(source: dagger.Directory) -> str:
	return await (
		dag.l87_relctl()
		.commit_hash(source)
	)
@func()
async example(source: Directory): Promise<string> {
	return dag
		.l87Relctl()
		.commitHash(source)
}

container() 🔗

Container returns a minimal Alpine container with the relctl binary and GitHub credentials pre-configured. Use this as an escape hatch to run any relctl subcommand not covered by the typed helper functions.

The container is configured in GitHub Actions detection mode so relctl automatically picks up the credentials: - CI=true - GITHUB_SERVER_URL= - GITHUB_REPOSITORY= - GITHUB_TOKEN= (injected as a secret — never exposed in logs)

The source directory is mounted at /repo and set as the working directory.

Example:

dagger call container --source=. --token=env:GITHUB_TOKEN \
  --repository=my-org/my-repo \
  with-exec --args="relctl,release,create,--dry-run" stdout
Return Type
Container !
Arguments
NameTypeDefault ValueDescription
sourceDirectory !-No description provided
tokenSecret !-No description provided
repositoryString !-No description provided
serverString -No description provided
Example
dagger -m github.com/layer87-labs/relctl@f1839dd0f23b060a3e59cb3b0e3b707e21ee5537 call \
 container --source DIR_PATH --token env:MYSECRET --repository string
func (m *MyModule) Example(source *dagger.Directory, token *dagger.Secret, repository string) *dagger.Container  {
	return dag.
			L87Relctl().
			Container(source, token, repository)
}
@function
def example(source: dagger.Directory, token: dagger.Secret, repository: str) -> dagger.Container:
	return (
		dag.l87_relctl()
		.container(source, token, repository)
	)
@func()
example(source: Directory, token: Secret, repository: string): Container {
	return dag
		.l87Relctl()
		.container(source, token, repository)
}

nextVersion() 🔗

NextVersion computes the next SemVer bump based on the branch-name prefix:

  • bugfix/ fix/ patch/ dependabot/ (and everything else) → patch bump
  • feature/ feat/ minor/ → minor bump
  • major/ → major bump

Example:

dagger call next-version --source=. --branch=feature/my-feature
Return Type
String !
Arguments
NameTypeDefault ValueDescription
sourceDirectory !-No description provided
branchString !-No description provided
Example
dagger -m github.com/layer87-labs/relctl@f1839dd0f23b060a3e59cb3b0e3b707e21ee5537 call \
 next-version --source DIR_PATH --branch string
func (m *MyModule) Example(ctx context.Context, source *dagger.Directory, branch string) string  {
	return dag.
			L87Relctl().
			NextVersion(ctx, source, branch)
}
@function
async def example(source: dagger.Directory, branch: str) -> str:
	return await (
		dag.l87_relctl()
		.next_version(source, branch)
	)
@func()
async example(source: Directory, branch: string): Promise<string> {
	return dag
		.l87Relctl()
		.nextVersion(source, branch)
}

prInfo() 🔗

PrInfo retrieves pull-request information by running relctl pr info. Specify either a PR number or the merge commit SHA to identify the PR.

Example:

dagger call pr-info \
  --source=. --token=env:GITHUB_TOKEN --repository=my-org/my-repo \
  --number=42
Return Type
String !
Arguments
NameTypeDefault ValueDescription
sourceDirectory !-No description provided
tokenSecret !-No description provided
repositoryString !-No description provided
serverString -No description provided
numberInteger -No description provided
mergeShaString -No description provided
Example
dagger -m github.com/layer87-labs/relctl@f1839dd0f23b060a3e59cb3b0e3b707e21ee5537 call \
 pr-info --source DIR_PATH --token env:MYSECRET --repository string
func (m *MyModule) Example(ctx context.Context, source *dagger.Directory, token *dagger.Secret, repository string) string  {
	return dag.
			L87Relctl().
			PrInfo(ctx, source, token, repository)
}
@function
async def example(source: dagger.Directory, token: dagger.Secret, repository: str) -> str:
	return await (
		dag.l87_relctl()
		.pr_info(source, token, repository)
	)
@func()
async example(source: Directory, token: Secret, repository: string): Promise<string> {
	return dag
		.l87Relctl()
		.prInfo(source, token, repository)
}

releaseCreate() 🔗

ReleaseCreate creates a new GitHub release by running relctl release create. Returns the command stdout which contains the newly created release ID.

Example:

dagger call release-create \
  --source=. --token=env:GITHUB_TOKEN --repository=my-org/my-repo
Return Type
String !
Arguments
NameTypeDefault ValueDescription
sourceDirectory !-No description provided
tokenSecret !-No description provided
repositoryString !-No description provided
serverString -No description provided
bodyString -No description provided
patchLevelString -No description provided
versionString -No description provided
mergeShaString -No description provided
releaseBranchString -No description provided
releasePrefixString -No description provided
prNumberInteger -No description provided
dryRunBoolean -No description provided
hotfixBoolean -No description provided
Example
dagger -m github.com/layer87-labs/relctl@f1839dd0f23b060a3e59cb3b0e3b707e21ee5537 call \
 release-create --source DIR_PATH --token env:MYSECRET --repository string
func (m *MyModule) Example(ctx context.Context, source *dagger.Directory, token *dagger.Secret, repository string) string  {
	return dag.
			L87Relctl().
			ReleaseCreate(ctx, source, token, repository)
}
@function
async def example(source: dagger.Directory, token: dagger.Secret, repository: str) -> str:
	return await (
		dag.l87_relctl()
		.release_create(source, token, repository)
	)
@func()
async example(source: Directory, token: Secret, repository: string): Promise<string> {
	return dag
		.l87Relctl()
		.releaseCreate(source, token, repository)
}

releasePublish() 🔗

ReleasePublish publishes a previously created GitHub release and optionally uploads assets. Run ReleaseCreate first to obtain the release ID.

Assets are specified as typed strings: - “file=” — upload a single file - “zip=” — zip a directory and upload it - “tgz=” — tar.gz a directory and upload it

Example:

dagger call release-publish \
  --source=. --token=env:GITHUB_TOKEN --repository=my-org/my-repo \
  --release-id=12345 \
  --assets=file=./out/relctl_linux_amd64 \
  --assets=file=./out/relctl_linux_arm64
Return Type
String !
Arguments
NameTypeDefault ValueDescription
sourceDirectory !-No description provided
tokenSecret !-No description provided
repositoryString !-No description provided
releaseIdInteger !-No description provided
serverString -No description provided
assets[String ! ] -No description provided
bodyString -No description provided
mergeShaString -No description provided
prNumberInteger -No description provided
Example
dagger -m github.com/layer87-labs/relctl@f1839dd0f23b060a3e59cb3b0e3b707e21ee5537 call \
 release-publish --source DIR_PATH --token env:MYSECRET --repository string --release-id integer
func (m *MyModule) Example(ctx context.Context, source *dagger.Directory, token *dagger.Secret, repository string, releaseId int) string  {
	return dag.
			L87Relctl().
			ReleasePublish(ctx, source, token, repository, releaseId)
}
@function
async def example(source: dagger.Directory, token: dagger.Secret, repository: str, release_id: int) -> str:
	return await (
		dag.l87_relctl()
		.release_publish(source, token, repository, release_id)
	)
@func()
async example(source: Directory, token: Secret, repository: string, releaseId: number): Promise<string> {
	return dag
		.l87Relctl()
		.releasePublish(source, token, repository, releaseId)
}

version() 🔗

Version returns the latest SemVer git tag reachable from HEAD. Returns “dev” when no tag is found or the repository has no tags yet.

Example:

dagger call version --source=.
Return Type
String !
Arguments
NameTypeDefault ValueDescription
sourceDirectory !-No description provided
Example
dagger -m github.com/layer87-labs/relctl@f1839dd0f23b060a3e59cb3b0e3b707e21ee5537 call \
 version --source DIR_PATH
func (m *MyModule) Example(ctx context.Context, source *dagger.Directory) string  {
	return dag.
			L87Relctl().
			Version(ctx, source)
}
@function
async def example(source: dagger.Directory) -> str:
	return await (
		dag.l87_relctl()
		.version(source)
	)
@func()
async example(source: Directory): Promise<string> {
	return dag
		.l87Relctl()
		.version(source)
}