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.2.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 |
| gitIgnore | File | - | Additonal .gitignore file |
Example
dagger -m github.com/act3-ai/dagger/release@4645d5e1f0275a44e7ce2280a416811f980ea359 call \
func (m *MyModule) Example(gitref *dagger.GitRef) *dagger.Release {
return dag.
Release(gitref)
}@function
def example(gitref: dagger.GitRef, ) -> dagger.Release:
return (
dag.release(gitref)
)@func()
example(gitref: GitRef, ): Release {
return dag
.release(gitref)
}Types
Release 🔗
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@4645d5e1f0275a44e7ce2280a416811f980ea359 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(gitref: dagger.GitRef, address: str, username: str, secret: dagger.Secret) -> dagger.Release:
return (
dag.release(gitref)
.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@4645d5e1f0275a44e7ce2280a416811f980ea359 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(gitref: dagger.GitRef, address: str) -> dagger.Release:
return (
dag.release(gitref)
.without_registry_auth(address)
)@func()
example(gitref: GitRef, address: string): Release {
return dag
.release(gitref)
.withoutRegistryAuth(address)
}prepare() 🔗
Generate release notes, changelog, and target release version.
Return Type
Directory !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| version | String | - | prepare for a specific version, overrides default bumping configuration, prioritized over method. |
| method | String | - | prepare for a specific method/type of release, overrides bumping configuration, ignored if version is specified. Supported values: 'major', 'minor', and 'patch'. |
| versionPath | String | "VERSION" | path to version file |
| chartPath | String | - | path to helm chart in source directory to bump chart version to release version. |
| changelogPath | String | "CHANGELOG.md" | Changelog file path, relative to source directory |
| notesPath | String | - | Release notes file path, relative to source directory. Default: releases/v<version>.md. |
| extraNotes | String | - | Additional information to include in release notes. Injected after header and before commit |
| base | Container | - | base image for git-cliff |
| ignoreError | Boolean | - | ignore git status errors |
| args | [String ! ] | - | additional arguments to git-cliff --bumped version |
Example
dagger -m github.com/act3-ai/dagger/release@4645d5e1f0275a44e7ce2280a416811f980ea359 call \
preparefunc (m *MyModule) Example(gitref *dagger.GitRef) *dagger.Directory {
return dag.
Release(gitref).
Prepare()
}@function
def example(gitref: dagger.GitRef, ) -> dagger.Directory:
return (
dag.release(gitref)
.prepare()
)@func()
example(gitref: GitRef, ): Directory {
return dag
.release(gitref)
.prepare()
}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@4645d5e1f0275a44e7ce2280a416811f980ea359 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(gitref: dagger.GitRef, ref: str, tags: List[str]) -> str:
return await (
dag.release(gitref)
.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@4645d5e1f0275a44e7ce2280a416811f980ea359 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(gitref: dagger.GitRef, ref: str, version: str) -> List[str]:
return await (
dag.release(gitref)
.extra_tags(ref, version)
)@func()
async example(gitref: GitRef, ref: string, version: string): Promise<string[]> {
return dag
.release(gitref)
.extraTags(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@4645d5e1f0275a44e7ce2280a416811f980ea359 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(gitref: dagger.GitRef, repo: str, token: dagger.Secret, version: str, notes: dagger.File) -> str:
return await (
dag.release(gitref)
.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@4645d5e1f0275a44e7ce2280a416811f980ea359 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(gitref: dagger.GitRef, project: str, token: dagger.Secret, version: str, notes: dagger.File) -> str:
return await (
dag.release(gitref)
.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)
}