Bart Massey 2023
The list below is what I currently use when releasing or re-releasing a Rust library crate. It's just scribbled notes: use advisedly.
This work is licensed under the "MIT License". Please see the file
LICENSE.txt
in this distribution for license terms.
-
If the root branch of the repo is
master
, rename it tomain
using the Github UI and also rename it locally. -
Add Rustdoc root to the crate root
#![doc(html_root_url = "https://docs.rs/<crate>/<version>")]
(where
<crate>
is the crate name and<version>
is the version name) -
Review the Rust API Guidelines checklist. Note that if the
documentation
field ofCargo.toml
is unset, the docs will appear oncrates.io
anyhow once processed. -
Remove any
publish=false
fromCargo.toml
-
Add a
clippy.toml
at the top level that looks likeavoid-breaking-exported-api = false
This allows Clippy to fully do its job. Note that this puts the onus on the developer to notice breaking API changes. Oh noes.
-
Add
version-sync
todev-dependencies
and install theversion-sync.rs
test intests/
-
Deal with the badge display mess. Add some badges to
README.tpl
orREADME.md
. IfREADME.tpl
, do not usecargo-readme
's badge feature, which is currently kind of busted.Start by inserting
badges.md
from here. If usingREADME.md
directly, replace all instances of{{crate}}
with the crate name. If you are notBartMassey
or usinggithub
/github.com
, fix that too. In general, edit to taste. -
Add maintenance badge to
Cargo.toml
[badges.maintenance] status = "actively-developed"
-
Set up CI. Easiest is probably to click through the Github UI to add the default Rust action; don't forget to update the action name from Rust to CI. Generate a CI badge there and add it to
README.md
orREADME.tpl
if you don't have one already. -
Continue with the per-release instructions.
- Update
Cargo.toml
version - Update
html_root_url
version in crate root - Update
README
version- If using
cargo-readme
, run it - Otherwise update manually
- If using
- Run
showmd README.md
to make sure it looks OK - Run
cargo doc --open
and check that everything looks sane - Grep for the old version number to see if anything has been left lying around.
- Run
cargo fmt --all
to check - Run
cargo clippy --all
to check - Run
cargo test
to checkversion-sync
- Commit the new version.
git tag-release
to tag the version- Push the release and make sure it looks OK on Github
- If local documentation is also provided, update that. (I
use a shell script called
rustdoc-release
for this.) - Wait for Github CI and/or Pages to finish
- Publish to
crates.io
with--dry-run
and make sure it works - Publish to
crates.io
- Wait for
crates.io
to process, and check everything out