Dagger
Search

release

Three stages are provided:
- release {go/python} check - runs general linters and {go/python} specific linters and unit tests.
- release prepare - generate changelog, release notes, and release version.
- release create-{github/gitlab} - create a release page on github.com, gitlab.com, or a private GitLab instance.

This module does not support image publishing, as to be flexible to
other publishing methods; through dagger, ko, docker, etc. However, it does
provide a couple helper functions, add-tags and extra-tags, to aid in
publishing additional tags for an OCI image.

This module does not support functional or integration testing, as such testing
often requires extensive customization that is not easily generalized.

This module uses other act3-ai modules as components, with additional functionality.
Please refer to each modules' documentation if desired functionality is not
available in this module.

Installation

dagger install github.com/act3-ai/dagger/release@v0.3.4

Entrypoint

Return Type
Release !
Arguments
NameTypeDefault ValueDescription
gitRefGitRef !-Git Ref Source, ex: https://gitlab.com/my/app.git
netrcSecret -.netrc file for private modules can be passed as env var or file --netrc env:var_name, file:/filepath/.netrc
Example
dagger -m github.com/act3-ai/dagger/release@aa21042c942b237a09f5eb6d821a56bb631427f9 call \
func (m *MyModule) Example(gitRef *dagger.GitRef) *dagger.Release  {
	return dag.
			Release(gitRef)
}
@function
def example(git_ref: dagger.GitRef, ) -> dagger.Release:
	return (
		dag.release(git_ref)
	)
@func()
example(gitRef: GitRef, ): Release {
	return dag
		.release(gitRef)
}

Types

Release 🔗

addTags() 🔗

Publish additional tags to a remote OCI artifact.

Return Type
String !
Arguments
NameTypeDefault ValueDescription
refString !-Existing OCI reference
tags[String ! ] !-Additional tags
Example
dagger -m github.com/act3-ai/dagger/release@aa21042c942b237a09f5eb6d821a56bb631427f9 call \
 add-tags --ref string --tags string1 --tags string2
func (m *MyModule) Example(ctx context.Context, gitRef *dagger.GitRef, ref string, tags []string) string  {
	return dag.
			Release(gitRef).
			AddTags(ctx, ref, tags)
}
@function
async def example(git_ref: dagger.GitRef, ref: str, tags: List[str]) -> str:
	return await (
		dag.release(git_ref)
		.add_tags(ref, tags)
	)
@func()
async example(gitRef: GitRef, ref: string, tags: string[]): Promise<string> {
	return dag
		.release(gitRef)
		.addTags(ref, tags)
}

extraTags() 🔗

Generate extra tags based on the provided target tag.

Ex: Given the patch release ‘v1.2.3’, with an existing ‘v1.3.0’ release, it returns ‘v1.2’. Ex: Given the patch release ‘v1.2.3’, which is the latest and greatest, it returns ‘v1’, ‘v1.2’, ‘latest’.

Notice: current issue with SSH AUTH SOCK: https://docs.dagger.io/api/remote-repositories/#multiple-ssh-keys-may-cause-ssh-forwarding-to-fail

Return Type
[String ! ] !
Arguments
NameTypeDefault ValueDescription
refString !-OCI repository, e.g. localhost:5000/helloworld
versionString !-target version
Example
dagger -m github.com/act3-ai/dagger/release@aa21042c942b237a09f5eb6d821a56bb631427f9 call \
 extra-tags --ref string --version string
func (m *MyModule) Example(ctx context.Context, gitRef *dagger.GitRef, ref string, version string) []string  {
	return dag.
			Release(gitRef).
			ExtraTags(ctx, ref, version)
}
@function
async def example(git_ref: dagger.GitRef, ref: str, version: str) -> List[str]:
	return await (
		dag.release(git_ref)
		.extra_tags(ref, version)
	)
@func()
async example(gitRef: GitRef, ref: string, version: string): Promise<string[]> {
	return dag
		.release(gitRef)
		.extraTags(ref, version)
}

