Skip to content

Commit 01c0e33

Browse files
committed
chore: move create-release cursor rule
1 parent 31638f2 commit 01c0e33

File tree

1 file changed

+85
-0
lines changed

1 file changed

+85
-0
lines changed

.cursor/rules/create-release.mdc

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
---
2+
description:
3+
globs:
4+
alwaysApply: false
5+
---
6+
# Rule: Create GitHub Release from Recent Commits
7+
8+
**Description:** This rule automates the process of creating a GitHub release based on commits since a previous reference point (tag or commit hash). It generates basic release notes, creates the release using the GitHub CLI, and verifies the post-release workflow status.
9+
10+
**Inputs:**
11+
12+
* `NEW_VERSION`: The version tag for the new release (e.g., `v1.3.1`).
13+
* `PREVIOUS_REF`: The tag or commit hash representing the start point for the release notes (e.g., `v1.3.0` or `551551ff`).
14+
* `RELEASE_TITLE`: The title for the GitHub release (e.g., `"v1.3.1 - Better Tool Errors & Docs"`).
15+
16+
**Steps:**
17+
18+
1. **Get Target Commit SHA:**
19+
* Determine the commit hash for the release target (usually HEAD).
20+
* *Successful Command:*
21+
```bash
22+
git rev-parse HEAD
23+
```
24+
* Store this SHA for the `--target` argument later. Let's call it `TARGET_SHA`.
25+
26+
2. **Generate Raw Commit Log:**
27+
* Get a list of commit messages between the previous reference and HEAD.
28+
* *Successful Command:*
29+
```bash
30+
git log <PREVIOUS_REF>..HEAD --pretty=format:"%h %s" | cat
31+
```
32+
* *(Replace `<PREVIOUS_REF>` with the actual previous tag/commit)*.
33+
34+
3. **Format Release Notes (Manual/Template Step):**
35+
* Take the raw commit log from Step 2 and format it into Markdown.
36+
* *Example Structure (based on our final notes):*
37+
```markdown
38+
# iOS Simulator MCP <NEW_VERSION>
39+
40+
## Improvements
41+
42+
- **Improved Tool Invocation Error Identification:** Enhanced the system...
43+
44+
## Documentation
45+
46+
- **Added MCP Server Badge:** Included a badge...
47+
- **Added Security Policy:** Introduced a `SECURITY.md` file...
48+
- **Added License File:** Included the MIT License file...
49+
50+
## Build
51+
52+
- **Version Bump:** Updated the project version to <NEW_VERSION>.
53+
```
54+
* *(This step often requires manual curation to group related commits and write clear descriptions)*.
55+
56+
4. **Create Temporary Notes File:**
57+
* Save the formatted markdown notes from Step 3 into a temporary file (e.g., `/tmp/release_notes_gh.md`). This avoids shell quoting/escaping issues.
58+
* *Conceptual Command (adapt as needed):*
59+
```bash
60+
# (Create the file /tmp/release_notes_gh.md with the content from Step 3)
61+
echo -e "..." > /tmp/release_notes_gh.md
62+
```
63+
64+
5. **Create GitHub Release:**
65+
* Use the `gh` CLI to create the release, referencing the temporary notes file.
66+
* *Successful Command Structure:*
67+
```bash
68+
gh release create <NEW_VERSION> --target <TARGET_SHA> --title "<RELEASE_TITLE>" --notes-file /tmp/release_notes_gh.md --latest
69+
```
70+
* *(Replace `<NEW_VERSION>`, `<TARGET_SHA>`, and `<RELEASE_TITLE>` with the actual values)*.
71+
72+
6. **Clean Up Temporary File:**
73+
* Remove the temporary notes file.
74+
* *Successful Command:*
75+
```bash
76+
rm /tmp/release_notes_gh.md
77+
```
78+
79+
7. **Check Workflow Status:**
80+
* Verify the status of the most recent workflow run (often triggered by the release).
81+
* *Successful Command (with correct quoting for `jq`):*
82+
```bash
83+
gh run list --limit 1 --json name,status,conclusion,event,url --jq '.[0]' | cat
84+
```
85+
* Check the `conclusion` field in the output (should ideally be `success`).

0 commit comments

Comments
 (0)