> This page is for Postman Docs, version Latest (v12) (default).
> For other versions, use one of these documentation indexes:
> - Latest (v12) (default): https://learning.postman.com/latest-v-12/llms.txt
> - v11: https://learning.postman.com/v11/llms.txt

> For clean Markdown content of this page, append .md to this URL. For the complete documentation index, see https://learning.postman.com/llms.txt.

# Publish Rust SDKs automatically

> **Warning**
>
> Postman SDK Generator is deprecated. To keep generating SDKs, [migrate to Fern](/docs/sdk-generator/migrate-to-fern/). For more information about generating SDKs with Fern, see [Fern's SDK generator documentation](https://buildwithfern.com/learn/sdks/overview/introduction).

You can publish SDKs generated in Postman to crates.io. Automated publishing is supported through GitHub Actions, which can be configured to publish your SDKs to crates.io whenever a new release is created in your GitHub repository. By default, the predefined workflow creates a new release every time an automatic PR is merged.

You can also publish manually from your local machine. To learn more, see [Publish Rust SDKs manually](/docs/sdk-generator/publish/rust-manual/).

To publish your SDKs automatically, use a crates.io API token stored in GitHub secrets.

## Prerequisites

* A [crates.io account](https://crates.io).
* A verified email on the account. crates.io refuses to publish without it.
* The crate name is available, or you are an owner. Names are global and first-come, first-served.
* `Cargo.toml` includes required metadata such as `description` and `license` (or `license-file`).

## Create a crates.io API token and add it to your GitHub repo

A crates.io token (`CARGO_REGISTRY_TOKEN`) is used for authentication with the `cargo publish` command.

To create a crates.io API token and add it to your GitHub repo, do the following:

1. Sign in at [crates.io](https://crates.io) and select **Account Settings > API Tokens > New Token**.
2. Create a token with `publish-update` scope. Add `publish-new` for first publish of a new crate.
3. Restrict the token to this crate name when possible.
4. Copy the token (starts with `cio...`). It's shown only once.
5. In GitHub, select your repository and click **Settings > Secrets and variables > Actions > New repository secret**. Name it `CARGO_REGISTRY_TOKEN` and paste the token.

> **Note**
>
> Publishing to crates.io is permanent. Versions can't be deleted. Use `cargo yank` to prevent new dependents from selecting a version.