Templates for creating rust projects with a GitHub-managed lifecycle with cargo-generate 🏗️📃

Overview

rust-templates

CI

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.

You might also like...
Yarte stands for Yet Another Rust Template Engine
Yarte stands for Yet Another Rust Template Engine

Should we start to worry? bytes-buf feature can produce SIGILL. avx and sse flags are in almost all cpus of x86 and x86_64 architectures. More details

A macro-based html builder for rust

Horrorshow A macro-based html templating library, compatible with stable rust (currently requires rust = 1.37). Features This crate will degrade grac

A template engine for Rust based on Jinja2/Django

Tera Tera is a template engine inspired by Jinja2 and the Django template language. title{% block title %}{% endblock title %}/title ul {% for u

Hiccup html templating in rust

Hiccup A Clojure's Hiccup inspired macro. At the moment support for inline code execution is not guaranteed. The main objective of this lib is to prev

A flexible template engine for Rust

Rustache Rustache is a Rust implementation of the Mustache spec. Documentation The different Mustache tags are documented at the mustache(5) man page.

A minimalist Rust WebAssembly project template

MiniWASM - A minimalist Rust WebAssembly project template This is a minimal Rust-powered WebAssembly application template. It was designed to showcase

A template for a Rust-powered static-page Try Online interface

rust-tio-template A template for a Rust-powered static-page Try Online interface What is included This is an example setup that enables all of the fol

MiniJinja is a powerful but minimal dependency template engine for Rust
MiniJinja is a powerful but minimal dependency template engine for Rust

MiniJinja: a powerful template engine for Rust with minimal dependencies MiniJinja is a powerful but minimal dependency template engine for Rust which

A "Hello, world!" template of a Rust binary crate for the ESP-IDF framework.

Rust on ESP-IDF "Hello, World" template A "Hello, world!" template of a Rust binary crate for the ESP-IDF framework. This is the crate you get when ru

Comments
  • Template suggestion: derive

    Template suggestion: derive

    It would be nice to have a template for a crate + crate_derive combo, as a workspace.

    e.g.

    /
        /src # root crate src
        /crate_derive
            /src # derive src
    

    See https://github.com/bengreenier/enum_pipeline/

    enhancement 
    opened by bengreenier 0
  • chore: release 1.0.0

    chore: release 1.0.0

    :robot: I have created a release *beep* *boop*

    1.0.0 (2021-10-29)

    Features

    • basic: Add workspace flag (914a396)
    • basic: workspace support (21faef2)
    • ci: Remove workspace from CI validation (b28a776)
    • dependabot: Add dependabot config 🤖 (49f01a2)
    • gh_account: Add gh_account variable (16b27bf)
    • init: Add initial scaffold (9efd7ce)
    • readme: Document crates token steps (53c63f1)
    • readme: Update readme (c007bec)
    • rebrand: Rebrand to basic (716a305)
    • repo-release: Add simple release for repo (9a8ccb5)
    • single_crate: Add single_crate (f87c703)
    • toolchain: add rustup toolchain file (ad23dfd)
    • workspace: Add placeholder for workspace (181aa56)

    Bug Fixes

    • basic: Update workspace publish command (f28619e)
    • ci-single-crate: Run on main push too (8a6fec1)
    • ci: Add gh-account to CI validation (d8a2e64)
    • ci: Cleanup unneeded steps (923cac6)
    • ci: Just simplify description (26836f3)
    • ci: Name validation step (6a193fa)
    • ci: replace unused env (8ad2b3c)
    • ci: Restore validation (ac536be)
    • ci: single_crate => single-crate (e4f0ce6)
    • ci: Use cargo-generate compliant name (cfb7860)
    • escape: Quote version and description (2605f4e)
    • license: Update license SPX (2f7aec3)
    • mv: Use github.workspace qualifier (f10a7f1)
    • prompt: generate adds colon for us (84f2bb2)
    • single_crate: Relax cargo_generate_version (a00a893)
    • typo: Use correct project-name var (6bf0299)

    This PR was generated with Release Please. See documentation.

    autorelease: pending 
    opened by github-actions[bot] 0
Owner
Ben Greenier
Hello! I build video games and software for creators @faster-games. Previously @WatchMixer, @microsoft. 👨‍💻🌈
Ben Greenier
Template for Cargo based SysY compiler projects.

基于 Cargo 的 SysY 编译器项目模板 该仓库中存放了一个基于 Cargo 的 SysY 编译器项目的模板, 你可以在该模板的基础上进行进一步的开发. 该仓库中的 Rust 代码实现仅作为演示, 不代表你的编译器必须以此方式实现. 如你需要使用该模板, 建议你删掉所有 Rust 源文件, 仅

PKU Compiler Course 1 Nov 1, 2021
:pencil: Compile-time HTML templates for Rust

maud Documentation (source) • API reference • Change log Maud is an HTML template engine for Rust. It's implemented as a macro, html!, which compiles

Chris Wong 1.4k Jan 1, 2023
Rust Compiled Templates with static-file handling

Rust Compiled Templates — ructe This is my attempt at writing a HTML template system for Rust. Some inspiration comes from the scala template system u

Rasmus Kaj 337 Jan 8, 2023
Type-safe, compiled Jinja-like templates for Rust

Askama Askama implements a template rendering engine based on Jinja. It generates Rust code from your templates at compile time based on a user-define

Dirkjan Ochtman 2k Jan 5, 2023
📦 Transpile readable code into DiamondFire templates

Welcome to fudge ?? ?? Transpile readable code into DiamondFire templates Author ?? BumpyBill & DADp Show your support Give a ⭐️ if this project helpe

null 6 Jan 25, 2022
A template for creating services in Rust using Axum and Prisma.

A template for creating services in Rust using Axum and Prisma. This uses the super cool Prisma Rust Client.

Aaron Leopold 6 Oct 19, 2022
Make creating nix expressions easy

Make creating nix expressions easy

Jonathan Ringer 186 Dec 21, 2022
Hatch new projects like a chick coming out of its egg

?? Cargo Hatch Hatch new projects like a chick coming out of its egg. Cargo hatch is a cargo init/cargo new on steroids, allowing complex templates th

Dominik Nakamura 6 Nov 2, 2022
Bevy GitHub CI Template

Bevy GitHub CI Template This repo show how to setup CI on a github project for Bevy. It creates two workflows: CI Release CI Definition: .github/workf

MiniaczQ 2 Feb 7, 2022
Rust templating with Handlebars

handlebars-rust Handlebars templating language implemented in Rust and for Rust. Handlebars-rust is the template engine that renders the official Rust

Ning Sun 922 Dec 27, 2022