createExtraTags() 🔗

Create extra tags based on the provided target tag. Combines ExtraTags() and AddTags().

Return Type
[String ! ] !
Arguments
NameTypeDefault ValueDescription
refString !-OCI image reference, e.g. localhost:5000/helloworld, localhost:5000/helloworld:v1.2.3
versionString !-target version
Example
dagger -m github.com/act3-ai/dagger/release@aa21042c942b237a09f5eb6d821a56bb631427f9 call \
 create-extra-tags --ref string --version string
func (m *MyModule) Example(ctx context.Context, gitRef *dagger.GitRef, ref string, version string) []string  {
	return dag.
			Release(gitRef).
			CreateExtraTags(ctx, ref, version)
}
@function
async def example(git_ref: dagger.GitRef, ref: str, version: str) -> List[str]:
	return await (
		dag.release(git_ref)
		.create_extra_tags(ref, version)
	)
@func()
async example(gitRef: GitRef, ref: string, version: string): Promise<string[]> {
	return dag
		.release(gitRef)
		.createExtraTags(ref, version)
}

withRegistryAuth() 🔗

Add credentials for a private registry.

Return Type
Release !
Arguments
NameTypeDefault ValueDescription
addressString !-registry's hostname
usernameString !-username in registry
secretSecret !-password or token for registry
Example
dagger -m github.com/act3-ai/dagger/release@aa21042c942b237a09f5eb6d821a56bb631427f9 call \
 with-registry-auth --address string --username string --secret env:MYSECRET
func (m *MyModule) Example(gitRef *dagger.GitRef, address string, username string, secret *dagger.Secret) *dagger.Release  {
	return dag.
			Release(gitRef).
			WithRegistryAuth(address, username, secret)
}
@function
def example(git_ref: dagger.GitRef, address: str, username: str, secret: dagger.Secret) -> dagger.Release:
	return (
		dag.release(git_ref)
		.with_registry_auth(address, username, secret)
	)
@func()
example(gitRef: GitRef, address: string, username: string, secret: Secret): Release {
	return dag
		.release(gitRef)
		.withRegistryAuth(address, username, secret)
}

withoutRegistryAuth() 🔗

Removes credentials for a private registry.

Return Type
Release !
Arguments
NameTypeDefault ValueDescription
addressString !-registry's hostname
Example
dagger -m github.com/act3-ai/dagger/release@aa21042c942b237a09f5eb6d821a56bb631427f9 call \
 without-registry-auth --address string
func (m *MyModule) Example(gitRef *dagger.GitRef, address string) *dagger.Release  {
	return dag.
			Release(gitRef).
			WithoutRegistryAuth(address)
}
@function
def example(git_ref: dagger.GitRef, address: str) -> dagger.Release:
	return (
		dag.release(git_ref)
		.without_registry_auth(address)
	)
@func()
example(gitRef: GitRef, address: string): Release {
	return dag
		.release(gitRef)
		.withoutRegistryAuth(address)
}

createGithub() 🔗

Create a release in GitHub.

Return Type
String !
Arguments
NameTypeDefault ValueDescription
repoString !-GitHub repository, without "github.com"
tokenSecret !-gitlab personal access token
tagString !-tag to create release with
notesFile !-Release notes file
titleString -Release title. Default: tag
assets[File ! ] -Release assets
Example
dagger -m github.com/act3-ai/dagger/release@aa21042c942b237a09f5eb6d821a56bb631427f9 call \
 create-github --repo string --token env:MYSECRET --tag string --notes file:path
func (m *MyModule) Example(ctx context.Context, gitRef *dagger.GitRef, repo string, token *dagger.Secret, tag string, notes *dagger.File) string  {
	return dag.
			Release(gitRef).
			CreateGithub(ctx, repo, token, tag, notes)
}
@function
async def example(git_ref: dagger.GitRef, repo: str, token: dagger.Secret, tag: str, notes: dagger.File) -> str:
	return await (
		dag.release(git_ref)
		.create_github(repo, token, tag, notes)
	)
