|
| 1 | +Create a release for the Discourse Graphs Obsidian plugin with version $ARGUMENTS. |
| 2 | + |
| 3 | +Follow these steps: |
| 4 | + |
| 5 | +## 1. Validate input |
| 6 | + |
| 7 | +- The argument should be a semver version number (e.g. `0.5.4`). If not provided or invalid, ask the user. |
| 8 | + |
| 9 | +## 2. Find the previous release |
| 10 | + |
| 11 | +- Run: `gh release list --repo DiscourseGraphs/discourse-graph-obsidian --limit 5` |
| 12 | +- Identify the most recent existing release (the one just before the new version being created). |
| 13 | +- Note its tag name and published date. |
| 14 | + |
| 15 | +## 3. Find Obsidian-related PRs since the last release |
| 16 | + |
| 17 | +- Run: `gh pr list --repo DiscourseGraphs/discourse-graph --state merged --limit 100 --json number,title,mergedAt,labels --jq '.[]'` and filter to PRs merged **after** the previous release date. |
| 18 | +- For each PR, check which files it touches: `gh pr view <number> --repo DiscourseGraphs/discourse-graph --json title,body,files` |
| 19 | +- A PR is Obsidian-related if it touches files in `apps/obsidian/` or shared `packages/` used by Obsidian. |
| 20 | +- Exclude PRs that only touch `apps/roam/`, CI workflows, or root dev tooling (prettier, eslint, husky configs) unless they meaningfully affect the Obsidian plugin. |
| 21 | + |
| 22 | +## 4. Categorize the PRs |
| 23 | + |
| 24 | +Group them into: |
| 25 | + |
| 26 | +- **Features**: New functionality or meaningful enhancements |
| 27 | +- **Bug Fixes**: Fixes to existing behavior |
| 28 | +- **Internal**: Refactors, docs, dev tooling, plugin store compliance, README updates |
| 29 | + |
| 30 | +## 5. Generate the changelog |
| 31 | + |
| 32 | +Format it as: |
| 33 | + |
| 34 | +``` |
| 35 | +# Changelog |
| 36 | +
|
| 37 | +## v{VERSION} |
| 38 | +
|
| 39 | +### Features |
| 40 | +
|
| 41 | +- **Short title**: Description ([#NNN](https://github.com/DiscourseGraphs/discourse-graph/pull/NNN)) |
| 42 | +
|
| 43 | +### Bug Fixes |
| 44 | +
|
| 45 | +- **Short title**: Description ([#NNN](https://github.com/DiscourseGraphs/discourse-graph/pull/NNN)) |
| 46 | +
|
| 47 | +### Internal |
| 48 | +
|
| 49 | +- **Short title**: Description ([#NNN](https://github.com/DiscourseGraphs/discourse-graph/pull/NNN)) |
| 50 | +``` |
| 51 | + |
| 52 | +Omit any section that has no entries. |
| 53 | + |
| 54 | +## 6. Show the changelog to the user and ask for confirmation |
| 55 | + |
| 56 | +Present the generated changelog and ask if they want to: |
| 57 | + |
| 58 | +- Edit anything before publishing |
| 59 | +- Proceed with creating/updating the release |
| 60 | + |
| 61 | +## 7. Create or update the release |
| 62 | + |
| 63 | +**Prerequisites:** |
| 64 | + |
| 65 | +- `OBSIDIAN_PLUGIN_REPO_TOKEN` must be available — the script loads `apps/obsidian/.env` automatically via `dotenv`, so no manual `export` is needed as long as the token is in that file. |
| 66 | + |
| 67 | +**Check if the release tag already exists:** |
| 68 | + |
| 69 | +``` |
| 70 | +gh release view v{VERSION} --repo DiscourseGraphs/discourse-graph-obsidian |
| 71 | +``` |
| 72 | + |
| 73 | +**If the release does NOT exist** — run the publish script. This builds the plugin, uploads the release assets (`main.js`, `manifest.json`, `styles.css`), and creates the GitHub release: |
| 74 | + |
| 75 | +``` |
| 76 | +cd apps/obsidian && tsx scripts/publish.ts --version {VERSION} |
| 77 | +``` |
| 78 | + |
| 79 | +The script auto-generates release notes from GitHub. After it completes, overwrite them with the curated changelog: |
| 80 | + |
| 81 | +``` |
| 82 | +gh release edit v{VERSION} --repo DiscourseGraphs/discourse-graph-obsidian --notes "..." |
| 83 | +``` |
| 84 | + |
| 85 | +**If the release ALREADY exists** — the assets are already uploaded. Do NOT re-run `publish.ts` (it will fail on duplicate tag). Instead, just update the release notes with the curated changelog: |
| 86 | + |
| 87 | +``` |
| 88 | +gh release edit v{VERSION} --repo DiscourseGraphs/discourse-graph-obsidian --notes "..." |
| 89 | +``` |
| 90 | + |
| 91 | +- Print the release URL when done. |
| 92 | + |
| 93 | +## 8. Draft a Slack announcement |
| 94 | + |
| 95 | +Based on the changelog, draft a user-facing release announcement for the `#obsidian-plugin` channel in the Discourse Graphs Slack. |
| 96 | + |
| 97 | +**Rules for the Slack message:** |
| 98 | + |
| 99 | +- Include only **Features** and **Bug Fixes** — omit anything categorized as **Internal** or that is not customer-facing |
| 100 | +- If there are no user-facing changes, skip this step and say so |
| 101 | + |
| 102 | +**Message format:** |
| 103 | + |
| 104 | +``` |
| 105 | +:sparkles: *Discourse Graph v{VERSION} is out!* |
| 106 | +
|
| 107 | +Here's what's new: |
| 108 | +
|
| 109 | +*Features* |
| 110 | +• *Short title*: Description |
| 111 | +
|
| 112 | +*Bug Fixes* |
| 113 | +• *Short title*: Description |
| 114 | +
|
| 115 | +Full release notes: {RELEASE_URL} |
| 116 | +``` |
| 117 | + |
| 118 | +Omit any section that has no entries. |
| 119 | + |
| 120 | +**Sending the message:** |
| 121 | + |
| 122 | +- If the Slack MCP (`mcp__plugin_slack_slack__slack_send_message`) is available: |
| 123 | + 1. Search for the channel: use `slack_search_channels` with query `obsidian-plugin` |
| 124 | + 2. Send as a **draft** using `slack_send_message_draft` so the dev can review before posting |
| 125 | + 3. Show the draft link to the user |
| 126 | +- If Slack MCP is not available: |
| 127 | + - Display the drafted message in full so the dev can copy-paste it into the `#obsidian-plugin` channel manually |
0 commit comments