claude-configs/skills/_templates/release-workflow.md

52 lines
1.7 KiB
Markdown

# Release — Shared Workflow
Tags a sub-project with a CalVer version and pushes to trigger CI/CD.
The calling skill MUST define a **Config** section with the values listed under "Required Config".
## Required Config
| Key | Description |
|---|---|
| `BASEDIR` | Absolute path to the project root (e.g., `/mnt/NV2/Development/paper-dynasty`) |
| `SERVICE_MAPPING` | Table: short name → local directory → Docker image (if applicable) |
| `DEPLOY_COMMANDS` | Per-environment deploy commands (optional — listed in the calling skill) |
## Usage
```
/release <service> [version]
```
- **service**: A short name from the SERVICE_MAPPING table
- **version**: CalVer tag (e.g., `2026.3.42`), `dev`, or omitted to auto-increment
## What It Does
1. Validates the service name against SERVICE_MAPPING
2. Checks repo state (must be on `main`, clean working tree)
3. Pulls latest `main` via fast-forward
4. Determines version:
- **Omitted**: auto-generates next CalVer (`YYYY.M.BUILD`)
- **Explicit**: validates CalVer format, checks tag doesn't exist
- **`dev`**: force-updates the `dev` tag
5. Creates the git tag (or force-updates `dev`)
6. Pushes the tag to origin — triggers CI/CD pipeline
## Environments
- **CalVer tags** (e.g., `2026.3.6`) → production Docker tags
- **`dev` tag** → dev environment Docker tags
## After Releasing
If DEPLOY_COMMANDS are defined in the calling skill's config, show them to the user.
Do not auto-execute deploy commands — always confirm first.
## Script
The calling skill should provide a `release.sh` that calls the shared script:
```bash
bash ~/.claude/skills/_templates/release-core.sh --config <path-to-config> <service> [version]
```