grekt publish
Publish an artifact to a registry.
bash
grekt publish [path]
grekt publish --changedOptions
| Option | Description |
|---|---|
--s3 | Use S3-compatible storage (legacy mode) |
--changed | Publish only artifacts where local version > registry (workspace mode) |
--dry-run | Show what would be published without publishing |
Examples
bash
# Publish to configured registry
grekt publish ./my-artifact
# Publish current directory
grekt publish
# Publish all changed artifacts in workspace
grekt publish --changed
# Preview what would be published
grekt publish --changed --dry-runAuthentication
Configure your registry first:
bash
grekt config registry set @myteamToken priority:
- Token in
.grekt/config.yamlregistry entry - Environment variable:
GITLAB_TOKENorGITHUB_TOKEN
See Authentication for details.
Behavior
- Validates the manifest (
grekt.yaml) - Validates version is valid semver
- Checks keywords (3-5 required)
- Scans components and auto-generates
componentssection - Creates a tarball in
.grekt/tmp/ - Checks version doesn't already exist
- Uploads to registry
- Sends
licenseandrepository(if present) to the registry - Cleans up tarball
Auto-generated components
The components field in grekt.yaml is auto-generated during publish. Do not edit it manually - it will be overwritten.
Workspace mode
With --changed, grekt:
- Discovers all artifacts in the workspace
- Compares local version vs registry version for each
- Publishes only where local > registry
bash
$ grekt publish --changed
ℹ Checking 3 artifact(s) for changes...
↑ @myorg/auth-rules 1.2.0 (registry: 1.1.0)
= @myorg/api-rules 2.0.0 (up to date)
↑ @myorg/ui-rules 1.0.0 (new)
ℹ 2 artifact(s) to publish
✓ Published @myorg/auth-rules@1.2.0
✓ Published @myorg/ui-rules@1.0.0
✓ Published 2 artifact(s)Requires grekt-workspace.yaml in the current directory.
Error handling
Invalid version:
bash
✗ Invalid version: v1.0.0
ℹ Version must be valid semver (e.g., 1.0.0, 2.1.0-beta.1)Missing keywords:
bash
✗ Manifest requires at least 3 keywords
ℹ Add 'keywords' array to grekt.yaml with 3-5 keywordsVersion exists:
bash
✗ Version 1.0.0 already exists for @author/name
ℹ Bump the version in grekt.yaml and try againRelated commands
- grekt pack - Create tarball without publishing
- grekt version - Bump versions
- grekt workspace - Workspace management
- Monorepo guide - Full workflow