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
Go to crates.io and click the Log In
button 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 Token
next to API 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
.
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 #.##.##
.
Run ./release.sh [THRIFT_RELEASE_VERSION]
.
Requires you to have stored your credentials in ~/.cargo/credentials
.
Edit Cargo.toml
and update the version = 1.0
key to version = [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 package
This step fails if there are any uncommitted or ignored files. Do not use the --allow-dirty
flag! Instead, add the highlighted files as entries in the Cargo.toml
exclude
key.
cargo publish