---
title: rattler-build publish
---
<!--- This file is autogenerated. Do not edit manually! -->
# [rattler-build](index.md) publish

Publish packages to a channel. This command builds packages from recipes (or uses already built packages), uploads them to a channel, and runs indexing

## Usage
```
rattler-build publish [OPTIONS] --to <TO> [PACKAGE_OR_RECIPE]...
```

## Arguments
- <a id="arg-PACKAGE_OR_RECIPE" href="#arg-PACKAGE_OR_RECIPE">`<PACKAGE_OR_RECIPE>`</a>
:  Package files (*.conda, *.tar.bz2) to publish directly, or recipe files (*.yaml) to build and publish. If .conda or .tar.bz2 files are provided, they will be published directly without building. If .yaml files are provided, they will be built first, then published. Use --recipe-dir (from build options below) to scan a directory for recipes instead. Defaults to "recipe.yaml" in the current directory if not specified
<br>May be provided more than once.
<br>**default**: `recipe.yaml`

## Options
- <a id="arg---recipe" href="#arg---recipe">`--recipe (-r) <RECIPES>`</a>
:  The recipe file or directory containing `recipe.yaml`. Defaults to the current directory
<br>May be provided more than once.
<br>**default**: `.`
- <a id="arg---recipe-dir" href="#arg---recipe-dir">`--recipe-dir <RECIPE_DIR>`</a>
:  The directory that contains recipes
- <a id="arg---up-to" href="#arg---up-to">`--up-to <UP_TO>`</a>
:  Build recipes up to the specified package
- <a id="arg---build-platform" href="#arg---build-platform">`--build-platform <BUILD_PLATFORM>`</a>
:  The build platform to use for the build (e.g. for building with emulation, or rendering)
- <a id="arg---target-platform" href="#arg---target-platform">`--target-platform <TARGET_PLATFORM>`</a>
:  The target platform for the build
- <a id="arg---host-platform" href="#arg---host-platform">`--host-platform <HOST_PLATFORM>`</a>
:  The host platform for the build. If set, it will be used to determine also the target_platform (as long as it is not noarch)
- <a id="arg---channel" href="#arg---channel">`--channel (-c) <CHANNELS>`</a>
:  Add a channel to search for dependencies in
<br>May be provided more than once.
- <a id="arg---variant-config" href="#arg---variant-config">`--variant-config (-m) <VARIANT_CONFIG>`</a>
:  Variant configuration files for the build
<br>May be provided more than once.
- <a id="arg---variant" href="#arg---variant">`--variant <VARIANT_OVERRIDES>`</a>
:  Override specific variant values (e.g. --variant python=3.12 or --variant python=3.12,3.11). Multiple values separated by commas will create multiple build variants
<br>May be provided more than once.
- <a id="arg---ignore-recipe-variants" href="#arg---ignore-recipe-variants">`--ignore-recipe-variants`</a>
:  Do not read the `variants.yaml` file next to a recipe
- <a id="arg---render-only" href="#arg---render-only">`--render-only`</a>
:  Render the recipe files without executing the build
- <a id="arg---with-solve" href="#arg---with-solve">`--with-solve`</a>
:  Render the recipe files with solving dependencies
- <a id="arg---keep-build" href="#arg---keep-build">`--keep-build`</a>
:  Keep intermediate build artifacts after the build
- <a id="arg---no-build-id" href="#arg---no-build-id">`--no-build-id`</a>
:  Don't use build id(timestamp) when creating build directory name
- <a id="arg---compression-threads" href="#arg---compression-threads">`--compression-threads <COMPRESSION_THREADS>`</a>
:  The number of threads to use for compression (only relevant when also using `--package-format conda`)
- <a id="arg---io-concurrency-limit" href="#arg---io-concurrency-limit">`--io-concurrency-limit <IO_CONCURRENCY_LIMIT>`</a>
:  The maximum number of concurrent I/O operations to use when installing packages This can be controlled by the `RATTLER_IO_CONCURRENCY_LIMIT` environment variable Defaults to 8 times the number of CPUs
<br>**env**: `RATTLER_IO_CONCURRENCY_LIMIT`
- <a id="arg---experimental" href="#arg---experimental">`--experimental`</a>
:  Enable experimental features
<br>**env**: `RATTLER_BUILD_EXPERIMENTAL`
- <a id="arg---v3" href="#arg---v3">`--v3`</a>
:  Enable V3 recipe fields and MatchSpec syntax
- <a id="arg---allow-insecure-host" href="#arg---allow-insecure-host">`--allow-insecure-host <ALLOW_INSECURE_HOST>`</a>
:  List of hosts for which SSL certificate verification should be skipped
<br>May be provided more than once.
- <a id="arg---channel-priority" href="#arg---channel-priority">`--channel-priority <CHANNEL_PRIORITY>`</a>
:  Channel priority to use when solving
- <a id="arg---extra-meta" href="#arg---extra-meta">`--extra-meta <EXTRA_META>`</a>
:  Extra metadata to include in about.json
<br>May be provided more than once.
- <a id="arg---continue-on-failure" href="#arg---continue-on-failure">`--continue-on-failure`</a>
:  Continue building even if (one) of the packages fails to build. This is useful when building many packages with `--recipe-dir`.`

## Modifying result
- <a id="arg---package-format" href="#arg---package-format">`--package-format <PACKAGE_FORMAT>`</a>
:  The package format to use for the build. Can be one of `tar-bz2` or
`conda`. You can also add a compression level to the package format,
e.g. `tar-bz2:<number>` (from 1 to 9) or `conda:<number>` (from -7 to
22).
- <a id="arg---no-include-recipe" href="#arg---no-include-recipe">`--no-include-recipe`</a>
:  Don't store the recipe in the final package
- <a id="arg---test" href="#arg---test">`--test <TEST>`</a>
:  The strategy to use for running tests
<br>**options**: `skip`, `native`, `native-and-emulated`
- <a id="arg---color-build-log" href="#arg---color-build-log">`--color-build-log`</a>
:  Don't force colors in the output of the build script
<br>**default**: `true`
- <a id="arg---env-isolation" href="#arg---env-isolation">`--env-isolation <ENV_ISOLATION>`</a>
:  Environment isolation mode for build scripts. `strict` (default): clean environment with normalized locale, HOME, USER etc. `conda-build`: match conda-build behavior (forward CFLAGS, LDFLAGS, LANG, HOME etc.) `none`: inherit the entire host environment
<br>**default**: `strict`
- <a id="arg---output-dir" href="#arg---output-dir">`--output-dir <OUTPUT_DIR>`</a>
:  Output directory for build artifacts.
<br>**env**: `CONDA_BLD_PATH`
- <a id="arg---skip-existing" href="#arg---skip-existing">`--skip-existing <SKIP_EXISTING>`</a>
:  Whether to skip packages that already exist in any channel If set to `none`, do not skip any packages, default when not specified. If set to `local`, only skip packages that already exist locally, default when using `--skip-existing. If set to `all`, skip packages that already exist in any channel
<br>**options**: `none`, `local`, `all`
- <a id="arg---noarch-build-platform" href="#arg---noarch-build-platform">`--noarch-build-platform <NOARCH_BUILD_PLATFORM>`</a>
:  Define a "noarch platform" for which the noarch packages will be built for. The noarch builds will be skipped on the other platforms
- <a id="arg---markdown-summary" href="#arg---markdown-summary">`--markdown-summary <MARKDOWN_SUMMARY>`</a>
:  Write a markdown summary to the specified file (appends to the file). Useful for generating PR comments or custom reports
- <a id="arg---error-prefix-in-binary" href="#arg---error-prefix-in-binary">`--error-prefix-in-binary`</a>
:  Error if the host prefix is detected in any binary files
- <a id="arg---allow-symlinks-on-windows" href="#arg---allow-symlinks-on-windows">`--allow-symlinks-on-windows`</a>
:  Allow symlinks in packages on Windows (defaults to false - symlinks are forbidden on Windows)
- <a id="arg---exclude-newer" href="#arg---exclude-newer">`--exclude-newer <EXCLUDE_NEWER>`</a>
:  Exclude packages newer than this date from the solver, in RFC3339 format (e.g. 2024-03-15T12:00:00Z)

