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.0Entrypoint
Return Type
Release !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| gitRef | GitRef ! | - | Git Ref Source, ex: https://gitlab.com/my/app.git |
| netrc | Secret | - | .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@40c885a93ac7d7255b3ce1e7ec9dbdfb4c4e9080 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
| Name | Type | Default Value | Description |
|---|---|---|---|
| ref | String ! | - | Existing OCI reference |
| tags | [String ! ] ! | - | Additional tags |
Example
dagger -m github.com/act3-ai/dagger/release@40c885a93ac7d7255b3ce1e7ec9dbdfb4c4e9080 call \
add-tags --ref string --tags string1 --tags string2func (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
| Name | Type | Default Value | Description |
|---|---|---|---|
| ref | String ! | - | OCI repository, e.g. localhost:5000/helloworld |
| version | String ! | - | target version |
Example
dagger -m github.com/act3-ai/dagger/release@40c885a93ac7d7255b3ce1e7ec9dbdfb4c4e9080 call \
extra-tags --ref string --version stringfunc (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
| Name | Type | Default Value | Description |
|---|---|---|---|
| ref | String ! | - | OCI image reference, e.g. localhost:5000/helloworld, localhost:5000/helloworld:v1.2.3 |
| version | String ! | - | target version |
Example
dagger -m github.com/act3-ai/dagger/release@40c885a93ac7d7255b3ce1e7ec9dbdfb4c4e9080 call \
create-extra-tags --ref string --version stringfunc (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)
}createGithub() 🔗
Create a release in GitHub.
Return Type
String !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| repo | String ! | - | GitHub repository, without "github.com" |
| token | Secret ! | - | gitlab personal access token |
| version | String ! | - | Release version |
| notes | File ! | - | Release notes file |
| title | String | - | Release title. Default: version |
| assets | [File ! ] | - | Release assets |
Example
dagger -m github.com/act3-ai/dagger/release@40c885a93ac7d7255b3ce1e7ec9dbdfb4c4e9080 call \
create-github --repo string --token env:MYSECRET --version string --notes file:pathfunc (m *MyModule) Example(ctx context.Context, gitRef *dagger.GitRef, repo string, token *dagger.Secret, version string, notes *dagger.File) string {
return dag.
Release(gitRef).
CreateGithub(ctx, repo, token, version, notes)
}@function
async def example(git_ref: dagger.GitRef, repo: str, token: dagger.Secret, version: str, notes: dagger.File) -> str:
return await (
dag.release(git_ref)
.create_github(repo, token, version, notes)
)@func()
async example(gitRef: GitRef, repo: string, token: Secret, version: string, notes: File): Promise<string> {
return dag
.release(gitRef)
.createGithub(repo, token, version, notes)
}createGitlab() 🔗
Create a release in a public or private GitLab instance.
Return Type
String !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| host | String | "gitlab.com" | GitLab host |
| project | String ! | - | GitLab repository, without host. |
| token | Secret ! | - | GitLab personal access token |
| version | String ! | - | Release version |
| notes | File ! | - | Release notes file |
| title | String | - | Release title. Default: version |
| assets | [File ! ] | - | Release assets |
Example
dagger -m github.com/act3-ai/dagger/release@40c885a93ac7d7255b3ce1e7ec9dbdfb4c4e9080 call \
create-gitlab --project string --token env:MYSECRET --version string --notes file:pathfunc (m *MyModule) Example(ctx context.Context, gitRef *dagger.GitRef, project string, token *dagger.Secret, version string, notes *dagger.File) string {
return dag.
Release(gitRef).
CreateGitlab(ctxproject, token, version, notes)
}@function
async def example(git_ref: dagger.GitRef, project: str, token: dagger.Secret, version: str, notes: dagger.File) -> str:
return await (
dag.release(git_ref)
.create_gitlab(project, token, version, notes)
)@func()
async example(gitRef: GitRef, project: string, token: Secret, version: string, notes: File): Promise<string> {
return dag
.release(gitRef)
.createGitlab(project, token, version, notes)
}withRegistryAuth() 🔗
Add credentials for a private registry.
Return Type
Release !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| address | String ! | - | registry's hostname |
| username | String ! | - | username in registry |
| secret | Secret ! | - | password or token for registry |
Example
dagger -m github.com/act3-ai/dagger/release@40c885a93ac7d7255b3ce1e7ec9dbdfb4c4e9080 call \
with-registry-auth --address string --username string --secret env:MYSECRETfunc (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
| Name | Type | Default Value | Description |
|---|---|---|---|
| address | String ! | - | registry's hostname |
Example
dagger -m github.com/act3-ai/dagger/release@40c885a93ac7d7255b3ce1e7ec9dbdfb4c4e9080 call \
without-registry-auth --address stringfunc (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)
}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
| Name | Type | Default Value | Description |
|---|---|---|---|
| version | String ! | - | prepare for a specific version |
| pathPrefix | String | - | prefix to path for changelog, version, and release notes |
| chartPath | String | - | path to helm chart in source directory to bump chart version to release version. |
| extraNotes | String | - | Additional information to include in release notes. Injected after header and before commit |
| config | String | - | git-cliff cliff.toml path to use. Defaults to root of gitref "." |
| token | Secret | - | provide a github token to git-cliff. This is needed to avoid github api rate limit |
Example
dagger -m github.com/act3-ai/dagger/release@40c885a93ac7d7255b3ce1e7ec9dbdfb4c4e9080 call \
prepare --version stringfunc (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 semantic version from conventional commit messages (see cliff.toml). The returned version is of the form MAJOR.MINOR.PATCH.
Return Type
String !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| config | String | - | git-cliff cliff.toml path to use. Defaults to root of gitref "./" |
Example
dagger -m github.com/act3-ai/dagger/release@40c885a93ac7d7255b3ce1e7ec9dbdfb4c4e9080 call \
versionfunc (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()
}