An open API service indexing awesome lists of open source software.

https://github.com/gifnksm/rust-template

Generic Rust project template for cargo-generate
https://github.com/gifnksm/rust-template

cargo-generate rust-template

Last synced: 4 months ago
JSON representation

Generic Rust project template for cargo-generate

Awesome Lists containing this project

README

          

# Rust Template

Generic Rust project template for [cargo-generate].

Here's an example of using this template with cargo-generate.
![demo](demo.apng)

Example projects generated by this template are available:

* bin crate: [gifnksm/rust-template-generated-bin](https://github.com/gifnksm/rust-template-generated-bin)
* lib crate: [gifnksm/rust-template-generated-lib](https://github.com/gifnksm/rust-template-generated-lib)

[cargo-generate]: https://github.com/cargo-generate/cargo-generate

## Template contents

### GitHub Integration

* [dependabot](./template/.github/dependabot.yml)
* [security checks](./template/.github/workflows/audit.yml)
* [continuous integration](./template/.github/workflows/ci.yml)
* cargo test (stable toolchain and MSRV toolchain)
* cargo build (stable toolchain and MSRV toolchain)
* rustfmt
* clippy
* rustdoc
* publish-dry-run
* code coverage ([codecov.io])
* [continuous delivery](./template/.github/workflows/cd.yml)
* publish pre-built binary for Linux, macOS, and Windows (bin crate only)
* [issue template](./template/.github/ISSUE_TEMPLATE/)
* [pull request template](./template/.github/PULL_REQUEST_TEMPLATE.md)

[codecov.io]: https://about.codecov.io/

### Documentation

* install instructions (bin crate only)
* usage instructions (lib crate only)
* README badges
* maintenance status
* license
* crates.io
* docs.rs
* MSRV
* GitHub Actions CI status
* code coverage
* liceneses ([MIT](./template/LICENSE-MIT) or [Apache-2.0](./template/LICENSE-APACHE))
* [changelog](./template/CHANGELOG.md)
* [contributing guideline](./template/CONTRIBUTING.md)
* [code of conduct](./template/CODE_OF_CONDUCT.md)

## Usage

## Setup

1. Install `cargo-generate`

```console
cargo instlal cargo-generate
````

2. Generate your project with this template

* For bin crate:

```console
cargo generate --git https://github.com/gifnksm/rust-template.git --bin
````

* For lib crate:

```console
cargo generate --git https://github.com/gifnksm/rust-template.git --lib
````

3. Setup GitHub repository
* Create an empty repository on GitHub
* Push your project to GitHub

## Release

1. Install `cargo-release`

```console
cargo install cargo-release
```

2. Run `cargo-release` (dry-run)

```console
cargo release -vv
```

You should check the released version and changelog updates.

3. Run `cargo-release` again (execute)

```console
cargo release -vv --execute
```

4. Wait for GitHub Actions to finish the release process

5. Update a release on GitHub

## Original

This repository borrows many components from [rust-github/template].

[rust-github/template]: https://github.com/rust-github/template