# Publishing Guide
## Prerequisites
1. **crates.io**: `cargo login` with your API token
2. **hex.pm** (if publishing Elixir wrapper): `mix hex.user auth`
## Pre-Publish Checklist
- [ ] Update `authors` and `repository` in both `Cargo.toml` files
- [ ] Run `cargo test`
- [ ] Run `cargo run --example with_macros`
- [ ] Ensure LICENSE file exists
## Publishing to crates.io
### 1. Publish macros crate first
```bash
cd simplify_baml_macros
cargo publish --dry-run # Check
cargo publish # Publish
```
Wait 1-2 minutes for crates.io to index.
### 2. Update main crate dependency
Edit `Cargo.toml`:
```toml
# Change from path to version
simplify_baml_macros = "0.1.0"
```
### 3. Publish main crate
```bash
cd ..
cargo build --release # Test
cargo publish --dry-run # Check
cargo publish # Publish
```
## Publishing to Hex.pm (Elixir wrapper)
```bash
cd /path/to/simplify_baml_ex
# Update native/simplify_baml_nif/Cargo.toml to use crates.io version
# simplify_baml = "0.1.0"
mix clean
mix deps.get
mix compile
mix test
mix hex.publish
```
## Post-Publish
- [ ] Verify on https://crates.io/crates/simplify_baml
- [ ] Tag release: `git tag v0.1.0 && git push --tags`
- [ ] Test in fresh project
## Version Updates
Keep versions in sync across:
- `simplify_baml/Cargo.toml`
- `simplify_baml_macros/Cargo.toml`
- `simplify_baml_ex/mix.exs` (if applicable)
## Installation (for users)
```toml
[dependencies]
simplify_baml = "0.1.0"
```