# Publishing MoonDisk to mooncakes.io

Publishing to mooncakes.io is a required final acceptance step. The module
identity is `xiaobai718-ab/moondisk` and the current release version is `0.1.0`.

## Preflight

Use `moonc` 0.10.14 or newer and run the same gates as CI:

```sh
moonc -v
moon update
moon fmt --check
moon check --target native --deny-warn
moon test --target native --package xiaobai718-ab/moondisk --deny-warn
moon build --target native --release
moon run examples/quickstart
moon package --list
```

`moon package --list` checks the package, prints every included file, and
creates `_build/publish/xiaobai718-ab-moondisk-0.1.0.zip`. Generated build
output, reports, snapshots, and release archives are excluded.

## Account and publication

Log in with the mooncakes.io account that owns the `xiaobai718-ab` namespace:

```sh
moon login
moon publish --dry-run
moon publish
```

The final command publishes externally and should run only once for a given
version. After it succeeds, record the public package URL in the README and
acceptance evidence.

## Release tag

Before publication, verify that the release tag points at the exact commit to
be published. Then push the branch and tag without rewriting a remote tag:

```sh
git show --no-patch v0.1.0
git push origin main v0.1.0
```

If the displayed tag is not the intended commit, fix the local tag before the
first publication. Never rewrite a tag that has already been published. Future
changes require a new module version and tag.
