Skip to content

Commit 4e4b4ac

Browse files
[Chore] Use a single PR flow for extension releases (#142)
* chore: switch releases to a single PR flow * chore: address release flow PR feedback --------- Co-authored-by: Roomote <roomote@roocode.com>
1 parent d2fb21e commit 4e4b4ac

3 files changed

Lines changed: 194 additions & 171 deletions

File tree

.github/workflows/changeset-release.yml

Lines changed: 0 additions & 132 deletions
This file was deleted.
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
name: Release Validation
2+
3+
on:
4+
workflow_dispatch:
5+
pull_request:
6+
types: [opened, reopened, synchronize, ready_for_review]
7+
paths:
8+
- "CHANGELOG.md"
9+
- "README.md"
10+
- "locales/*/README.md"
11+
- "src/package.json"
12+
- "src/CHANGELOG.md"
13+
- "src/package.nls*.json"
14+
- "src/core/webview/ClineProvider.ts"
15+
- "webview-ui/src/components/chat/Announcement.tsx"
16+
- "releases/**"
17+
- ".github/workflows/release-validation.yml"
18+
19+
jobs:
20+
validate-release:
21+
runs-on: ubuntu-latest
22+
permissions:
23+
contents: read
24+
25+
steps:
26+
- name: Checkout code
27+
uses: actions/checkout@v4
28+
29+
- name: Setup Node.js and pnpm
30+
uses: ./.github/actions/setup-node-pnpm
31+
with:
32+
install-args: "--frozen-lockfile"
33+
34+
- name: Validate package identity
35+
run: |
36+
package_name=$(node -p "require('./src/package.json').name")
37+
publisher=$(node -p "require('./src/package.json').publisher")
38+
39+
test "$package_name" = "zoo-code"
40+
test "$publisher" = "ZooCodeOrganization"
41+
42+
- name: Validate release metadata
43+
run: |
44+
package_version=$(node -p "require('./src/package.json').version")
45+
46+
node -e 'const version = process.argv[1]; if (!/^\d+\.\d+\.\d+(?:[-+][0-9A-Za-z.-]+)?$/.test(version)) { throw new Error("Invalid SemVer version: " + version) }' "$package_version"
47+
grep -q "## \\[$package_version\\]\\|## $package_version" CHANGELOG.md
48+
49+
- name: Build workspace packages
50+
run: |
51+
pnpm --filter @roo-code/build build
52+
pnpm --filter @roo-code/vscode-webview build
53+
54+
- name: Bundle extension and verify README sync
55+
env:
56+
POSTHOG_API_KEY: ${{ secrets.POSTHOG_API_KEY }}
57+
run: |
58+
pnpm --filter ./src bundle --production
59+
cmp README.md src/README.md
60+
61+
- name: Package extension
62+
env:
63+
POSTHOG_API_KEY: ${{ secrets.POSTHOG_API_KEY }}
64+
run: |
65+
package_version=$(node -p "require('./src/package.json').version")
66+
pnpm --filter ./src vsix
67+
68+
vsix_path="bin/zoo-code-${package_version}.vsix"
69+
test -f "$vsix_path"
70+
71+
unzip -l "$vsix_path" > /tmp/zoo-code-vsix-contents.txt
72+
grep -q "extension/package.json" /tmp/zoo-code-vsix-contents.txt
73+
grep -q "extension/package.nls.json" /tmp/zoo-code-vsix-contents.txt
74+
grep -q "extension/dist/extension.js" /tmp/zoo-code-vsix-contents.txt
75+
grep -q "extension/webview-ui/audio/celebration.wav" /tmp/zoo-code-vsix-contents.txt
76+
grep -q "extension/webview-ui/build/assets/index.js" /tmp/zoo-code-vsix-contents.txt
77+
grep -q "extension/assets/codicons/codicon.ttf" /tmp/zoo-code-vsix-contents.txt
78+
grep -q "extension/assets/vscode-material-icons/icons/3d.svg" /tmp/zoo-code-vsix-contents.txt
79+
80+
- name: Validate packaged manifest identity
81+
run: |
82+
package_version=$(node -p "require('./src/package.json').version")
83+
vsix_path="bin/zoo-code-${package_version}.vsix"
84+
85+
artifact_name=$(unzip -p "$vsix_path" extension/package.json | jq -r '.name')
86+
artifact_publisher=$(unzip -p "$vsix_path" extension/package.json | jq -r '.publisher')
87+
88+
test "$artifact_name" = "zoo-code"
89+
test "$artifact_publisher" = "ZooCodeOrganization"

.roo/commands/release.md

Lines changed: 105 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,111 @@
11
---
2-
description: "Create a new release of the Roo Code extension"
2+
description: "Prepare a new release of the Zoo Code extension"
33
argument-hint: patch | minor | major
44
mode: code
55
---
66

7-
1. Identify the SHA corresponding to the most recent release using GitHub CLI: `gh release view --json tagName,targetCommitish,publishedAt`
8-
2. Analyze changes since the last release using: `gh pr list --state merged --base main --json number,title,author,url,mergedAt,closingIssuesReferences --limit 1000 -q '[.[] | select(.mergedAt > "TIMESTAMP") | {number, title, author: .author.login, url, mergedAt, issues: .closingIssuesReferences}] | sort_by(.number)'`
9-
3. For each PR with linked issues, fetch the issue details to get the issue reporter: `gh issue view ISSUE_NUMBER --json number,author -q '{number, reporter: .author.login}'`
10-
4. Summarize the changes. If the user did not specify, ask them whether this should be a major, minor, or patch release.
11-
5. Create a changeset in .changeset/v[version].md instead of directly modifying package.json. The format is:
7+
1. Identify the most recent stable extension release:
128

13-
```
14-
---
15-
"roo-cline": patch|minor|major
16-
---
17-
[list of changes]
18-
```
19-
20-
- Always include contributor attribution and the PR number: use "(PR #<prNumber> by @username)".
21-
- For PRs that close issues, include both the issue number and the PR number and authors: "- Fix: Description (#123 by @reporter, PR #456 by @contributor)"
22-
- For PRs without linked issues, include the PR number and author: "- Add support for feature (PR #456 by @contributor)"
23-
- Provide brief descriptions of each item to explain the change
24-
- Order the list from most important to least important
25-
- Example formats:
26-
- With issue: "- Fix: Resolve memory leak in extension (#456 by @issueReporter, PR #789 by @prAuthor)"
27-
- Without issue: "- Add support for Gemini 2.5 Pro caching (PR #789 by @contributor)"
28-
- CRITICAL: Include EVERY SINGLE PR in the changeset - don't assume you know which ones are important. Count the total PRs to verify completeness and cross-reference the list to ensure nothing is missed.
29-
30-
6. If the generate_image tool is available, create a release image at `releases/[version]-release.png`
31-
- The image should feature a realistic-looking kangaroo doing something human-like that relates to the main highlight of the release
32-
- Pass `releases/template.png` as the reference image for aspect ratio and kangaroo style
33-
- Add the generated image to .changeset/v[version].md before the list of changes with format: `![X.Y.Z Release - Description](/releases/X.Y.Z-release.png)`
34-
7. If a major or minor release:
35-
- Ask the user what the three most important areas to highlight are in the release
36-
- Update the English version relevant announcement files and documentation (webview-ui/src/components/chat/Announcement.tsx, README.md, and the `latestAnnouncementId` in src/core/webview/ClineProvider.ts)
37-
- Ask the user to confirm that the English version looks good to them before proceeding
38-
- Use the new_task tool to create a subtask in `translate` mode with detailed instructions of which content needs to be translated into all supported languages (The READMEs as well as the translation strings)
39-
8. Create a new branch for the release preparation: `git checkout -b release/v[version]`
40-
9. Commit and push the changeset file and any documentation updates to the repository: `git add . && git commit -m "chore: add changeset for v[version]" && git push origin release/v[version]`
41-
10. Create a pull request for the release: `gh pr create --title "Release v[version]" --body "Release preparation for v[version]. This PR includes the changeset and any necessary documentation updates." --base main --head release/v[version]`
42-
11. The GitHub Actions workflow will automatically:
43-
- Create a version bump PR when changesets are merged to main
44-
- Update the CHANGELOG.md with proper formatting
45-
- Publish the release when the version bump PR is merged
9+
```bash
10+
gh release view --json tagName,targetCommitish,publishedAt
11+
```
12+
13+
2. Analyze changes since that release:
14+
15+
```bash
16+
gh pr list --state merged --base main --json number,title,author,url,mergedAt,closingIssuesReferences --limit 1000 -q '[.[] | select(.mergedAt > "TIMESTAMP") | {number, title, author: .author.login, url, mergedAt, issues: .closingIssuesReferences}] | sort_by(.number)'
17+
```
18+
19+
3. For each PR with linked issues, fetch the issue reporter:
20+
21+
```bash
22+
gh issue view ISSUE_NUMBER --json number,author -q '{number, reporter: .author.login}'
23+
```
24+
25+
4. Summarize the changes. If the user did not specify a release type, ask whether this should be a major, minor, or patch release.
26+
27+
5. Review and update the Marketplace-facing root `README.md`.
28+
29+
- Treat root `README.md` as the source of truth for Marketplace content.
30+
- Update the "What's New" section for the release when appropriate.
31+
- Do not manually edit `src/README.md`; the extension bundle step copies root `README.md` into `src/README.md`.
32+
- Check for stale upstream Roo Code wording that should now say Zoo Code.
33+
34+
6. Create the release notes as a changeset file at `.changeset/v[version].md`, then run `pnpm changeset:version` on the release branch before opening the PR.
35+
36+
```md
37+
---
38+
"zoo-code": patch|minor|major
39+
---
40+
41+
[list of changes]
42+
```
43+
44+
- Always include contributor attribution and the PR number: use `(PR #<prNumber> by @username)`.
45+
- For PRs that close issues, include both issue and PR authors: `- Fix: Description (#123 by @reporter, PR #456 by @contributor)`.
46+
- For PRs without linked issues, include the PR number and author: `- Add support for feature (PR #456 by @contributor)`.
47+
- Provide brief descriptions of each item to explain the change.
48+
- Order the list from most important to least important.
49+
- Include every PR in the release window. Count the PRs and cross-reference the list before continuing.
50+
51+
7. If an image generation tool is available, create a release image at `releases/[version]-release.png`.
52+
53+
- The image should relate to the main release highlight and fit the existing release-image style.
54+
- Add the generated image to `.changeset/v[version].md` before the list of changes:
55+
56+
```md
57+
![X.Y.Z Release - Description](/releases/X.Y.Z-release.png)
58+
```
59+
60+
8. For a major or minor release:
61+
62+
- Ask the user what three areas should be highlighted.
63+
- Update relevant announcement files and documentation, including `webview-ui/src/components/chat/Announcement.tsx`, `README.md`, and the `latestAnnouncementId` in `src/core/webview/ClineProvider.ts`.
64+
- Ask the user to confirm the English announcement before proceeding.
65+
- Arrange translation updates for all supported locales affected by README, announcement, or package localization changes.
66+
67+
9. Create the release branch:
68+
69+
```bash
70+
git checkout -b release/v[version]
71+
```
72+
73+
10. Generate the final release state on that branch:
74+
75+
```bash
76+
pnpm changeset:version
77+
```
78+
79+
- This should update `src/package.json`, `CHANGELOG.md`, and `src/CHANGELOG.md`, then consume the `.changeset` file.
80+
- Review the generated version and changelog before opening the PR.
81+
82+
11. Open a single release PR with the fully generated release state.
83+
84+
```bash
85+
git add CHANGELOG.md src/CHANGELOG.md src/package.json README.md locales/*/README.md src/package.nls*.json
86+
# If generated or updated:
87+
git add releases/[version]-release.png webview-ui/src/components/chat/Announcement.tsx src/core/webview/ClineProvider.ts
88+
git commit -m "chore: prepare v[version] release"
89+
git push origin release/v[version]
90+
gh pr create --title "Release v[version]" --body "Release preparation for v[version]. This PR includes the final version bump, changelog updates, Marketplace README updates, and any release assets or announcement changes." --base main --head release/v[version]
91+
```
92+
93+
- There is no separate version-bump PR in this flow.
94+
- The release PR should already contain the final version number and generated changelog updates.
95+
- If the release includes translated README or package-localization updates, include those files in the same PR.
96+
- Let the release validation workflow and normal PR checks run before merge.
97+
98+
12. After the release PR is merged, create the release tag on the resulting `main` commit:
99+
100+
```bash
101+
git switch main
102+
git pull origin main
103+
git tag v[version]
104+
git push origin v[version]
105+
```
106+
107+
13. The stable publish workflow runs from the `v[version]` tag.
108+
109+
- Do not create the tag before the release PR is merged.
110+
- The publish workflow validates that the tag version matches `src/package.json`.
111+
- Marketplace and Open VSX publishing use the configured CI secrets.

0 commit comments

Comments
 (0)