release
This module has been generated via dagger init and serves as a reference tobasic module structure as you get started with Dagger.
Two functions have been pre-created. You can modify, delete, or add to them,
as needed. They demonstrate usage of arguments and return rypes using simple
echo and grep commands. The functions can be called from the dagger CLI or
from one of the SDKs.
The first line in this comment block is a short description line and the
rest is a long description with more detail on the module's purpose or usage,
if appropriate. All modules should have a short description.
Installation
dagger install github.com/act3-ai/dagger/release@d2b43a06c90068aff46cd96b94bdd212bf27448e
Entrypoint
Return Type
Release !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
src | Directory ! | - | top level source code directory |
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@d2b43a06c90068aff46cd96b94bdd212bf27448e call \
--src DIR_PATH
func (m *MyModule) Example(src *dagger.Directory) *dagger.Release {
return dag.
Release(src)
}
@function
def example(src: dagger.Directory, ) -> dagger.Release:
return (
dag.release(src)
)
@func()
example(src: Directory, ): Release {
return dag
.release(src)
}
Types
Release 🔗
python() 🔗
Return Type
Py !
Example
dagger -m github.com/act3-ai/dagger/release@d2b43a06c90068aff46cd96b94bdd212bf27448e call \
--src DIR_PATH python
func (m *MyModule) Example(src *dagger.Directory) *dagger.ReleasePy {
return dag.
Release(src).
Python()
}
@function
def example(src: dagger.Directory, ) -> dagger.ReleasePy:
return (
dag.release(src)
.python()
)
@func()
example(src: Directory, ): ReleasePy {
return dag
.release(src)
.python()
}
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@d2b43a06c90068aff46cd96b94bdd212bf27448e call \
--src DIR_PATH extra-tags --ref string --version string
func (m *MyModule) Example(ctx context.Context, src *dagger.Directory, ref string, version string) []string {
return dag.
Release(src).
ExtraTags(ctx, ref, version)
}
@function
async def example(src: dagger.Directory, ref: str, version: str) -> List[str]:
return await (
dag.release(src)
.extra_tags(ref, version)
)
@func()
async example(src: Directory, ref: string, version: string): Promise<string[]> {
return dag
.release(src)
.extraTags(ref, version)
}
createGithub() 🔗
CreateGithub creates 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@d2b43a06c90068aff46cd96b94bdd212bf27448e call \
--src DIR_PATH create-github --repo string --token env:MYSECRET --version string --notes file:path
func (m *MyModule) Example(ctx context.Context, src *dagger.Directory, repo string, token *dagger.Secret, version string, notes *dagger.File) string {
return dag.
Release(src).
CreateGithub(ctx, repo, token, version, notes)
}
@function
async def example(src: dagger.Directory, repo: str, token: dagger.Secret, version: str, notes: dagger.File) -> str:
return await (
dag.release(src)
.create_github(repo, token, version, notes)
)
@func()
async example(src: Directory, repo: string, token: Secret, version: string, notes: File): Promise<string> {
return dag
.release(src)
.createGithub(repo, token, version, notes)
}
createGitlab() 🔗
CreateGitlab creates 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@d2b43a06c90068aff46cd96b94bdd212bf27448e call \
--src DIR_PATH create-gitlab --project string --token env:MYSECRET --version string --notes file:path
func (m *MyModule) Example(ctx context.Context, src *dagger.Directory, project string, token *dagger.Secret, version string, notes *dagger.File) string {
return dag.
Release(src).
CreateGitlab(ctxproject, token, version, notes)
}
@function
async def example(src: dagger.Directory, project: str, token: dagger.Secret, version: str, notes: dagger.File) -> str:
return await (
dag.release(src)
.create_gitlab(project, token, version, notes)
)
@func()
async example(src: Directory, project: string, token: Secret, version: string, notes: File): Promise<string> {
return dag
.release(src)
.createGitlab(project, token, version, notes)
}
prepare() 🔗
Generate release notes, changelog, and target release version.
Return Type
Directory !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
chartPath | String | - | path to helm chart in source directory to bump chart version to release version. |
changelog | 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 |
Example
dagger -m github.com/act3-ai/dagger/release@d2b43a06c90068aff46cd96b94bdd212bf27448e call \
--src DIR_PATH prepare
func (m *MyModule) Example(src *dagger.Directory) *dagger.Directory {
return dag.
Release(src).
Prepare()
}
@function
def example(src: dagger.Directory, ) -> dagger.Directory:
return (
dag.release(src)
.prepare()
)
@func()
example(src: Directory, ): Directory {
return dag
.release(src)
.prepare()
}
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@d2b43a06c90068aff46cd96b94bdd212bf27448e call \
--src DIR_PATH with-registry-auth --address string --username string --secret env:MYSECRET
func (m *MyModule) Example(src *dagger.Directory, address string, username string, secret *dagger.Secret) *dagger.Release {
return dag.
Release(src).
WithRegistryAuth(address, username, secret)
}
@function
def example(src: dagger.Directory, address: str, username: str, secret: dagger.Secret) -> dagger.Release:
return (
dag.release(src)
.with_registry_auth(address, username, secret)
)
@func()
example(src: Directory, address: string, username: string, secret: Secret): Release {
return dag
.release(src)
.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@d2b43a06c90068aff46cd96b94bdd212bf27448e call \
--src DIR_PATH without-registry-auth --address string
func (m *MyModule) Example(src *dagger.Directory, address string) *dagger.Release {
return dag.
Release(src).
WithoutRegistryAuth(address)
}
@function
def example(src: dagger.Directory, address: str) -> dagger.Release:
return (
dag.release(src)
.without_registry_auth(address)
)
@func()
example(src: Directory, address: string): Release {
return dag
.release(src)
.withoutRegistryAuth(address)
}
go() 🔗
Go provides utilities for releasing golang projects.
Return Type
Golang !
Example
dagger -m github.com/act3-ai/dagger/release@d2b43a06c90068aff46cd96b94bdd212bf27448e call \
--src DIR_PATH go
func (m *MyModule) Example(src *dagger.Directory) *dagger.ReleaseGolang {
return dag.
Release(src).
Go()
}
@function
def example(src: dagger.Directory, ) -> dagger.ReleaseGolang:
return (
dag.release(src)
.go()
)
@func()
example(src: Directory, ): ReleaseGolang {
return dag
.release(src)
.go()
}
Py 🔗
check() 🔗
Check performs sanity checks prior to releasing, i.e. linters and unit tests.
Return Type
String !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
base | Container | - | base container for tests can be overwritten |
syncArgs | [String ! ] | - | extra arguments for uv sync command |
unitTestDir | String | "test" | unit test directory |
skip | [String ! ] | - | skip any provided lint tests |
Example
dagger -m github.com/act3-ai/dagger/release@d2b43a06c90068aff46cd96b94bdd212bf27448e call \
python \
check
func (m *MyModule) Example(ctx context.Context) string {
return dag.
Release().
Python().
Check(ctx)
}
@function
async def example() -> str:
return await (
dag.release()
.python()
.check()
)
@func()
async example(): Promise<string> {
return dag
.release()
.python()
.check()
}
Golang 🔗
release() 🔗
Return Type
Release !
Example
dagger -m github.com/act3-ai/dagger/release@d2b43a06c90068aff46cd96b94bdd212bf27448e call \
go \
release
func (m *MyModule) Example() *dagger.Release {
return dag.
Release().
Go().
Release()
}
@function
def example() -> dagger.Release:
return (
dag.release()
.go()
.release()
)
@func()
example(): Release {
return dag
.release()
.go()
.release()
}
check() 🔗
Check performs sanity checks prior to releasing.
Specifically, it runs: shellcheck, yamllint, markdownlint-cli2, golangci-lint, govulncheck, and go unit tests.
Return Type
String !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
base | Container | - | base container for all linters. |
unitTestBase | Container | - | base container to run unit tests in. |
Example
dagger -m github.com/act3-ai/dagger/release@d2b43a06c90068aff46cd96b94bdd212bf27448e call \
go \
check
func (m *MyModule) Example(ctx context.Context) string {
return dag.
Release().
Go().
Check(ctx)
}
@function
async def example() -> str:
return await (
dag.release()
.go()
.check()
)
@func()
async example(): Promise<string> {
return dag
.release()
.go()
.check()
}