# Releasing

This document describes the release process for zai-codex-bridge.

## Version Policy

- **Patch releases only** (0.4.0 → 0.4.1 → 0.4.2, etc.)
- No minor or major bumps without explicit discussion
- Always increment by +0.0.1 from current version

## Release Steps

### 1. Run Tests

```bash
# Set your API key
export ZAI_API_KEY="sk-your-key"

# Run test suite
npm run test:curl
# or
npm test
```

### 2. Bump Version

```bash
# Use the release script (recommended)
npm run release:patch

# Or manually edit package.json and change:
# "version": "0.4.0" -> "version": "0.4.1"
```

### 3. Update CHANGELOG.md

Add an entry for the new version following [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) format.

### 4. Commit

```bash
git add package.json CHANGELOG.md
git commit -m "chore: release v0.4.1"
```

### 5. Tag

```bash
git tag v0.4.1
```

### 6. Push (Optional)

```bash
git push
git push --tags
```

### 7. Publish to npm

```bash
npm publish
```

## release:patch Script

The `npm run release:patch` script:

1. Verifies current version is 0.4.x
2. Bumps patch version by +0.0.1
3. Refuses to bump minor/major versions
4. Updates package.json in-place

Example:
```bash
$ npm run release:patch
Current version: 0.4.0
Bumping to: 0.4.1
Updated package.json
```
