l87-relctl
l87-relctl exposes the full relctl CLI as a Dagger module so that CIpipelines 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@f1839dd0f23b060a3e59cb3b0e3b707e21ee5537Entrypoint
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
| Name | Type | Default Value | Description |
|---|---|---|---|
| source | Directory ! | - | No description provided |
| version | String | - | No description provided |
| commitHash | String | - | No description provided |
Example
dagger -m github.com/layer87-labs/relctl@f1839dd0f23b060a3e59cb3b0e3b707e21ee5537 call \
binary --source DIR_PATHfunc (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
| Name | Type | Default Value | Description |
|---|---|---|---|
| source | Directory ! | - | No description provided |
Example
dagger -m github.com/layer87-labs/relctl@f1839dd0f23b060a3e59cb3b0e3b707e21ee5537 call \
commit-hash --source DIR_PATHfunc (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
| Name | Type | Default Value | Description |
|---|---|---|---|
| source | Directory ! | - | No description provided |
| token | Secret ! | - | No description provided |
| repository | String ! | - | No description provided |
| server | String | - | No description provided |
Example
dagger -m github.com/layer87-labs/relctl@f1839dd0f23b060a3e59cb3b0e3b707e21ee5537 call \
container --source DIR_PATH --token env:MYSECRET --repository stringfunc (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
| Name | Type | Default Value | Description |
|---|---|---|---|
| source | Directory ! | - | No description provided |
| branch | String ! | - | No description provided |
Example
dagger -m github.com/layer87-labs/relctl@f1839dd0f23b060a3e59cb3b0e3b707e21ee5537 call \
next-version --source DIR_PATH --branch stringfunc (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
| Name | Type | Default Value | Description |
|---|---|---|---|
| source | Directory ! | - | No description provided |
| token | Secret ! | - | No description provided |
| repository | String ! | - | No description provided |
| server | String | - | No description provided |
| number | Integer | - | No description provided |
| mergeSha | String | - | No description provided |
Example
dagger -m github.com/layer87-labs/relctl@f1839dd0f23b060a3e59cb3b0e3b707e21ee5537 call \
pr-info --source DIR_PATH --token env:MYSECRET --repository stringfunc (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
| Name | Type | Default Value | Description |
|---|---|---|---|
| source | Directory ! | - | No description provided |
| token | Secret ! | - | No description provided |
| repository | String ! | - | No description provided |
| server | String | - | No description provided |
| body | String | - | No description provided |
| patchLevel | String | - | No description provided |
| version | String | - | No description provided |
| mergeSha | String | - | No description provided |
| releaseBranch | String | - | No description provided |
| releasePrefix | String | - | No description provided |
| prNumber | Integer | - | No description provided |
| dryRun | Boolean | - | No description provided |
| hotfix | Boolean | - | No description provided |
Example
dagger -m github.com/layer87-labs/relctl@f1839dd0f23b060a3e59cb3b0e3b707e21ee5537 call \
release-create --source DIR_PATH --token env:MYSECRET --repository stringfunc (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
| Name | Type | Default Value | Description |
|---|---|---|---|
| source | Directory ! | - | No description provided |
| token | Secret ! | - | No description provided |
| repository | String ! | - | No description provided |
| releaseId | Integer ! | - | No description provided |
| server | String | - | No description provided |
| assets | [String ! ] | - | No description provided |
| body | String | - | No description provided |
| mergeSha | String | - | No description provided |
| prNumber | Integer | - | 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 integerfunc (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
| Name | Type | Default Value | Description |
|---|---|---|---|
| source | Directory ! | - | No description provided |
Example
dagger -m github.com/layer87-labs/relctl@f1839dd0f23b060a3e59cb3b0e3b707e21ee5537 call \
version --source DIR_PATHfunc (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)
}