# Release Checklist
## Pre-Release Checklist
### Code Quality
- [ ] All tests pass (`cargo test`)
- [ ] C++ tests pass (`./build/marisa_ffi_test`)
- [ ] Clippy warnings resolved (`cargo clippy`)
- [ ] Code formatted (`cargo fmt`)
- [ ] Examples work (`cargo run --example basic_usage`)
### Documentation
- [ ] README.md is up to date
- [ ] API documentation is complete
- [ ] Examples are working and documented
- [ ] CHANGELOG.md is updated
- [ ] USAGE_ZH.md is current
### Version Management
- [ ] Version number updated in Cargo.toml
- [ ] Version number updated in CMakeLists.txt
- [ ] Version number updated in marisa_ffi.cpp
- [ ] Git tag created for release
### Build Verification
- [ ] Builds on Linux (Ubuntu)
- [ ] Builds on macOS
- [ ] Builds on Windows
- [ ] Static library builds correctly
- [ ] Shared library builds correctly
- [ ] FFI symbols are properly exported
### Testing
- [ ] Unit tests pass
- [ ] Integration tests pass
- [ ] Example programs run successfully
- [ ] Memory leak tests (valgrind/sanitizers)
- [ ] Performance benchmarks
## Release Process
### 1. Prepare Release Branch
```bash
git checkout -b release/v0.3.1
```
### 2. Update Version Numbers
- Update `Cargo.toml` version
- Update `CMakeLists.txt` version
- Update `marisa_ffi.cpp` version string
- Update `CHANGELOG.md` with release date
### 3. Final Testing
```bash
# Clean build
cargo clean
rm -rf build/
# Build and test
cargo build --release
cargo test
cargo run --example basic_usage
# C++ build and test
cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release
cmake --build build
./build/marisa_ffi_test
```
### 4. Create Release Commit
```bash
git add .
git commit -m "Release v0.3.1"
```
### 5. Create Git Tag
```bash
git tag -a v0.3.1 -m "Release v0.3.1"
git push origin v0.3.1
```
### 6. Merge to Main
```bash
git checkout main
git merge release/v0.3.1
git push origin main
```
### 7. Create GitHub Release
- Go to GitHub repository
- Click "Releases" → "Create a new release"
- Choose tag v0.3.1
- Add release notes from CHANGELOG.md
- Upload any additional files if needed
### 8. Publish to Crates.io
```bash
# Login to crates.io (first time only)
cargo login
# Publish the crate
cargo publish
```
### 9. Post-Release Tasks
- [ ] Update README.md badges with new version
- [ ] Announce release on relevant forums
- [ ] Update any dependent projects
- [ ] Monitor for issues and feedback
## Rollback Plan
If issues are discovered after release:
### Crates.io
- Contact crates.io support for yanking if necessary
- Release a patch version with fixes
### GitHub
- Create a new release with fixes
- Update release notes
## Release Notes Template
```markdown
# Release v0.3.1
## What's New
- Initial release of Marisa FFI Rust bindings
- Complete C FFI interface for libmarisa
- Rust type-safe wrapper API
## Features
- Trie management (create, build, save, load)
- Lookup operations (exact, reverse, predictive, common prefix)
- Keyset management
- Agent support for search results
- Memory safety with RAII
- Cross-platform support
## Breaking Changes
None (initial release)
## Known Issues
- `agent.next()` iteration not yet implemented
- Some advanced configuration options not exposed
## Migration Guide
N/A (initial release)
## Contributors
- [Your Name] - Initial implementation
```
## Verification Commands
```bash
# Test everything
cargo test --verbose
cargo run --example basic_usage
cargo run --example benchmark
# Check formatting
cargo fmt --check
# Check linting
cargo clippy --all-targets --all-features
# Check documentation
cargo doc --no-deps
# Build for different targets
cargo build --target x86_64-unknown-linux-gnu
cargo build --target x86_64-apple-darwin
cargo build --target x86_64-pc-windows-msvc
```