# Release and Mooncakes publication

MoonSeal follows semantic versioning. A release is published only from a clean
commit that has passed CI.

## Prerequisites

1. Register or log in to the Mooncakes account matching the module prefix
   `liyun`.
2. Confirm the module version in `moon.mod` has not already been published.
3. Confirm the GitHub repository and CI run are public.

Mooncakes authentication commands:

```shell
moon register
# or, for an existing account
moon login
```

## Pre-publish verification

```shell
moon update
moon info
moon fmt --check
moon check --target wasm -d
moon test --target wasm
moon build --target wasm --release
moon run --target wasm cmd/main check .
moon run --target wasm cmd/main policy . --policy moonseal-policy.json
moon package --list
```

Inspect the package listing. It must contain source, public interfaces,
README, LICENSE, changelog, examples, and technical documentation. It must not
contain either competition application file or other personal material.

## Publish

```shell
moon publish
```

After publication, verify the registry page and installation command:

```shell
moon add liyun/moonseal@0.2.1
```

Then create the matching Git tag and GitHub Release from the verified commit.
The release notes should link to `CHANGELOG.md` and the successful CI run.

## Recovery

Published versions are immutable. If validation after publication uncovers a
problem, fix it on `main`, increment the patch version, rerun the full sequence,
and publish a new version. Never reuse or overwrite a published version.
