semver
Semantic Versioning utilities with Conventional Commits support.
Installation
dagger install github.com/telchak/daggerverse/semver@v0.1.0Entrypoint
Return Type
Semver ! Example
dagger -m github.com/telchak/daggerverse/semver@010621c997378db92da5969584001be575c5e5a7 call \
func (m *MyModule) Example() *dagger.Semver {
return dag.
Semver()
}@function
def example() -> dagger.Semver:
return (
dag.semver()
)@func()
example(): Semver {
return dag
.semver()
}Types
Semver 🔗
Semantic Versioning utilities with Conventional Commits support.
bump() 🔗
Calculate next version with explicit bump type (ignores commit analysis).
Use this for manual releases where you want to specify the exact bump type.
Return Type
String !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| source | Directory ! | - | Git repository |
| bumpType | String ! | - | Bump type: major, minor, or patch |
| tagPrefix | String ! | "" | Tag prefix for monorepo |
| initialVersion | String ! | "0.1.0" | Initial version if no tags exist |
Example
dagger -m github.com/telchak/daggerverse/semver@010621c997378db92da5969584001be575c5e5a7 call \
bump --source DIR_PATH --bump-type string --tag-prefix string --initial-version stringfunc (m *MyModule) Example(ctx context.Context, source *dagger.Directory, bumpType string, tagPrefix string, initialVersion string) string {
return dag.
Semver().
Bump(ctx, source, bumpType, tagPrefix, initialVersion)
}@function
async def example(source: dagger.Directory, bump_type: str, tag_prefix: str, initial_version: str) -> str:
return await (
dag.semver()
.bump(source, bump_type, tag_prefix, initial_version)
)@func()
async example(source: Directory, bumpType: string, tagPrefix: string, initialVersion: string): Promise<string> {
return dag
.semver()
.bump(source, bumpType, tagPrefix, initialVersion)
}bumpType() 🔗
Analyze commits and return the bump type (major/minor/patch/none).
Return Type
String !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| source | Directory ! | - | Git repository |
| tagPrefix | String ! | "" | Tag prefix for monorepo |
Example
dagger -m github.com/telchak/daggerverse/semver@010621c997378db92da5969584001be575c5e5a7 call \
bump-type --source DIR_PATH --tag-prefix stringfunc (m *MyModule) Example(ctx context.Context, source *dagger.Directory, tagPrefix string) string {
return dag.
Semver().
BumpType(ctx, source, tagPrefix)
}@function
async def example(source: dagger.Directory, tag_prefix: str) -> str:
return await (
dag.semver()
.bump_type(source, tag_prefix)
)@func()
async example(source: Directory, tagPrefix: string): Promise<string> {
return dag
.semver()
.bumpType(source, tagPrefix)
}changedPaths() 🔗
List paths that changed since the last tag.
Useful for detecting which modules in a monorepo need releases. Returns newline-separated list of changed file paths.
Return Type
String !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| source | Directory ! | - | Git repository |
| tagPrefix | String ! | "" | Tag prefix to find last release |
Example
dagger -m github.com/telchak/daggerverse/semver@010621c997378db92da5969584001be575c5e5a7 call \
changed-paths --source DIR_PATH --tag-prefix stringfunc (m *MyModule) Example(ctx context.Context, source *dagger.Directory, tagPrefix string) string {
return dag.
Semver().
ChangedPaths(ctx, source, tagPrefix)
}@function
async def example(source: dagger.Directory, tag_prefix: str) -> str:
return await (
dag.semver()
.changed_paths(source, tag_prefix)
)@func()
async example(source: Directory, tagPrefix: string): Promise<string> {
return dag
.semver()
.changedPaths(source, tagPrefix)
}current() 🔗
Get the current version from the latest matching tag.
Return Type
String !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| source | Directory ! | - | Git repository |
| tagPrefix | String ! | "" | Tag prefix for monorepo |
| initialVersion | String ! | "0.0.0" | Version if no tags exist |
Example
dagger -m github.com/telchak/daggerverse/semver@010621c997378db92da5969584001be575c5e5a7 call \
current --source DIR_PATH --tag-prefix string --initial-version stringfunc (m *MyModule) Example(ctx context.Context, source *dagger.Directory, tagPrefix string, initialVersion string) string {
return dag.
Semver().
Current(ctx, source, tagPrefix, initialVersion)
}@function
async def example(source: dagger.Directory, tag_prefix: str, initial_version: str) -> str:
return await (
dag.semver()
.current(source, tag_prefix, initial_version)
)@func()
async example(source: Directory, tagPrefix: string, initialVersion: string): Promise<string> {
return dag
.semver()
.current(source, tagPrefix, initialVersion)
}next() 🔗
Calculate next semantic version based on conventional commits.
Analyzes commits since the last tag to determine the version bump: - BREAKING CHANGE or ! → major - feat: → minor - fix:, perf:, refactor: → patch
For monorepos, use tag_prefix to filter tags and commits by path.
Return Type
String !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| source | Directory ! | - | Git repository |
| tagPrefix | String ! | "" | Tag prefix for monorepo (e.g., 'mymodule/') |
| defaultBump | String ! | "patch" | Default bump if no conventional commits found |
| initialVersion | String ! | "0.1.0" | Initial version if no tags exist |
Example
dagger -m github.com/telchak/daggerverse/semver@010621c997378db92da5969584001be575c5e5a7 call \
next --source DIR_PATH --tag-prefix string --default-bump string --initial-version stringfunc (m *MyModule) Example(ctx context.Context, source *dagger.Directory, tagPrefix string, defaultBump string, initialVersion string) string {
return dag.
Semver().
Next(ctx, source, tagPrefix, defaultBump, initialVersion)
}@function
async def example(source: dagger.Directory, tag_prefix: str, default_bump: str, initial_version: str) -> str:
return await (
dag.semver()
.next(source, tag_prefix, default_bump, initial_version)
)@func()
async example(source: Directory, tagPrefix: string, defaultBump: string, initialVersion: string): Promise<string> {
return dag
.semver()
.next(source, tagPrefix, defaultBump, initialVersion)
}release() 🔗
Calculate next version and create a git tag.
Returns the new version tag that was created (or would be created if dry_run). If the current commit already has a matching tag, returns that tag (idempotent). If the calculated tag already exists on a different commit, returns a message.
Return Type
String !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| source | Directory ! | - | Git repository |
| githubToken | Secret ! | - | GitHub token for pushing tags |
| tagPrefix | String ! | "" | Tag prefix for monorepo |
| defaultBump | String ! | "patch" | Default bump if no conventional commits |
| initialVersion | String ! | "0.1.0" | Initial version if no tags exist |
| dryRun | Boolean ! | false | Calculate version without creating tag |
Example
dagger -m github.com/telchak/daggerverse/semver@010621c997378db92da5969584001be575c5e5a7 call \
release --source DIR_PATH --github-token env:MYSECRET --tag-prefix string --default-bump string --initial-version string --dry-run booleanfunc (m *MyModule) Example(ctx context.Context, source *dagger.Directory, githubToken *dagger.Secret, tagPrefix string, defaultBump string, initialVersion string, dryRun bool) string {
return dag.
Semver().
Release(ctx, source, githubToken, tagPrefix, defaultBump, initialVersion, dryRun)
}@function
async def example(source: dagger.Directory, github_token: dagger.Secret, tag_prefix: str, default_bump: str, initial_version: str, dry_run: bool) -> str:
return await (
dag.semver()
.release(source, github_token, tag_prefix, default_bump, initial_version, dry_run)
)@func()
async example(source: Directory, githubToken: Secret, tagPrefix: string, defaultBump: string, initialVersion: string, dryRun: boolean): Promise<string> {
return dag
.semver()
.release(source, githubToken, tagPrefix, defaultBump, initialVersion, dryRun)
}tag() 🔗
Create and push a git tag with a specific version.
Use this for manual releases where you want to specify the exact version.
Return Type
String !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| source | Directory ! | - | Git repository |
| version | String ! | - | Version to tag (e.g., 'v1.2.3' or '1.2.3') |
| githubToken | Secret ! | - | GitHub token for pushing tags |
| tagPrefix | String ! | "" | Tag prefix for monorepo |
| dryRun | Boolean ! | false | Calculate without creating tag |
Example
dagger -m github.com/telchak/daggerverse/semver@010621c997378db92da5969584001be575c5e5a7 call \
tag --source DIR_PATH --version string --github-token env:MYSECRET --tag-prefix string --dry-run booleanfunc (m *MyModule) Example(ctx context.Context, source *dagger.Directory, version string, githubToken *dagger.Secret, tagPrefix string, dryRun bool) string {
return dag.
Semver().
Tag(ctx, source, version, githubToken, tagPrefix, dryRun)
}@function
async def example(source: dagger.Directory, version: str, github_token: dagger.Secret, tag_prefix: str, dry_run: bool) -> str:
return await (
dag.semver()
.tag(source, version, github_token, tag_prefix, dry_run)
)@func()
async example(source: Directory, version: string, githubToken: Secret, tagPrefix: string, dryRun: boolean): Promise<string> {
return dag
.semver()
.tag(source, version, githubToken, tagPrefix, dryRun)
}