## buffrs publish
Generates a release and publishes it to the specified registry.
### Synopsis
`buffrs publish [OPTIONS] --registry <REGISTRY> --repository <REPOSITORY>`
### Options
* `--allow-dirty`: allows publishing the package even if the repository has
uncommitted changes.
* `--dry-run`: causes a release bundle to be generated but skips uploading to
the registry.
* `--set-version`: allows you to override the version set in the manifest
* `--preserve-mtime`: preserve access time information when creating a package (defaults to `true`)
### Description
The `publish` command bundles the package's protocol buffer files and manifest
into a gzip-compressed tarball, which is then uploaded to the specified registry
and repository for publication. Once published the artifact will be available
for other packages to be installed as dependencies.
In order for this command to be successful, the registry must be reachable via
the network, and if authorization is required, credentials must have been
previously saved via a [`buffrs login`](buffrs-login.md) invocation.
By default, Buffrs does not allow publishing packages from git repositories in a
dirty state (note: this requires the `git` feature to be enabled). This
behaviour can be overridden by passing the `--allow-dirty` flag.
Since version 0.12, `buffrs publish` supports [local dependencies](../guide/local-dependencies.md)
and [workspaces](../guide/workspaces.md):
- **Local dependencies**: Automatically publishes local dependencies first, then rewrites references to point to the registry
- **Workspaces**: When run from a workspace root, publishes all workspace members in dependency order with automatic deduplication
#### Supported project types
Only Buffrs libraries and API packages can be packaged and published. More details in [Package Types](../guide/package-types.md).
Library packages cannot have dependencies, so releasing this kind of package may
fail if any are provided in the manifest. API dependencies on library packages
is also forbidden and will cause publication to fail.