# Release procedure

## Preconditions

- working tree is clean;
- `moon.mod` owner and repository URL match the public GitHub repository;
- README Mooncakes addresses use the same owner;
- changelog contains the release version and date;
- all CI jobs pass.
- `moon whoami` prints the same namespace owner as `moon.mod` (`CJR-ai-nb` for this package).

## Local verification

```bash
moon fmt --check
moon check --deny-warn
moon build
moon test --deny-warn
moon run examples/checkout
moon run cmd/evowitness -- demo json
moon publish --dry-run
```

The JSON CLI output should parse successfully and contain a non-zero breaking count for the built-in demonstration.

## Publish

```bash
moon login
moon publish --dry-run
moon publish
```

Verify both endpoints:

```text
https://mooncakes.io/docs/<owner>/evowitness
https://mooncakes.io/api/v0/manifest/<owner>/evowitness
```

Create a signed or annotated Git tag `v<version>` and a GitHub release whose notes summarize `CHANGELOG.md`.

## Updating an existing release

Mooncakes releases are immutable. Increase `version` in `moon.mod` according to Semantic Versioning, update the changelog, repeat the full verification, and publish the new version. GitHub pushes do not update an existing Mooncakes release.
