# Release & `mooncakes.io` Publish Checklist

This document describes the pre-release verification steps and manual publishing workflow for `eprogressing/moon-gbnf` on `mooncakes.io`.

---

## 1. Pre-Release Local Verification Checklist

Run every check below from the repository root before packaging or publishing:

1. **Formatting & Strict Static Check (0 warnings, 0 errors, complete `///` docs)**:
   ```bash
   moon fmt --check
   moon check --target all --warn-list "+missing_doc" --deny-warn
   ```
2. **Multi-Target Test Suites (`wasm-gc`, `native`, `js`)**:
   ```bash
   moon test --target wasm-gc
   moon test --target native
   moon test --target js
   ```
3. **JS/ESM Playground Build & Verification**:
   ```bash
   moon build --target js
   moon build --target js --release
   node web/build.mjs --no-build --stage _build/pages
   node web/verify_playground.mjs
   ```
4. **Package Listing & Archive Verification**:
   - Inspect the exact file list included in the `mooncakes.io` archive (`e2e/` and `web/` are excluded via `e2e/.moonignore` and `web/.moonignore`; `_build/`, `.mooncakes/`, `target/`, `.agents/`, `node_modules/`, and `trace.json` are excluded via `.gitignore`):
     ```bash
     moon package --list
     ```
   - Build and integrity-test the `.zip` archive (`_build/publish/eprogressing-moon-gbnf-0.1.0.zip`):
     ```bash
     moon package
     unzip -l _build/publish/eprogressing-moon-gbnf-0.1.0.zip
     unzip -t _build/publish/eprogressing-moon-gbnf-0.1.0.zip
     ```
   - Confirm `moon.mod` version (`0.1.0`), `license = "Apache-2.0"`, `readme = "README.md"`, `repository`, and `description` are accurate, and no secrets, `.env*`, symlinks, or build artifacts appear in the archive.
5. **License & Open-Source Attribution Audit**:
   - Confirm [`LICENSE`](LICENSE) (verbatim Apache License 2.0), [`NOTICE`](NOTICE), [`licenses/LICENSE-llama.cpp-MIT.txt`](licenses/LICENSE-llama.cpp-MIT.txt) (verbatim `The ggml authors` MIT license), [`THIRD_PARTY_LICENSES.md`](THIRD_PARTY_LICENSES.md), and [`e2e/fixtures/LICENSE_ATTRIBUTIONS.md`](e2e/fixtures/LICENSE_ATTRIBUTIONS.md) are intact and synchronized.

---

## 2. Manual `mooncakes.io` Publish Workflow (Strict Order)

> **Security & Auth Policy**: `mooncakes.io` authentication is strictly interactive and user-only. Never store credentials, API keys, or automated login workarounds in source files, scripts, or CI workflows.

Execute these steps **in strict order**:

1. **Authenticate interactively as the package maintainer**:
   ```bash
   moon login
   ```
2. **Run a dry-run publish check**:
   > Note: Running `moon publish --dry-run` **before** `moon login` fails as expected with exit code `255` (`Registry login is required; run \`moon login\``). Always authenticate with `moon login` first.
   ```bash
   moon publish --dry-run
   ```
3. **Publish to `mooncakes.io`** (only after `--dry-run` succeeds cleanly):
   ```bash
   moon publish
   ```

---

## 3. Post-Publish Verification

- Verify the published module version (`eprogressing/moon-gbnf@0.1.0`) and rendered `README.md` / API docs on `mooncakes.io`.
- Tag the release commit on GitHub (e.g., `git tag v0.1.0 && git push origin v0.1.0`) and confirm GitHub Actions CI & GitHub Pages (`https://eprogressing.github.io/moon-gbnf/`) remain green.
