rust-templates
Templates for creating rust projects with a GitHub-managed lifecycle with cargo-generate.
What you get:
- PR build validation using
cargo
.⚙️ - Automated Release PR generation using release-please.
🚢 - Automated crates.io publishing (after merging a Release PR).
🦀 - Dependabot automated dependency update PR generation.
🎁 - A toolchain file for automatic rust toolchain configuration.
🏗️ - A
justfile
for common developer actions - for use with the excellent just command runner.🧑💻 - The MIT License.
📝
Quickstart
First make sure you've done:
cargo install cargo-generate
.
basic
Use this template for basic rust projects. E.g. A single crate binary or lib, a workspace with a root crate.
cargo generate bengreenier/rust-templates.git basic
Others
Coming soon - Suggest a template.
Configuration
For publishing to crates.io:
- Create an API access token here.
- Add it as a GitHub repository secret named
CARGO_REGISTRY_TOKEN
. .github/release.yml
will use this secret when publishing a release.
Favorites
If you use these templates repeatedly, be sure to favorite them for quicker access!
Supporting the project
If this project saved you some time, and you'd like to see it continue to be invested in, consider buying me a coffee.
Also, the setup here is largely inspired by Amos' post: My ideal Rust workflow consider supporting them too.