release
Four 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.1.1Entrypoint
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@d72e6da75a73ab8fc9b9d19829e5332a2f7da472 call \
--src DIR_PATHfunc (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@d72e6da75a73ab8fc9b9d19829e5332a2f7da472 call \
--src DIR_PATH pythonfunc (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()
}go() 🔗
Go provides utilities for releasing golang projects.
Return Type
Golang !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| goPrivate | String | - | value of GOPRIVATE |
Example
dagger -m github.com/act3-ai/dagger/release@d72e6da75a73ab8fc9b9d19829e5332a2f7da472 call \
--src DIR_PATH gofunc (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()
}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@d72e6da75a73ab8fc9b9d19829e5332a2f7da472 call \
--src DIR_PATH with-registry-auth --address string --username string --secret env:MYSECRETfunc (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@d72e6da75a73ab8fc9b9d19829e5332a2f7da472 call \
--src DIR_PATH without-registry-auth --address stringfunc (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)
}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@d72e6da75a73ab8fc9b9d19829e5332a2f7da472 call \
--src DIR_PATH add-tags --ref string --tags string1 --tags string2func (m *MyModule) Example(ctx context.Context, src *dagger.Directory, ref string, tags []string) string {
return dag.
Release(src).
AddTags(ctx, ref, tags)
}@function
async def example(src: dagger.Directory, ref: str, tags: List[str]) -> str:
return await (
dag.release(src)
.add_tags(ref, tags)
)@func()
async example(src: Directory, ref: string, tags: string[]): Promise<string> {
return dag
.release(src)
.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@d72e6da75a73ab8fc9b9d19829e5332a2f7da472 call \
--src DIR_PATH extra-tags --ref string --version stringfunc (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@d72e6da75a73ab8fc9b9d19829e5332a2f7da472 call \
--src DIR_PATH create-github --repo string --token env:MYSECRET --version string --notes file:pathfunc (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@d72e6da75a73ab8fc9b9d19829e5332a2f7da472 call \
--src DIR_PATH create-gitlab --project string --token env:MYSECRET --version string --notes file:pathfunc (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 |
|---|---|---|---|
| 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@d72e6da75a73ab8fc9b9d19829e5332a2f7da472 call \
--src DIR_PATH preparefunc (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()
}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@d72e6da75a73ab8fc9b9d19829e5332a2f7da472 call \
python \
checkfunc (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@d72e6da75a73ab8fc9b9d19829e5332a2f7da472 call \
go \
releasefunc (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()
}goPrivate() 🔗
Return Type
String ! Example
dagger -m github.com/act3-ai/dagger/release@d72e6da75a73ab8fc9b9d19829e5332a2f7da472 call \
go \
go-privatefunc (m *MyModule) Example(ctx context.Context) string {
return dag.
Release().
Go().
GoPrivate(ctx)
}@function
async def example() -> str:
return await (
dag.release()
.go()
.go_private()
)@func()
async example(): Promise<string> {
return dag
.release()
.go()
.goPrivate()
}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@d72e6da75a73ab8fc9b9d19829e5332a2f7da472 call \
go \
checkfunc (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()
}verify() 🔗
Verify release version adheres to gorelease standards.
See https://pkg.go.dev/golang.org/x/exp/cmd/gorelease.
Return Type
Void !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| targetVersion | String ! | - | target module version. |
| currentVersion | String | - | current module version. Default: contents of VERSION file, with 'v' prefix added. |
| base | Container | - | base container. |
Example
dagger -m github.com/act3-ai/dagger/release@d72e6da75a73ab8fc9b9d19829e5332a2f7da472 call \
go \
verify --target-version stringfunc (m *MyModule) Example(ctx context.Context, targetVersion string) {
return dag.
Release().
Go().
Verify(ctx, targetVersion)
}@function
async def example(target_version: str) -> None:
return await (
dag.release()
.go()
.verify(target_version)
)@func()
async example(targetVersion: string): Promise<void> {
return dag
.release()
.go()
.verify(targetVersion)
}