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:
Or multiple packages:
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:
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.
package.json
For JavaScript or TypeScript projects, must contain a root-level version
field:
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.
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:
changelog
The relative path to a Markdown file you’d like to add release notes to.
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.
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
.
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.
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: