🚀 A Rust rewrite of LLM Werewolf—the social deduction game powered by LLM agents. This repo hosts the core engine scaffold, release tooling, and multi-language package surfaces that the upcoming implementation will build upon.
Project languages: English | 繁體中文 | 简体中文
✨ Highlights
- Modern Cargo layout (
src/lib.rs,src/main.rs,tests/) - Dynamic version information with git metadata (tag, commit hash, build tools)
- Lint & format with clippy and rustfmt
- GitHub Actions: tests, quality, package build, Docker publish, release drafter, Rust-aware labeler, secret scans, semantic PR, weekly dependency update
- Multi-stage Dockerfile producing a minimal runtime image
🚀 Quick Start
Requirements:
- Rust 1.85 or higher (using Edition 2024)
- Docker (optional)
Install Rust via rustup if you haven't already.
make fmt # rustfmt + clippy
make test # cargo test (all targets)
make test-verbose # cargo test (all targets with verbose output)
make coverage # generate LCOV coverage report
make build # cargo build (release mode)
make build-release # cargo build --release
make run # run the release binary
make clean # clean build artifacts and caches
make package # build crate package (allow dirty)
make help # list targets
📌 Version Information
The binary automatically displays dynamic version information including:
- Git tag version (or
Cargo.tomlversion if no tags) - Commit count since last tag
- Short commit hash
- Dirty working directory indicator
- Rust and Cargo versions used for building
Example output:
llmwerewolf-rs v0.1.25-2-gf4ae332-dirty
Built with Rust 1.90.0 and Cargo 1.90.0
This version information is embedded at build time through build.rs and automatically updated based on your git state.
🐳 Docker
docker build -f docker/Dockerfile --target prod -t ghcr.io/<owner>/<repo>:latest .
docker run --rm ghcr.io/<owner>/<repo>:latest
Or using the actual binary name:
docker build -f docker/Dockerfile --target prod -t llmwerewolf-rs:latest .
docker run --rm llmwerewolf-rs:latest
📦 Packaging
make package # build crate package (allow dirty)
# or use cargo directly:
cargo package --locked --allow-dirty
# CARGO_REGISTRY_TOKEN=... cargo publish
CI builds run automatically on tags matching v* and upload the .crate file. Uncomment the publish step in build_package.yml to automate crates.io releases.
Distribution identifiers:
- Crate:
llmwerewolf-rs - npm:
llmwerewolf-rs(and scoped@mai0313/llmwerewolf-rs) - PyPI:
llmwerewolf-rs
🧩 Cross Builds
This setup does not ship cross-compile tooling by default. If you need cross or zig-based builds locally, install and configure them per your environment.
GitHub Actions build_release.yml builds multi-platform release binaries on tags matching v* and uploads them to the GitHub Release assets.
Targets:
- x86_64-unknown-linux-gnu, x86_64-unknown-linux-musl
- aarch64-unknown-linux-gnu, aarch64-unknown-linux-musl
- x86_64-apple-darwin, aarch64-apple-darwin
- x86_64-pc-windows-msvc, aarch64-pc-windows-msvc
Assets naming:
<bin>-v<version>-<target>.tar.gz(all platforms)<bin>-v<version>-<target>.zip(Windows additionally)
🔁 CI/CD Workflows
Main Workflows
- Tests (
test.yml): cargo build/test + generate LCOV coverage report and upload artifact - Code Quality (
code-quality-check.yml): rustfmt check + clippy (deny warnings) - Build Package (
build_package.yml): package on tagv*, optional crates.io publish - Publish Docker Image (
build_image.yml): push to GHCR onmain/masterand tagsv* - Build Release (
build_release.yml): Linux release binaries uploaded on tagsv*
Additional Automation
- Auto Labeler (
auto_labeler.yml): automatically label PRs based on branch names and file changes - Code Scan (
code_scan.yml): multi-layer security scanning (GitLeaks, Trufflehog secret scanning, CodeQL code analysis, Trivy vulnerability scanning) - Release Drafter (
release_drafter.yml): auto-generate release notes - Semantic PR (
semantic-pull-request.yml): enforce PR title format - Dependabot weekly dependency updates
🤝 Contributing
-
Open issues/PRs
-
Use Conventional Commits for PR titles
-
Keep code formatted and clippy‑clean
-
After every edit, run
cargo buildto confirm compilation is successful -
Before opening a PR, please run locally:
cargo fmt --all -- --checkcargo clippy --all-targets --all-features -- -D warningscargo test
📄 License
MIT — see LICENSE.
Metadata
Release files for llmwerewolf-rs 0.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| llmwerewolf_rs-0.0.2.tar.gz | 4.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| llmwerewolf_rs-0.0.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 9.7 kB
Release files / llmwerewolf_rs-0.0.2.tar.gz
| Download URL | llmwerewolf_rs-0.0.2.tar.gz |
|---|---|
| Size | 4.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a1575d3a8211fe4c29da21b9269e8639036342558afb6be4a40211deaa3a27cf
|
|
BLAKE2b-256 checksum How to use checksums |
83042543dfb4d24932a013db5253b6afe4ebf839bbbd4ec5bbc76a1cf147aa7a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.9.4
|
Release files / llmwerewolf_rs-0.0.2-py3-none-any.whl
| Download URL | llmwerewolf_rs-0.0.2-py3-none-any.whl |
|---|---|
| Size | 5.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b795aa365fb6ea19a6b79e71ccb40f634ca5cbfd812d0cc3a4890b16d2321401
|
|
BLAKE2b-256 checksum How to use checksums |
c7a4c92dcc7b98764e44a85c61921e5dd9ce0f7b64bd17d2437c817fa59bcf71
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.9.4
|