Publishing a plugin#
This guide starts from a built plugin binary. See Writing a plugin to build one.
Package the plugin#
Put the binary and any files it needs in one directory, then run:
kevin plugin pack ./dist/echo \
-o ./dist/kevin-plugin-echo.tar.gz \
--name echo --version 1.0.0 --entrypoint kevin-plugin-echopack writes a manifest.json into the archive:
{
"$v": 1,
"name": "echo",
"version": "1.0.0",
"entrypoint": "kevin-plugin-echo"
}If the directory already has a manifest.json, the flags replace its fields. --name must match the plugins: key that users give the plugin. See kevin plugin pack for every flag.
Sign the package#
Use one scheme.
minisign. Sign with your minisign secret key:
minisign -Sm ./dist/kevin-plugin-echo.tar.gzThis writes kevin-plugin-echo.tar.gz.minisig. Give users your public key file.
sigstore. Sign with cosign. cosign opens a browser for an OIDC login, or uses the credentials of a CI job:
cosign sign-blob --yes \
--bundle ./dist/kevin-plugin-echo.tar.gz.sigstore.json \
./dist/kevin-plugin-echo.tar.gzTell users the identity (an email, or a GitHub Actions workflow URI) and the issuer URL of the certificate.
Publish the package#
To an OCI registry, after docker login:
kevin plugin push ./dist/kevin-plugin-echo.tar.gz ghcr.io/acme/kevin-plugin-echo:v1push also uploads a .minisig or .sigstore.json file next to the archive. Push only one of them: a registry holds one signature for each package digest.
To publish over HTTP, put the signature file at the archive’s URL with the signature suffix added, for example https://example.com/echo.tar.gz and https://example.com/echo.tar.gz.minisig.
List the plugin in an index#
In the index repository, add
plugins/<name>/plugin.yamlif the plugin is new:name: echo summary: prints a message homepage: https://github.com/acme/kevin-plugin-echo signers: - scheme: minisign key: | untrusted comment: echo release key RWQf6LRCGA9i53mlYecO4IzT51TGPpvWucNSCh1CBM0QTaLn73Y7GFO3A
minisignsigner’skeyis the content of your public key file.For each release, add
plugins/<name>/versions/<version>.yaml. Do not change it after you publish it:version: 1.1.0 source: oci: ghcr.io/acme/kevin-plugin-echo:v1.1.0 signing: scheme: minisignCommit and push.
See Plugin index format for every field.
Publish versions from a separate repository#
To let release automation publish versions without write access to the index:
Set
version_sourceinplugin.yaml:version_source: https://github.com/acme/kevin-plugin-echo-releasesIn that repository, add
kevin-index.yamlwithlayout: 1, and add version files atplugins/<name>/versions/<version>.yaml.Sign each version file with a signer from
plugin.yaml:minisign -Sm plugins/echo/versions/1.1.0.yaml # or cosign sign-blob --yes --bundle plugins/echo/versions/1.1.0.yaml.sigstore.json plugins/echo/versions/1.1.0.yamlkevin plugin index updateskips a version file with no valid signature.
Related#
- Plugin trust: why signers live in
plugin.yaml, and whatversion_sourceprotects against. - Third-party plugins: the user side of these steps.