Targets Overview
Targets define where Craft publishes your release artifacts. Configure them in .craft.yml under the targets key.
Available Targets
| 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 |
| 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 |
Basic Configuration
targets: - name: npm - name: githubPer-target Options
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$/Running Specific Targets
Use the -t flag with craft publish:
# Publish to all targetscraft publish 1.2.3
# Publish to specific targetcraft publish 1.2.3 -t npm
# Publish to target with IDcraft publish 1.2.3 -t registry[browser]
# Skip publishing (just merge branch)craft publish 1.2.3 -t none