## Publishing
- <a id="arg---to" href="#arg---to">`--to <TO>`</a>
:  The channel or URL to publish the package to
<br>**required**: `true`
- <a id="arg---build-number" href="#arg---build-number">`--build-number <BUILD_NUMBER>`</a>
:  Override the build number for all outputs. Use an absolute value (e.g., `--build-number=12`) or a relative bump (e.g., `--build-number=+1`). When using a relative bump, the highest build number from the target channel is used as the base
- <a id="arg---build-string-prefix" href="#arg---build-string-prefix">`--build-string-prefix <BUILD_STRING_PREFIX>`</a>
:  Prefix to prepend to the auto-generated build string (e.g. `--build-string-prefix my_prefix` produces `my_prefix_h1234_0`)
- <a id="arg---force" href="#arg---force">`--force`</a>
:  Force upload even if the package already exists (not recommended - may break lockfiles). Only works with S3, filesystem, Anaconda.org, and prefix.dev channels
- <a id="arg---generate-attestation" href="#arg---generate-attestation">`--generate-attestation`</a>
:  Automatically generate attestations when uploading to prefix.dev channels. Only works when uploading to prefix.dev channels with trusted publishing enabled

## Sandbox arguments
- <a id="arg---sandbox" href="#arg---sandbox">`--sandbox`</a>
:  Enable the sandbox
- <a id="arg---allow-network" href="#arg---allow-network">`--allow-network`</a>
:  Allow network access during build (default: false if sandbox is enabled)
- <a id="arg---allow-read" href="#arg---allow-read">`--allow-read <ALLOW_READ>`</a>
:  Allow read access to the specified paths
<br>May be provided more than once.
- <a id="arg---allow-read-execute" href="#arg---allow-read-execute">`--allow-read-execute <ALLOW_READ_EXECUTE>`</a>
:  Allow read and execute access to the specified paths
<br>May be provided more than once.
- <a id="arg---allow-read-write" href="#arg---allow-read-write">`--allow-read-write <ALLOW_READ_WRITE>`</a>
:  Allow read and write access to the specified paths
<br>May be provided more than once.
- <a id="arg---overwrite-default-sandbox-config" href="#arg---overwrite-default-sandbox-config">`--overwrite-default-sandbox-config`</a>
:  Overwrite the default sandbox configuration