@func()
async example(gitRef: GitRef, repo: string, token: Secret, tag: string, notes: File): Promise<string> {
	return dag
		.release(gitRef)
		.createGithub(repo, token, tag, notes)
}

createGitlab() 🔗

Create a release in a public or private GitLab instance.

Return Type
String !
Arguments
NameTypeDefault ValueDescription
hostString "gitlab.com"GitLab host
projectString !-GitLab repository, without host.
tokenSecret !-GitLab personal access token
tagString !-Release tag
notesFile !-Release notes file
titleString -Release title. Default: tag
assets[File ! ] -Release assets
Example
dagger -m github.com/act3-ai/dagger/release@aa21042c942b237a09f5eb6d821a56bb631427f9 call \
 create-gitlab --project string --token env:MYSECRET --tag string --notes file:path
func (m *MyModule) Example(ctx context.Context, gitRef *dagger.GitRef, project string, token *dagger.Secret, tag string, notes *dagger.File) string  {
	return dag.
			Release(gitRef).
			CreateGitlab(ctxproject, token, tag, notes)
}
@function
async def example(git_ref: dagger.GitRef, project: str, token: dagger.Secret, tag: str, notes: dagger.File) -> str:
	return await (
		dag.release(git_ref)
		.create_gitlab(project, token, tag, notes)
	)
@func()
async example(gitRef: GitRef, project: string, token: Secret, tag: string, notes: File): Promise<string> {
	return dag
		.release(gitRef)
		.createGitlab(project, token, tag, notes)
}

prepare() 🔗

Generate release notes, changelog, and VERSION file with target release version. Will also optionally bump a version in provided helm chart path.

Return Type
Changeset !
Arguments
NameTypeDefault ValueDescription
versionString !-prepare for a specific version. Must be a valid semantic version in format of x.x.x
chartPathString -path to helm chart in source directory to bump chart version to release version.
extraNotesString -Additional information to include in release notes. Injected after header and before commit
workingDirString -Working Directory in source directory to run git-cliff
githubTokenSecret -provide a github token to git-cliff.
gitlabTokenSecret -provide a gitlab token to git-cliff.
giteaTokenSecret -provide a gitea token to git-cliff.
Example
dagger -m github.com/act3-ai/dagger/release@aa21042c942b237a09f5eb6d821a56bb631427f9 call \
 prepare --version string
func (m *MyModule) Example(gitRef *dagger.GitRef, version string) *dagger.Changeset  {
	return dag.
			Release(gitRef).
			Prepare(version)
}
@function
def example(git_ref: dagger.GitRef, version: str) -> dagger.Changeset:
	return (
		dag.release(git_ref)
		.prepare(version)
	)
@func()
example(gitRef: GitRef, version: string): Changeset {
	return dag
		.release(gitRef)
		.prepare(version)
}

version() 🔗

Generate the next version from conventional commit messages using git-cliff. Will attempt to coerce a bumped tag if not in semantic version format and Returns a version in format of MAJOR.MINOR.PATCH ex: 1.0.0

Return Type
String !
Arguments
NameTypeDefault ValueDescription
workingDirString -Working Directory in source directory to run git-cliff
githubTokenSecret -provide a github token to git-cliff.
gitlabTokenSecret -provide a gitlab token to git-cliff.
giteaTokenSecret -provide a gitea token to git-cliff.
Example
dagger -m github.com/act3-ai/dagger/release@aa21042c942b237a09f5eb6d821a56bb631427f9 call \
 version
func (m *MyModule) Example(ctx context.Context, gitRef *dagger.GitRef) string  {
	return dag.
			Release(gitRef).
			Version(ctx)
}
@function
async def example(git_ref: dagger.GitRef, ) -> str:
	return await (
		dag.release(git_ref)
		.version()
	)
@func()
async example(gitRef: GitRef, ): Promise<string> {
	return dag
		.release(gitRef)
		.version()
}