Skip to content

Packages

A package is a set of files that Knope releases together with the same version. Knope can increase this version based on changes that affect the package.

A project can either consist of a single package:

knope.toml
[package]
# package config here

Or multiple packages:

knope.toml
[packages."<name>"] # where you replace <name> with the name of the package
# package config here
[packages."<other_name>"] # and so on
# package config here

versioned_files

The files within a package that contain the current version. This is an array of strings, each of which is a file path relative to the knope.toml file. Each file must have the same version number as all the other files.

Knope determines the type of the file using its name (independent of its path), so blah/Cargo.toml is a Cargo.toml file.

Knope supports the following file names:

Cargo.toml

For versioning Rust projects. Must contain version and name fields in the package table, like so:

Cargo.toml
[package]
name = "my-package"
version = "1.0.0"

pyproject.toml

For Python projects using PEP-621 or Poetry. Must contain either a [project.version] or [tool.poetry.version] value, respectively. If it has both values, they must be the same.

pyproject.toml
[project] # PEP-621
version = "1.0.0"
[tool.poetry] # Poetry
version = "1.0.0"

package.json

For JavaScript or TypeScript projects, must contain a root-level version field:

package.json
{
"version": "1.0.0"
}

go.mod

For Go projects using modules. Must contain a module line which must end in the major version for any greater than 1. Can optionally contain a comment containing the full version. If this comment isn’t present, Knope uses the latest matching Git tag to find the version.

go.mod
module github.com/knope-dev/knope // v0.0.1
go.mod
module github.com/knope-dev/knope/v2 // v2.0.0

To omit the major version from the module line (e.g., for binaries, where it doesn’t matter much), use the ignore_go_major_versioning option.

pubspec.yaml

For Dart projects, must contain a version field:

pubspec.yaml
version: 1.0.0

changelog

The relative path to a Markdown file you’d like to add release notes to.

knope.toml
[package]
changelog = "CHANGELOG.md"

scopes

An array of conventional commit scopes that Knope should consider for the package. If not defined, Knope will consider all scopes. Commits with no scope are always considered.

knope.toml
[packages.knope]
scopes = ["knope", "all"]
[packages.changesets]
scopes = ["changesets", "all"]

extra_changelog_sections

An array of objects defining more sections for the changelog (or overrides for the default sections). Each object can optionally have an array of footers or an array of types.

[package]
extra_changelog_sections = [
{ name = "Security", footers = ["Security-Note"], types = ["security"]}
]

assets

Assets is a list of files to upload to a GitHub release. They do nothing without GitHub configuration. Assets are per-package. Each asset can optionally have a name, this is what it will appear as in GitHub releases. The name defaults to the final part of the path.

[package]
[[package.assets]]
path = "artifact/my-binary-linux-amd64.tgz"
name = "linux-amd64.tgz"
[[package.assets]]
path = "artifact/my-binary-darwin-amd64.tgz" # name will be "my-binary-darwin-amd64.tgz"

ignore_go_major_versioning

Go has special rules about major versions above 1. Specifically, the module line in go.mod must end in the major version. By default, Knope follows these rules, so if there is no major version at the end of the module line, Knope will assume you’re updating the latest 1.x or 0.x tag.

To ignore this rule, and always use the latest tag (even if it doesn’t match the module line), set ignore_go_major_versioning to true in the package config:

knope.toml
[package]
versioned_files = ["go.mod"]
ignore_go_major_versioning = true