diff options
Diffstat (limited to '.claude/commands/release.md')
| -rw-r--r-- | .claude/commands/release.md | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/.claude/commands/release.md b/.claude/commands/release.md new file mode 100644 index 0000000..c0f072e --- /dev/null +++ b/.claude/commands/release.md | |||
| @@ -0,0 +1,36 @@ | |||
| 1 | # Release Command | ||
| 2 | |||
| 3 | Create a new cargo release for embassy-ha. | ||
| 4 | |||
| 5 | ## Instructions | ||
| 6 | |||
| 7 | 1. **Ask for the new version number** - Prompt the user for the version (e.g., "0.3.0"). Do not include the "v" prefix in the version number itself. | ||
| 8 | |||
| 9 | 2. **Verify clean working directory** - Run `git status --porcelain` and fail if there are any uncommitted changes. The working directory must be clean before proceeding. | ||
| 10 | |||
| 11 | 3. **Run pre-release checks** - Run the following commands in order. If any command fails, **stop immediately**, report the error, and let the user fix the issues manually. Do NOT attempt to fix issues automatically: | ||
| 12 | - `cargo fmt --check` - Verify code is properly formatted | ||
| 13 | - `cargo clippy` - Run linter (must have no warnings) | ||
| 14 | - `cargo check --tests --examples` - Check compilation of tests and examples | ||
| 15 | - `cargo test` - Run the test suite | ||
| 16 | - `cargo publish --dry-run` - Verify the package can be published | ||
| 17 | |||
| 18 | 4. **Update version in Cargo.toml** - Only after all pre-release checks pass, update the `version` field in `Cargo.toml` to the new version. | ||
| 19 | |||
| 20 | 5. **Create release commit** - Create a commit with the message: `chore: release v{version}` | ||
| 21 | |||
| 22 | 6. **Create tag** - Create an annotated tag with the name `v{version}` and message `v{version}` | ||
| 23 | |||
| 24 | 7. **Push to remote** - Push both the commit and the tag to the remote: | ||
| 25 | - `git push` | ||
| 26 | - `git push --tags` | ||
| 27 | |||
| 28 | ## Important Notes | ||
| 29 | |||
| 30 | - If any pre-release check fails, **stop immediately** and report the failure. Do NOT: | ||
| 31 | - Attempt to fix the issues automatically (e.g., running `cargo fmt` to fix formatting) | ||
| 32 | - Update the version in Cargo.toml | ||
| 33 | - Create the commit or tag | ||
| 34 | - The user is responsible for fixing any issues and re-running the release command | ||
| 35 | - The tag format must be `v{version}` (e.g., `v0.3.0`) to match existing conventions | ||
| 36 | - Use `--dry-run` for cargo publish to verify without actually publishing | ||
