Dagger
Search

nsv

NSV (Next Semantic Version) is a convention-based semantic versioning tool that leans on the power of conventional commits to make versioning your software a breeze!

There are many semantic versioning tools already out there! But they typically require some configuration or custom scripting in your CI system to make them work. No one likes managing config; it is error-prone, and the slightest tweak ultimately triggers a cascade of change across your projects.

Step in NSV. Designed to make intelligent semantic versioning decisions about your project without needing a config file. Entirely convention-based, you can adapt your workflow from within your commit message.

The power is at your fingertips.

Installation

dagger install github.com/purpleclay/daggerverse/nsv@v0.3.0

Entrypoint

Return Type
Nsv !
Arguments
NameTypeDescription
srcDirectory !a path to a directory containing the source code
Example
func (m *myModule) example(src *Directory) *Nsv  {
	return dag.
			Nsv(src)
}
@function
def example(src: dagger.Directory) -> dag.Nsv:
	return (
		dag.nsv(src)
	)
@func()
example(src: Directory): Nsv {
	return dag
		.nsv(src)
}

Types

Nsv 🔗

NSV dagger module

next() 🔗

Prints the next semantic version based on the commit history of your repository

Examples:

Print the next semantic version

$ dagger call next

Print the next semantic version for multiple monorepo sub-projects

$ dagger call next –paths project1,project2

Print the next semantic version and show how the version was calculated

$ dagger call next –show

Return Type
String !
Arguments
NameTypeDefault ValueDescription
paths[String ! ] -a list of relative paths of projects to analyze
showBoolean -show how the next semantic version was calculated
prettyString "full"pretty-print the output of the next semantic version in a given format. Supported formats are (full, compact). Must be used in conjunction with the show flag
Example
dagger -m github.com/purpleclay/daggerverse/nsv@8bbc22b125bbcebbe1b1382969cca636824c6fcc call \
 --src DIR_PATH next
func (m *myModule) example(ctx context.Context, src *Directory) string  {
	return dag.
			Nsv(src).
			Next(ctx)
}
@function
async def example(src: dagger.Directory) -> str:
	return await (
		dag.nsv(src)
		.next()
	)
@func()
async example(src: Directory): Promise<string> {
	return dag
		.nsv(src)
		.next()
}

tag() 🔗

Tags the next semantic version based on the commit history of your repository

Examples:

Tag the next semantic version

$ dagger call tag

Tag the next semantic version for multiple monorepo sub-projects

$ dagger call tag –paths project1,project2

Tag the next semantic version and show how the version was calculated

$ dagger call tag –show

Return Type
String !
Arguments
NameTypeDefault ValueDescription
paths[String ! ] -a list of relative paths of projects to analyze
showBoolean -show how the next semantic version was calculated
prettyString "full"pretty-print the output of the next semantic version in a given format. Supported formats are (full, compact). Must be used in conjunction with the show flag
gpgPassphraseSecret -an optional passphrase to unlock the GPG private key used for signing the tag
gpgPrivateKeySecret -a base64 encoded GPG private key (armored) used for signing the tag
Example
dagger -m github.com/purpleclay/daggerverse/nsv@8bbc22b125bbcebbe1b1382969cca636824c6fcc call \
 --src DIR_PATH tag
func (m *myModule) example(ctx context.Context, src *Directory) string  {
	return dag.
			Nsv(src).
			Tag(ctx)
}
@function
async def example(src: dagger.Directory) -> str:
	return await (
		dag.nsv(src)
		.tag()
	)
@func()
async example(src: Directory): Promise<string> {
	return dag
		.nsv(src)
		.tag()
}