calver
Supports configurable date formats (YYYY.MM.DD, v.YYYY.MM.MICRO, etc.), automatic micro versionincrementing from git tags, and optional tag pushing to remote repositories.
Installation
dagger install github.com/telchak/daggerverse/calver@v0.1.0Entrypoint
Return Type
Calver ! Example
dagger -m github.com/telchak/daggerverse/calver@010621c997378db92da5969584001be575c5e5a7 call \
func (m *MyModule) Example() *dagger.Calver {
return dag.
Calver()
}@function
def example() -> dagger.Calver:
return (
dag.calver()
)@func()
example(): Calver {
return dag
.calver()
}Types
Calver 🔗
Calendar Versioning (CalVer) utilities.
generate() 🔗
Generate CalVer version string based on current date.
If the current commit already has a CalVer tag matching the pattern, that existing tag is returned (preventing duplicate tags on same commit). Otherwise, generates a new version and optionally pushes the tag.
Return Type
String !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| format | String ! | "YYYY.MM.DD" | CalVer format (YYYY.MM.DD, v.YYYY.MM.MICRO, etc.) |
| micro | Integer ! | 0 | Manual micro/patch version |
| source | Directory | null | Git repo (enables auto-increment) |
| pushTag | Boolean ! | false | Push generated tag to remote repository |
| githubToken | Secret | null | GitHub token for pushing tags |
Example
dagger -m github.com/telchak/daggerverse/calver@010621c997378db92da5969584001be575c5e5a7 call \
generate --format string --micro integer --push-tag booleanfunc (m *MyModule) Example(ctx context.Context, format string, micro int, pushTag bool) string {
return dag.
Calver().
Generate(ctx, format, micro, pushTag)
}@function
async def example(format: str, micro: int, push_tag: bool) -> str:
return await (
dag.calver()
.generate(format, micro, push_tag)
)@func()
async example(format: string, micro: number, pushTag: boolean): Promise<string> {
return dag
.calver()
.generate(format, micro, pushTag)
}