--- description: Ship CI phase or milestone — test, tag, release. Every phase gets a patch release. Every milestone gets a minor (or major) release. Full autopilot. --- # CI Ship Ship a CI phase or milestone. Every ship creates a release — no exceptions. **Versioning rule:** - **Major** (X.0.0): Project-level refactor or schema changes - **Minor** (0.X.0): Feature milestone completion only - **Patch** (0.0.X): Every phase completion **NFR versioning:** - NFR milestones (all phases are fix/chore/docs/perf/refactor/test): progressive patch versions only (v0.1.1, v0.1.2, v0.1.3). No minor milestone tag. - Feature milestones (any feat phase): progressive patch versions per phase + minor milestone tag on completion (e.g., v0.2.0). **Usage:** `ci-ship [phase_number|milestone]` ## Step 0: Confirm Active Project Check `ci listProjects()` or read `.ci/config.json` to determine if multi-project mode is active. If `.ci/config.json` has `projects[]` with length > 0: - Confirm `active_project` is correct for this ship - If not, set it with `ci setActiveProject()` - All commit messages must include `project: ` in `---ci---` block - Branch names are prefixed with `/` in multi-project mode If single-project mode: proceed with existing conventions. ## Step 1: Pre-Flight ```bash git log --max-count=10 git branch -a ``` Determine what is being shipped: a single phase (patch release) or an entire milestone (minor/major release). Read `.ci/ROADMAP.md` to determine: - Current milestone version (e.g., `v0.2`) - Phase number within the milestone - Whether this is the last phase in the milestone Read `.ci/config.json` for autonomy level. ## Step 2: Run Tests ```bash npm test npm run typecheck npm run build ``` If any fail: iterate autonomously until tests pass. Do NOT ask the user for guidance — debug and fix. ## Step 3: Compute Version Determine the release version from what is being shipped. Check `isNfrMilestone()` for versioning behavior: | What's shipping | Milestone Type | Version bump | Tag format | Example | |----------------|---------------|-------------|------------|---------| | Single phase | NFR | Patch | `vX.Y.Z` | `v0.1.3` (3rd NFR phase in milestone v0.1) | | Single phase | Feature | Patch | `vX.Y.Z` | `v0.2.3` (3rd phase in feature milestone v0.2) | | Milestone completion | NFR | Patch (last phase) | `vX.Y.Z` | `v0.1.3` (no minor tag) | | Milestone completion | Feature | Minor | `vX.Y.0` | `v0.3.0` (feature milestone v0.3 complete) | | Project refactor/schema change | Any | Major | `vX.0.0` | `v1.0.0` (breaking schema) | Count completed phases in the current milestone to determine the patch number. ## Step 4: Merge Branch ### Phase ship (patch release) ```bash git checkout main git merge --squash phase/NN-slug git commit -m "docs(P##): complete [phase-name] phase ---ci--- phase: [N] milestone: [vX.Y] status: complete requirements: covered: [REQ-01, REQ-02] partial: [] ---/ci---" ``` ### Milestone ship (minor/major release) ```bash git checkout main git merge --squash milestone/vX.Y-slug git commit -m "docs(milestone): complete [milestone-name] ---ci--- phase: 0 milestone: [vX.Y] status: complete ---/ci---" ``` ## Step 5: Tag and Push ```bash git tag -a vX.Y.Z -m "vX.Y.Z: [phase-name or milestone-name]" git push origin main --tags ``` ## Step 6: Create Release **Every ship creates a Gitea release. No exceptions.** Generate release notes from git log: ```bash git log v[previous_tag]..vX.Y.Z --oneline ``` Create the release via Gitea API: ```bash curl -X POST "https://git.cloudinit.dev/api/v1/repos/continuous-intelligence/ci/releases" \ -H "Authorization: token $GITEA_TOKEN" \ -H "Content-Type: application/json" \ -d '{"tag_name":"vX.Y.Z","name":"vX.Y.Z","body":"[release notes from git log]"}' ``` For milestone releases, include a summary of all phases completed and requirements covered. ## Step 7: Update .ci/ Files - Update `.ci/REQUIREMENTS.md` — mark shipped requirements as complete - Update `.ci/ROADMAP.md` — mark shipped phase as complete Commit the file updates. ## Step 8: Report ``` ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ CI ► SHIPPED ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ Phase [N]: [name] Milestone: [vX.Y] Version: vX.Y.Z Release: https://git.cloudinit.dev/continuous-intelligence/ci/releases/tag/vX.Y.Z Status: complete Tests: PASS Typecheck: PASS Build: PASS Requirements covered: [N] Commits: [N] [If milestone complete:] All phases in milestone v0.2 complete. Milestone released. ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ```