You can use the Artifactory API to publish crates directly with a cURL command.
To publish a crate using cURL:
Run the following command:
curl -u<USERNAME>:<AUTH> -XPUT "https://[JFrogPlatformURL]/artifactory/<REPO_NAME>/crates/<TARGET_PATH>" -T <LOCAL_FILE>Where:
<USERNAME>: Your Artifactory username[JFrogPlatformURL]: Your organization's Artifactory URL<REPO_NAME>: The name of your Cargo repository in Artifactory<TARGET_PATH>: The target path for publishing the crate in your Cargo repository. For more information, see Cargo Path Format<LOCAL_FILE>: The path to the crate file on your local machine
For example:
curl -u jeffry:x7rT4hL9bA2vW1pZ5sE8dR6gK3jCqV0nU7fM9yB4iO1uF2oP5tS8eG7wZ -XPUT "https://company.jfrog.io/artifactory/cargo-local/crates/package/package-1.0.0.crate" -T package-1.0.0.crateCargo Path Format
When deploying crates directly, make sure the target path is a valid Cargo path format:
crates/<PACKAGE_NAME>/<PACKAGE_NAME>-<VERSION>.crate
If the path deviates from this structure, Artifactory does not identify the package as a Cargo crate and the package will not be indexed. Additionally, make sure your Cargo configuration files contain relevant dependencies and registry URLs.
To avoid indexing errors and other issues, the recommended publishing method is to use the Cargo command line. For more information, see Publish Crates.