diff --git a/.claude/commands/release.md b/.claude/commands/release.md index a8e72382..3d1a95bb 100644 --- a/.claude/commands/release.md +++ b/.claude/commands/release.md @@ -200,31 +200,46 @@ ### Step 6 — Confirm with the user - GitHub release `` - `releases//changelog.md` - `releases//email.md` + - Branch `chore/release--artifacts` + a PR versioning the two files above -Then ask in Portuguese: **"Crio a tag, publico o release e salvo os arquivos?"** +Then ask in Portuguese: **"Crio a tag, publico o release e abro o PR com os arquivos?"** Do **not** proceed without explicit yes. ### Step 7 — Execute -After confirmation, in this exact order: +After confirmation, in this exact order. Steps 4–6 (tag + release) run from `main` so the tag stays on the released `main` commit; steps 7–8 version the artifacts on a separate branch and open a PR. 1. Create local directory: `mkdir -p releases/` 2. Write `releases//changelog.md` with the Step 3 content (raw GitHub markdown). 3. Write `releases//email.md` with frontmatter + humanized body. -4. Create annotated tag: `git tag -a -m "Release "` +4. From `main`, create the annotated tag: `git tag -a -m "Release "` 5. Push tag: `git push origin ` 6. Create the GitHub release using the changelog file as body: ```bash gh release create --title "" --notes-file releases//changelog.md ``` -7. Report to the user: - - GitHub release URL (from `gh` output) +7. Version the artifacts on a branch (the two files carry over from the working tree) and push: + ```bash + git checkout -b chore/release--artifacts + git add releases//changelog.md releases//email.md + git commit -m "chore(release): add changelog + customer email artifacts" + git push -u origin chore/release--artifacts + ``` +8. Open the PR against `main` (body: what the two files are + a link to the GitHub release): + ```bash + gh pr create --base main --head chore/release--artifacts \ + --title "chore(release): changelog + customer email artifacts" \ + --body "" + ``` +9. Report to the user: + - GitHub release URL (from `gh release` output) + - PR URL (from `gh pr create` output) - Local paths: `releases//changelog.md`, `releases//email.md` - - Reminder: *"Os arquivos em `releases//` não foram commitados. Commit depois se quiser preservar o histórico no repo."* ### On failure - `git push origin ` fails: report the exact error, leave the local tag in place, do not retry destructively. - `gh release create` fails: the tag is already pushed; tell the user they can recreate manually with `gh release create --title "" --notes-file releases//changelog.md`. +- `git push` / `gh pr create` for the artifacts branch fails: the tag and GitHub release are already live; report the error and tell the user they can open the PR manually from `chore/release--artifacts`. - `Skill` or `Write` failure during artifact prep: report and stop. Do not push the tag without the artifacts being prepared.