Rust GitHub Template

Introduction

Creating a new Rust project is as easy as typing cargo new <project_name> but often, you need more than what cargo new gives you.

This is when cargo generate comes into play:

cargo-generate is a developer tool to help you get up and running quickly with a new Rust project by leveraging a pre-existing git repository as a template.

Rust GitHub Template (this project) is a template for cargo generate that aims to be a starting point suitable for rust projects hosted on GitHub.

example

Stop copy-pasting tons of markdown and yaml files each time you start a new rust project. Let’s write them only once, together!

You can see an example project generated with this template here.

Template content

GitHub Actions

Documentation

Instructions

Project creation

Crates.io

Set up your crates.io token in a GitHub secret called CARGO_REGISTRY_TOKEN.

For more info about the crates.io tokens, see The Cargo Book.

Publish

If this is your first ever crate, ensure your email address is verified on crates.io before you publish.

When you are ready to publish the first version of your application, run:

git tag -a 0.1.0
git push --follow-tags

This tag should trigger the continuous deployment, that will:

Supporting Rust Github Template

The best way to support the project is to contribute to it by reporting problems, ideas or sending pull requests.

If you created your project by using Rust GitHub Template, and you want to show it, you can use our badge: Rust GitHub template

Thank you! 🙏