Skip to content

GitHub

Creates a release on GitHub. If a Markdown changelog is present, this target reads the release name and description from it.

OptionDescription
tagPrefixPrefix for new git tags (e.g., v). Empty by default.
previewReleasesAutomatically detect and create preview releases. Default: true
tagOnlyOnly create a tag (without a GitHub release). Default: false
floatingTagsList of floating tags to create/update. Supports {major}, {minor}, {patch} placeholders.
NameDescription
GITHUB_TOKENPersonal GitHub API token (create one)
targets:
- name: github
tagPrefix: v
previewReleases: true

Use floatingTags to maintain “latest major version” tags that always point to the most recent release:

targets:
- name: github
floatingTags:
- "v{major}" # Creates v2 for version 2.15.0
- "v{major}.{minor}" # Creates v2.15 for version 2.15.0

This is useful for users who want to pin to a major version while automatically receiving updates.

Monorepo: independently-versioned products

Section titled “Monorepo: independently-versioned products”

tagPrefix lets a single repository host several independently-versioned products by namespacing their git tags — for example cli@1.2.3 and mcp@2.0.0. Craft honors the prefix on both the write side (the tag it creates) and the read side (latest-tag detection, changelog base, and CalVer scans are all scoped to the prefix), so the products don’t cross-contaminate each other’s version history.

The intended layout is one .craft.yml per product, each with a single github target declaring its own tagPrefix and a matching releaseBranchPrefix (so release branches don’t collide):

# .craft.yml for the CLI product
github:
owner: getsentry
repo: toolkit
releaseBranchPrefix: release/cli
targets:
- name: github
tagPrefix: "cli@"
# .craft.yml for the MCP product
github:
owner: getsentry
repo: toolkit
releaseBranchPrefix: release/mcp
targets:
- name: github
tagPrefix: "mcp@"

Releasing 1.2.3 for each product then produces the tags cli@1.2.3 / mcp@1.2.3 on release branches release/cli/1.2.3 / release/mcp/1.2.3 — no collisions.

If previewReleases is true (default), releases containing pre-release identifiers like alpha, beta, rc, etc. are marked as pre-releases on GitHub.