Skip to content

Targets Overview

Targets define where Craft publishes your release artifacts. Configure them in .craft.yml under the targets key.

Target Description
GitHub Create GitHub releases and tags
NPM Publish to NPM registry
PyPI Publish to Python Package Index
Crates Publish Rust crates
NuGet Publish .NET packages
Docker Tag and push Docker images
Homebrew Update Homebrew formulas
GCS Upload to Google Cloud Storage
GitHub Pages Deploy static sites
Cloudflare Deploy static sites or Workers to Cloudflare
CocoaPods Publish iOS/macOS pods
Ruby Gems Publish Ruby gems
Maven Publish to Maven Central
Hex Publish Elixir packages
pub.dev Publish Dart/Flutter packages
AWS Lambda Layer Publish Lambda layers
Registry Update Sentry release registry
UPM Publish Unity packages
Symbol Collector Upload native symbols
PowerShell Publish PowerShell modules
Commit on Git Repository Push to a git repository
targets:
- name: npm
- name: github

These options can be applied to any target:

Option Description
includeNames Regex pattern: only matched files are processed
excludeNames Regex pattern: matched files are skipped
id Unique ID to reference this target with -t target[id]
onlyIfPresent Only run if a file matching this pattern exists

Example:

targets:
- name: github
includeNames: /^.*\.exe$/
excludeNames: /^test.exe$/
- name: registry
id: browser
onlyIfPresent: /^sentry-browser-.*\.tgz$/

Use the -t flag with craft publish:

Terminal window
# Publish to all targets
craft publish 1.2.3
# Publish to specific target
craft publish 1.2.3 -t npm
# Publish to target with ID
craft publish 1.2.3 -t registry[browser]
# Skip publishing (just merge branch)
craft publish 1.2.3 -t none