Reusable GitHub Actions for Rust CI/CD workflows.
This repository contains reusable composite actions for common CI/CD tasks in Rust projects. All actions provide caching and consistent behavior across workflows.
See .github/actions/README.md for complete
documentation of all available actions.
- Setup Actions - Install development tools (cargo-binstall, cargo-edit, cocogitto, etc.)
- Version Management - Get and calculate versions
- Changelog & Release - Generate changelogs, PR logs, release pages, and badges
- Release Management - Create releases, attach artifacts, update badges
Reference actions using the path syntax:
- name: Setup Cocogitto
uses: legra-ai/github-actions/.github/actions/setup-cocogitto@main
with:
version: 6.5.0 # Optional, defaults to env var or 6.5.0
- name: Generate changelog
uses: legra-ai/github-actions/.github/actions/generate-changelog@main
with:
release-tag: v0.1.0- Initial release:
v0.0.1 - Use
@mainuntil all bugs are ironed out - After stabilization, bump to
v1.0.0and use@v1going forward
Creative Commons Attribution-ShareAlike 4.0 International
See LICENSE for details.
Use .github/workflows/cargo-maintenance.yml for a single public Cargo package.
Pin the reusable workflow reference to a reviewed 40-character shared-actions
commit. The workflow checks out its own policy at job.workflow_sha, so a
Dependabot workflow update cannot leave a second policy pin behind. Set crate-name and kind
(library or binary), and inherit the organization release secrets. PR jobs
require no secrets. Only main mints the repository-scoped release writer.
Callers provide rust-toolchain.toml, rustfmt-toolchain, scripts/fmt.sh, a
tracked lockfile, and integration tests included in the crate alongside both
license files. Daily scheduled recovery and the shared trusted title / tested
Dependabot merge workflows belong in the caller. Remove old version/tag/manual
publishers when adopting this workflow.
All jobs check out the prepared source revision. Binary packages build six platform archives before tagging/publishing, preserve original draft assets on recovery, and execute public downloads on Linux, macOS and Windows. Package tests run from extracted archives on all three systems, then from the public registry before the GitHub draft is made public. Required-check policy and independent release-health monitoring must also be configured; this workflow alone does not certify a repository's maintenance policy.
Cargo maintenance stages the immutable policy checkout in RUNNER_TEMP before
any source validation or packaging. Cargo include rules can select ignored and
nested README files, so policy and build source must occupy separate trees.
The publisher independently rejects every uncommitted package input.
For features that are unsupported on a CI operating system, declare the exact feature names in the package manifest:
[package.metadata.legra-ci.unsupported-features]
windows = ["jemalloc", "heap-profiling"]Checkout and extracted-archive validation use the same declaration. Default behavior is tested on every platform, and optional tests, doctests, Clippy and documentation enable all supported features. Without a declaration, all features remain enabled. Unknown platforms/features, inconsistent feature dependencies, unsupported defaults and features excluded from all three CI platforms fail.