Dagger
Search

calver

Supports configurable date formats (YYYY.MM.DD, v.YYYY.MM.MICRO, etc.), automatic micro version
incrementing from git tags, and optional tag pushing to remote repositories.

Installation

dagger install github.com/telchak/daggerverse/calver@v0.1.0

Entrypoint

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
NameTypeDefault ValueDescription
formatString !"YYYY.MM.DD"CalVer format (YYYY.MM.DD, v.YYYY.MM.MICRO, etc.)
microInteger !0Manual micro/patch version
sourceDirectory nullGit repo (enables auto-increment)
pushTagBoolean !falsePush generated tag to remote repository
githubTokenSecret nullGitHub token for pushing tags
Example
dagger -m github.com/telchak/daggerverse/calver@010621c997378db92da5969584001be575c5e5a7 call \
 generate --format string --micro integer --push-tag boolean
func (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)
}