Skip to content

Configuration

Project configuration for Craft is stored in .craft.yml in the project root.

GitHub Project

Craft tries to determine GitHub repo information from the local git repo. You can also hard-code it:

github:
owner: getsentry
repo: sentry-javascript

Pre-release Command

This command runs on your release branch as part of craft prepare. Default: bash scripts/bump-version.sh.

preReleaseCommand: bash scripts/bump-version.sh

The script should:

  • Accept old and new version as the last two arguments
  • Replace version occurrences
  • Not commit changes
  • Not change git state

Example script:

#!/bin/bash
set -eux
OLD_VERSION="${1}"
NEW_VERSION="${2}"
export npm_config_git_tag_version=false
npm version "${NEW_VERSION}"

Post-release Command

This command runs after a successful craft publish. Default: bash scripts/post-release.sh.

postReleaseCommand: bash scripts/post-release.sh

Release Branch Name

Override the release branch prefix. Default: release.

releaseBranchPrefix: publish

Full branch name: {releaseBranchPrefix}/{version}

Changelog Policies

Craft supports simple and auto changelog management modes.

Simple Mode

Reminds you to add a changelog entry:

changelog: CHANGES

Or with options:

changelog:
filePath: CHANGES.md
policy: simple

Auto Mode

Automatically generates changelog from commits:

changelog:
policy: auto

Auto mode uses .github/release.yml to categorize PRs by labels or commit patterns. If not present, it uses default Conventional Commits patterns:

CategoryPattern
Breaking Changes^\w+(\(\w+\))?!:
Build / dependencies^(build|ref|chore|ci)(\(\w+\))?:
Bug Fixes^fix(\(\w+\))?:
Documentation^docs?(\(\w+\))?:
New Features^feat(\(\w+\))?:

Example .github/release.yml:

changelog:
categories:
- title: Features
labels:
- enhancement
commit_patterns:
- "^feat(\\(\\w+\\))?:"
- title: Bug Fixes
labels:
- bug
commit_patterns:
- "^fix(\\(\\w+\\))?:"

Scope Grouping

Changes are automatically grouped by scope (e.g., feat(api): groups under “Api”):

changelog:
policy: auto
scopeGrouping: true # default

Configuration Options

OptionDescription
changelogPath to changelog file (string) OR configuration object
changelog.filePathPath to changelog file. Default: CHANGELOG.md
changelog.policyMode: none, simple, or auto. Default: none
changelog.scopeGroupingEnable scope-based grouping. Default: true

Versioning

Configure default versioning behavior:

versioning:
policy: auto # auto, manual, or calver

Versioning Policies

PolicyDescription
autoAnalyze commits to determine version bump (default when using craft prepare auto)
manualRequire explicit version argument
calverUse calendar-based versioning

Calendar Versioning (CalVer)

For projects using calendar-based versions:

versioning:
policy: calver
calver:
format: "%y.%-m" # e.g., 24.12 for December 2024
offset: 14 # Days to look back for date calculation

Format supports:

  • %y - 2-digit year
  • %m - Zero-padded month
  • %-m - Month without padding

Minimal Version

Require a minimum Craft version:

minVersion: '0.5.0'

Required Files

Ensure specific artifacts exist before publishing:

requireNames:
- /^sentry-craft.*\.tgz$/
- /^gh-pages.zip$/

Status Provider

Configure build status checks:

statusProvider:
name: github
config:
contexts:
- Travis CI - Branch

Artifact Provider

Configure where to fetch artifacts from:

artifactProvider:
name: github # or 'gcs' or 'none'

Targets

List release targets in your configuration:

targets:
- name: npm
- name: github
- name: registry
id: browser
type: sdk
onlyIfPresent: /^sentry-browser-.*\.tgz$/

See Target Configurations for details on each target.

Per-target Options

These options apply to all targets:

OptionDescription
includeNamesRegex: only matched files are processed
excludeNamesRegex: matched files are skipped
idUnique ID for the target (use with -t target[id])

Example:

targets:
- name: github
includeNames: /^.*\.exe$/
excludeNames: /^test.exe$/