A template for developing Rust projects, with sensible defaults.
Click the Use this template button at the top of the page to
create a new repository with this repo as the initial state.
This template comes with sensible default configurations in the following files:
├── .editorconfig
├── .gitignore
├── .prettierrc.yml
├── Cargo.toml
├── justfile
└── rustfmt.toml
This template comes with GitHub Actions pre-configured. Your code will be linted and tested on every push and pull
request made to the main branch.
You can edit the CI script in .github/workflows/ci.yml.
Releases are automated by release-plz: on every push to main, a bot opens (or updates) a
chore: release PR with the version bump and changelog. Merging that PR tags the release, publishes to crates.io, and
creates a GitHub Release. See RELEASE.md for the full flow.
Two one-time setup steps are required in each new repository created from this template:
-
Set the crates.io token so the publish step can run. Create an API token at crates.io/settings/tokens (scope:
publish-new+publish-update), then:gh secret set CARGO_REGISTRY_TOKEN(Paste the token when prompted, or pipe it in. Without this secret, the release PR still gets opened — only the crates.io publish on merge will fail.)
-
Allow GitHub Actions to create pull requests — GitHub disables this by default, and release-plz can't open the release PR without it. Enable it under Settings → Actions → General → Workflow permissions, or via CLI:
gh api -X PUT repos/<owner>/<repo>/actions/permissions/workflow \ -f default_workflow_permissions=read -F can_approve_pull_request_reviews=true
If the project should not be published to crates.io, set publish = false in
release-plz.toml — you keep the automated versioning, changelog, tags, and GitHub Releases.
See The Rust Book and The Cargo Book.
This project is licensed under MIT.