1.8 KiB
Publishing the thrift crate
Publishing the Rust thrift crate is straightforward, and involves two major steps:
-
Setting up your crates.io account (one-time)
-
Packaging/publishing the Rust thrift crate itself
Set up your crates.io account (one-time)
-
Go to crates.io and click the
Log Inbutton at the top right.Log in as the Github user with write permissions to the thrift repo!
-
Click your user icon button at the top right and select
Account Settings. -
Click
New Tokennext toAPI Access.This generates a new API key that cargo uses to publish packages to crates.io. Store this API key somewhere safe. If you will only use this Github account to publish crates to crates.io you can follow the instructions to save the generated key to
~/.cargo/credentials.
Package and Publish
You can use the automated script or run the release steps manually.
Important: cargo expects that version numbers follow the semantic versioning format.
This means that THRIFT_RELEASE_VERSION must have a major, minor and patch number, i.e., must
be in the form #.##.##.
Automated
Run ./release.sh [THRIFT_RELEASE_VERSION].
Requires you to have stored your credentials in ~/.cargo/credentials.
Manual
-
Edit
Cargo.tomland update theversion = 1.0key toversion = [THRIFT_RELEASE_VERSION] -
git add Cargo.toml -
git commit -m "Update thrift crate version to [THRIFT_RELEASE_VERSION]" -m "Client: rs" -
cargo login(not required if you have stored your credentials in
~/.cargo/credentials) -
cargo clean -
cargo packageThis step fails if there are any uncommitted or ignored files. Do not use the
--allow-dirtyflag! Instead, add the highlighted files as entries in theCargo.tomlexcludekey. -
cargo publish