Skip to content

Targets Overview

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

Available Targets

TargetDescription
GitHubCreate GitHub releases and tags
NPMPublish to NPM registry
PyPIPublish to Python Package Index
CratesPublish Rust crates
NuGetPublish .NET packages
DockerTag and push Docker images
HomebrewUpdate Homebrew formulas
GCSUpload to Google Cloud Storage
GitHub PagesDeploy static sites
CocoaPodsPublish iOS/macOS pods
Ruby GemsPublish Ruby gems
MavenPublish to Maven Central
HexPublish Elixir packages
pub.devPublish Dart/Flutter packages
AWS Lambda LayerPublish Lambda layers
RegistryUpdate Sentry release registry
UPMPublish Unity packages
Symbol CollectorUpload native symbols
PowerShellPublish PowerShell modules
Commit on Git RepositoryPush to a git repository

Basic Configuration

targets:
- name: npm
- name: github

Per-target Options

These options can be applied to any target:

OptionDescription
includeNamesRegex pattern: only matched files are processed
excludeNamesRegex pattern: matched files are skipped
idUnique ID to reference this target with -t target[id]
onlyIfPresentOnly 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$/

Running Specific Targets

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