This project uses release-please for automated releases and changelog generation.
Release-please automatically:
- Creates release PRs based on conventional commits
- Updates the
CHANGELOG.md - Bumps the version in
Cargo.toml - Creates GitHub releases
- Publishes to crates.io (when configured)
Use conventional commits format for your commit messages:
<type>[optional scope]: <description>
[optional body]
[optional footer(s)]
- feat: A new feature (bumps minor version)
- fix: A bug fix (bumps patch version)
- docs: Documentation only changes
- style: Changes that don't affect code meaning (formatting, etc.)
- refactor: Code changes that neither fix bugs nor add features
- perf: Performance improvements
- test: Adding or updating tests
- build: Changes to build system or dependencies
- ci: Changes to CI configuration
- chore: Other changes that don't modify src or test files
- revert: Reverts a previous commit
To indicate a breaking change (bumps major version):
feat!: remove deprecated API method
BREAKING CHANGE: The old API method has been removed. Use the new method instead.
Or simply use ! after the type/scope:
feat(api)!: change response format
# Feature addition
feat: add support for ESPHome API 1.13
feat(discovery): implement timeout configuration
# Bug fix
fix: correct connection timeout handling
fix(noise): resolve handshake failure on retry
# Documentation
docs: update README with new examples
docs(api): add missing parameter descriptions
# Breaking change
feat!: redesign client builder API
BREAKING CHANGE: The builder pattern has been redesigned.
Update your code to use the new `.address()` method instead of `.with_addr()`.Make your changes and commit using conventional commit messages:
git add .
git commit -m "feat: add new sensor type support"
git push origin mainWhen commits are pushed to main, release-please will:
- Analyze commits since the last release
- Determine the next version based on commit types
- Create or update a release PR
- Review the automatically generated changelog in the release PR
- Check that the version bump is appropriate
- Merge the PR when ready to release
After merging the release PR:
- A GitHub release is automatically created
- The package is published to crates.io (if
CARGO_REGISTRY_TOKENis configured) - Release artifacts are uploaded
Tracks the current version of the package.
Configures how release-please behaves:
- Package name
- Release type (rust)
- Changelog sections
- Version bump strategy
- Log in to crates.io
- Go to Account Settings → API Tokens
- Create a new token with "Publish new crates" permission
- Go to your repository Settings → Secrets and variables → Actions
- Add a new secret named
CARGO_REGISTRY_TOKEN - Paste your crates.io API token
Ensure your Cargo.toml has complete metadata:
[package]
name = "esphome-client"
version = "0.1.0" # This will be updated automatically
description = "ESPHome client library for Rust"
license = "MIT"
repository = "https://github.com/daanoz/esphome-client"
homepage = "https://github.com/daanoz/esphome-client"
documentation = "https://docs.rs/esphome-client"
readme = "README.md"
keywords = ["esphome", "iot", "smart-home", "home-automation", "api"]
categories = ["network-programming", "api-bindings"]If you need to manually trigger a release:
- Update version in
Cargo.toml - Update
CHANGELOG.md - Update
.release-please-manifest.json - Create a git tag:
git tag -a v0.2.0 -m "Release v0.2.0" git push origin v0.2.0 - Publish to crates.io:
cargo publish
This project follows Semantic Versioning:
- Major (x.0.0): Breaking changes (e.g.,
feat!:orBREAKING CHANGE:) - Minor (0.x.0): New features (e.g.,
feat:) - Patch (0.0.x): Bug fixes (e.g.,
fix:)
Before 1.0.0:
- Minor version bumps may include breaking changes
- Patch version bumps are for bug fixes and non-breaking features
After 1.0.0:
- Strict semantic versioning applies
- Breaking changes require major version bump
- Check that commits follow conventional commit format
- Ensure commits are pushed to the
mainbranch - Look at workflow runs in Actions tab for errors
- Verify
CARGO_REGISTRY_TOKENsecret is set correctly - Check that package name is available on crates.io
- Ensure all required metadata is in
Cargo.toml - Verify the package builds successfully:
cargo publish --dry-run
If there's a version mismatch:
- Update
.release-please-manifest.jsonto matchCargo.toml - Commit and push
- Release-please will sync on next run
- One logical change per commit - Makes changelog more readable
- Descriptive commit messages - They become your changelog
- Test before merging - CI should pass before merging release PRs
- Review changelogs - Check generated changelog for accuracy
- Document breaking changes - Include migration guide in commit body