> ## Documentation Index
> Fetch the complete documentation index at: https://anaconda.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Uploading packages

## Uploading conda packages

This example shows how to build and upload a [conda](https://docs.conda.io/projects/conda-build/en/stable/index.html) package to Anaconda.org using `conda build`.

1. Open Anaconda Prompt (A command-line application included with Windows installations of Anaconda Distribution and Miniconda. Find it by searching 'Anaconda Prompt' in the Windows Start menu.) (Terminal on macOS/Linux).

2. If necessary, install the `anaconda-client` and `conda-build` packages by running the following command:

   ```sh theme={null}
   conda install anaconda-client conda-build
   ```

3. Choose the repository for which you would like to build the package. In this example, we use a small public [conda test package](https://github.com/Anaconda-Platform/anaconda-client/tree/master/example-packages/conda):

   ```sh theme={null}
   # Replace <PACKAGE> with the package name
   git clone https://github.com/Anaconda-Platform/anaconda-client
   cd anaconda-client/<PACKAGE>/conda/
   ```

   There are two required files in the example package: [meta.yaml](https://github.com/Anaconda-Platform/anaconda-client/blob/master/example-packages/conda/meta.yaml) and [build.sh](https://github.com/Anaconda-Platform/anaconda-client/blob/master/example-packages/conda/build.sh).

   macOS and Linux systems are Unix-like systems. Packages built for Unix-like systems require a `build.sh` file, packages built for Windows require a `bld.bat` file, and packages built for both Windows and Unix-like systems require both a `build.sh` file and a `bld.bat` file. All packages require a `meta.yaml` file.

4. To build the package, turn off automatic client uploading and then run the `conda build` command:

   ```sh theme={null}
   conda config --set anaconda_upload no
   conda build .
   ```

   All packages built using the `conda build` command are placed in a subdirectory of the [Anaconda](https://anaconda.com/docs/getting-started/concepts/anaconda-or-miniconda.md) `conda-bld` directory.

   > [!TIP]
   >
   > You can check where the resulting file was placed by adding the `--output` option:
   >
   > ```sh theme={null}
   > conda build . --output
   > ```

5. Upload the test package to Anaconda.org by running the `anaconda upload` command:

   ```sh theme={null}
   anaconda login
   anaconda upload </PATH/TO/PACKAGE_NAME>.tar.bz2
   anaconda upload </PATH/TO/PACKAGE_NAME>.conda
   ```

   Comments

   Replace \</PATH/TO/PACKAGE\_NAME> with the correct file path and package name.\\

   Packages can be uploaded with `.tar.bz`2 or `.conda` compression formats.

For more information on the `.conda` format, see [Using the .conda compression format](https://docs.conda.io/projects/conda/en/latest/user-guide/concepts/packages.html#conda-file-format).

For more information on conda's overall build framework, see [Building conda packages](https://docs.conda.io/projects/conda-build/en/stable/concepts/recipe.html) in the official conda docs.

## Uploading standard Python packages

You can test standard Python package uploading with a small public example package saved in the [anaconda-client repository](https://github.com/Anaconda-Platform/anaconda-client/tree/master/example-packages/pypi).

Use Anaconda Prompt (A command-line application included with Windows installations of Anaconda Distribution and Miniconda. Find it by searching 'Anaconda Prompt' in the Windows Start menu.) (Terminal on macOS/Linux) to perform the following steps:

1. Clone the repository:

   ```sh theme={null}
   # Replace <PACKAGE> with the package name
   git clone git@github.com:Anaconda-Platform/anaconda-client.git
   cd anaconda-client/<PACKAGE>/pypi/
   ```

2. Create your standard Python package using the `setup.py` script:

   ```sh theme={null}
   python setup.py sdist
   ```

3. Upload your newly built package tarball file:

   ```sh theme={null}
   anaconda upload dist/*.tar.gz
   ```

   Your package is now available at `http://anaconda.org/<USERNAME>/<PACKAGE>`, where `<USERNAME>` is your username and `<PACKAGE>` is the package name.

## Uploading packages with GitHub Actions

To automate package uploads as part of a CI/CD pipeline, or to migrate existing CLI-based upload workflows, see [Anaconda GitHub Actions](https://anaconda.com/docs/cli-reference/anaconda-cli/github-actions.md#upload-package).

## Additional help for uploading packages

To view a complete list of upload options, including channel, label, availability, and metadata options, run the following in Anaconda Prompt (A command-line application included with Windows installations of Anaconda Distribution and Miniconda. Find it by searching 'Anaconda Prompt' in the Windows Start menu.) (Terminal on macOS/Linux):

```sh theme={null}
anaconda upload -h
```

> [card] [Conda Essentials course](https://learning.anaconda.com/courses/conda-essentials)
>
> Sign in to anaconda.com and enroll in this free course to learn to write conda recipes and build packages with `conda-build`.
