Skip to content

Commit 79a0766

Browse files
authored
Merge pull request #4971 from RSSNext/release/mobile/0.5.0
release(mobile): Release v0.5.0
2 parents 421b4a3 + f5158ee commit 79a0766

252 files changed

Lines changed: 25728 additions & 4562 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 159 additions & 105 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,45 @@
11
---
22
name: desktop-release
3-
description: Perform a regular desktop release from the dev branch. Gathers commits since last release, updates changelog, evaluates mainHash changes, bumps version, and creates release PR.
3+
description: Perform a regular desktop release from the dev branch. Gather changes since the last desktop tag, update the changelog, choose the desktop release mode in release-plan.json, bump the version, and prepare the release PR.
44
disable-model-invocation: true
55
allowed-tools: Bash, Read, Write, Edit, Glob, Grep
66
---
77

88
# Desktop Regular Release
99

10-
Perform a regular desktop release. This skill handles the full release workflow from the `dev` branch.
10+
Perform a regular desktop release from the `dev` branch.
11+
12+
This workflow is now file-driven:
13+
14+
- `apps/desktop/changelog/next.md` is the human-edited changelog draft.
15+
- `apps/desktop/release-plan.json` is the human-edited release intent.
16+
- `pnpm --dir apps/desktop bump` applies both inputs, writes `apps/desktop/release.json`, resets `apps/desktop/release-plan.json`, bumps the version, creates `release/desktop/{NEW_VERSION}`, pushes it, and opens the PR.
17+
18+
Important notes:
19+
20+
- `mainHash` is still regenerated automatically, but it is **not** the OTA compatibility switch anymore. Do not use it as the release decision point.
21+
- `runtimeVersion` in `apps/desktop/package.json` is the desktop OTA compatibility key. `apps/desktop/scripts/apply-release-config.impl.ts` writes it during bump.
22+
- This skill covers the normal `build` and `ota` desktop release flow.
23+
- Do not recommend or write any other mode. The current implementation only supports `build` and `ota`.
1124

1225
## Pre-flight checks
1326

1427
1. Confirm the current branch is `dev`. If not, abort with a warning.
1528
2. Run `git pull --rebase` in the repo root to ensure the local branch is up to date.
16-
3. Read `apps/desktop/package.json` to get the current `version` and `mainHash`.
17-
18-
## Step 1: Gather changes since last release
19-
20-
1. Find the last release tag:
29+
3. Read:
30+
- `apps/desktop/package.json`
31+
- `apps/desktop/release-plan.json`
32+
- `apps/desktop/release.json`
33+
- `apps/desktop/bump.config.ts`
34+
4. Record the current:
35+
- `version`
36+
- `runtimeVersion`
37+
- `release-plan.json` contents
38+
5. Note that `pnpm --dir apps/desktop bump` will push a branch and open a PR. Do not run it without explicit user approval.
39+
40+
## Step 1: Gather changes since last desktop release
41+
42+
1. Find the last desktop release tag:
2143
```bash
2244
git tag --sort=-creatordate | grep '^desktop/v' | head -1
2345
```
@@ -26,138 +48,170 @@ Perform a regular desktop release. This skill handles the full release workflow
2648
git log <last-tag>..HEAD --oneline --no-merges
2749
```
2850
3. Categorize commits into:
29-
- **Shiny new things** (feat: commits, new features)
30-
- **Improvements** (refactor:, perf:, chore: improvements, dependency updates)
31-
- **No longer broken** (fix: commits, bug fixes)
32-
- **Thanks** (identify external contributor GitHub usernames from commits)
51+
- **Shiny new things**
52+
- **Improvements**
53+
- **No longer broken**
54+
- **Thanks**
3355

34-
## Step 2: Update changelog
56+
## Step 2: Update changelog draft
3557

3658
1. Read `apps/desktop/changelog/next.md`.
37-
2. Present the categorized changes to the user and draft the changelog content.
38-
3. Wait for user confirmation or edits before writing.
39-
4. Write the final content to `apps/desktop/changelog/next.md`, following the template format:
59+
2. Draft the changelog content from the categorized commits.
60+
3. Present the draft to the user.
61+
4. Wait for user confirmation or edits before writing.
62+
5. Write the final content to `apps/desktop/changelog/next.md` using the existing template structure.
63+
6. Keep `NEXT_VERSION` as the placeholder. `apps/desktop/scripts/apply-changelog.ts` replaces it during bump.
4064

41-
```markdown
42-
# What's new in vNEXT_VERSION
65+
## Step 3: Choose the desktop release mode
4366

44-
## Shiny new things
67+
This replaces the old `mainHash` decision.
4568

46-
- description of new feature
69+
Inspect runtime-affecting changes since the last desktop tag:
4770

48-
## Improvements
71+
```bash
72+
git diff <last-tag>..HEAD --name-only -- \
73+
apps/desktop/layer/main/ \
74+
apps/desktop/layer/preload/ \
75+
apps/desktop/forge.config.cts \
76+
apps/desktop/resources/ \
77+
apps/desktop/scripts/ \
78+
apps/desktop/package.json
79+
```
4980

50-
- description of improvement
81+
Use this decision table:
5182

52-
## No longer broken
83+
- `build`
84+
Use this when the release requires a new binary.
85+
Typical triggers:
86+
- main process changes
87+
- preload or IPC changes
88+
- updater flow changes
89+
- Electron / Forge / packaging / signing changes
90+
- native resource changes
91+
- dependency or package changes that affect runtime behavior
5392

54-
- description of fix
93+
- `ota`
94+
Use this when the release is renderer-compatible with an already-installed binary.
95+
Typical triggers:
96+
- renderer UI changes
97+
- web behavior changes
98+
- shared frontend logic changes that do not require a new desktop binary
5599

56-
## Thanks
100+
For `ota`, you must choose:
101+
- `runtimeVersion`: the newest installed desktop binary version that this renderer update is compatible with
102+
- `channel`: usually `stable`
57103

58-
Special thanks to volunteer contributors @username for their valuable contributions
59-
```
104+
If you are unsure whether a change is binary-compatible, prefer `build`.
60105

61-
5. Keep `NEXT_VERSION` as the placeholder - it will be replaced by `apply-changelog.ts` during bump.
106+
Present the analysis to the user with:
62107

63-
## Step 3: Commit changelog updates before bump
108+
- changed runtime-affecting files
109+
- summary of what changed
110+
- recommended mode: `build` or `ota`
111+
- recommended `release-plan.json`
112+
- explicit request for confirmation
64113

65-
`nbump` requires a clean working tree. Commit changelog edits before running bump.
114+
## Step 4: Update release inputs
66115

67-
1. Stage the changelog update:
68-
```bash
69-
git add apps/desktop/changelog/next.md
70-
```
71-
2. Commit it on `dev`:
72-
```bash
73-
git commit -m "docs(desktop): prepare release changelog"
74-
```
75-
3. If there are no changes to commit, continue without creating an extra commit.
116+
1. Edit `apps/desktop/changelog/next.md`.
117+
2. Edit `apps/desktop/release-plan.json`.
118+
3. Do **not** edit `apps/desktop/release.json` directly. It is generated during bump.
119+
4. Because `nbump` requires a clean working tree, commit the release inputs before bump.
76120

77-
## Step 4: Evaluate mainHash
121+
Stage the inputs:
78122

79-
This is critical for determining whether users need a full app update or can use the lightweight renderer hot update.
123+
```bash
124+
git add apps/desktop/changelog/next.md apps/desktop/release-plan.json
125+
```
80126

81-
1. Check what files changed in `apps/desktop/layer/main/` since the last release tag:
82-
```bash
83-
git diff <last-tag>..HEAD --name-only -- apps/desktop/layer/main/
84-
```
85-
2. Also check changes to `apps/desktop/package.json` fields other than version/mainHash (since package.json is included in the hash calculation):
86-
```bash
87-
git diff <last-tag>..HEAD -- apps/desktop/package.json
88-
```
127+
Commit them on `dev`:
89128

90-
**Decision logic:**
129+
```bash
130+
git commit -m "docs(desktop): prepare release inputs"
131+
```
91132

92-
- If there are **NO changes** in `layer/main/` and no meaningful `package.json` changes (only version/mainHash/changelog-related), then mainHash should NOT be updated. Users will get a fast renderer-only hot update.
93-
- If there are **trivial changes** in `layer/main/` (typo fixes, comment changes, logging tweaks) that don't affect runtime behavior, recommend NOT updating mainHash. Present the changes to the user and ask for confirmation.
94-
- If there are **meaningful changes** in `layer/main/` (new features, bug fixes, dependency changes, API changes), mainHash MUST be updated. Users will need a full app update.
133+
If there are no changes to commit, continue.
95134

96-
Present your analysis to the user with:
135+
## Step 5: Run the bump
97136

98-
- List of changed files in `layer/main/`
99-
- A summary of what changed
100-
- Your recommendation (update or skip mainHash)
101-
- Ask for explicit confirmation
137+
Do not execute this step until the user explicitly approves pushing code.
102138

103-
## Step 5: Save old mainHash and execute bump
139+
Run:
104140

105-
1. Save the current mainHash from `apps/desktop/package.json` for later comparison.
106-
2. Verify working tree is clean before bump:
107-
```bash
108-
git status --short
109-
```
110-
3. Change directory to `apps/desktop/` and run the bump:
111-
```bash
112-
cd apps/desktop && pnpm bump
113-
```
114-
4. This command will:
115-
- Pull latest changes
116-
- Apply changelog (rename next.md to {version}.md, create new next.md)
117-
- Recalculate mainHash and write to package.json
118-
- Format package.json
119-
- Bump minor version
120-
- Commit with message `release(desktop): release v{NEW_VERSION}`
121-
- Create branch `release/desktop/{NEW_VERSION}`
122-
- Push branch and create PR to `main`
141+
```bash
142+
pnpm --dir apps/desktop bump
143+
```
123144

124-
## Step 6: Restore mainHash if skipping update
145+
This command currently does all of the following:
125146

126-
If Step 4 decided mainHash should NOT be updated, restore the old value now. The bump has already committed, pushed, and created the PR on a new release branch, so we amend the commit and force push. This is safe because the release branch was just created.
147+
- pulls latest changes
148+
- applies the changelog
149+
- regenerates `mainHash`
150+
- runs `apps/desktop/scripts/apply-release-config.ts ${NEW_VERSION}`
151+
- writes `apps/desktop/release.json`
152+
- updates `apps/desktop/package.json` `runtimeVersion`
153+
- resets `apps/desktop/release-plan.json` back to the default `build` template
154+
- commits `release(desktop): release v{NEW_VERSION}`
155+
- creates `release/desktop/{NEW_VERSION}`
156+
- pushes the branch
157+
- creates a PR to `main`
127158

128-
1. Change back to the repo root first (Step 5 left the working directory at `apps/desktop/`):
129-
```bash
130-
cd ../..
131-
```
132-
2. Ensure you are on the `release/desktop/{NEW_VERSION}` branch (bump should have switched to it).
133-
3. Replace the recalculated mainHash with the saved old value in `apps/desktop/package.json`.
134-
4. Stage and amend the release commit:
135-
```bash
136-
git add apps/desktop/package.json && git commit --amend --no-edit
137-
```
138-
5. Force push the release branch:
139-
```bash
140-
git push --force origin release/desktop/{NEW_VERSION}
141-
```
159+
## Step 6: Verify the generated release state
160+
161+
After bump completes, verify:
162+
163+
1. Current branch is `release/desktop/{NEW_VERSION}`.
164+
2. `apps/desktop/package.json` has the expected:
165+
- `version`
166+
- `runtimeVersion`
167+
3. `apps/desktop/release.json` matches the intended mode and release settings.
168+
4. `apps/desktop/release-plan.json` was reset to the default template.
169+
5. The PR was created successfully.
170+
171+
Also note what will happen after merge:
172+
173+
- merging the PR to `main` triggers `.github/workflows/tag.yml`
174+
- `tag.yml` creates `desktop/v{NEW_VERSION}`
175+
- `tag.yml` dispatches `.github/workflows/build-desktop.yml`
176+
- `build-desktop.yml` publishes the desktop release draft
177+
178+
Expected release artifacts by mode:
179+
180+
- `build`
181+
publishes binary artifacts and desktop binary metadata (`ota-release.json`)
182+
183+
- `ota`
184+
publishes binary artifacts, desktop binary metadata, and renderer OTA assets such as:
185+
- `apps/desktop/dist/manifest.yml`
186+
- `apps/desktop/dist/*.tar.gz`
187+
- `apps/desktop/dist/ota-release.json`
188+
- `apps/desktop/dist.tar.zst`
189+
190+
## Step 7: Report back to the user
142191

143-
If Step 4 decided mainHash SHOULD be updated, skip this step entirely — the bump already wrote the correct new value.
192+
Summarize:
144193

145-
## Step 7: Verify
194+
- new version: `v{NEW_VERSION}`
195+
- release mode: `build` or `ota`
196+
- `runtimeVersion`
197+
- renderer OTA included: yes or no
198+
- release branch
199+
- PR URL
200+
- short changelog highlights
146201

147-
1. Confirm the PR was created successfully by checking the output.
148-
2. Report the new version number and PR URL to the user.
149-
3. Summarize:
150-
- New version: v{NEW_VERSION}
151-
- mainHash updated: yes/no (and why)
152-
- Changelog highlights
153-
- PR URL
202+
When mentioning `mainHash`, only describe it as "regenerated automatically", never as the release decision mechanism.
154203

155204
## Reference
156205

157206
- Bump config: `apps/desktop/bump.config.ts`
158207
- Changelog dir: `apps/desktop/changelog/`
159208
- Changelog template: `apps/desktop/changelog/next.template.md`
160-
- mainHash generator: `apps/desktop/plugins/vite/generate-main-hash.ts`
161-
- Hot updater logic: `apps/desktop/layer/main/src/updater/hot-updater.ts`
162-
- CI build workflow: `.github/workflows/build-desktop.yml`
163-
- Tag workflow: `.github/workflows/tag.yml`
209+
- Changelog apply script: `apps/desktop/scripts/apply-changelog.ts`
210+
- Release plan input: `apps/desktop/release-plan.json`
211+
- Generated release config: `apps/desktop/release.json`
212+
- Release config apply script: `apps/desktop/scripts/apply-release-config.impl.ts`
213+
- Desktop release config resolver: `.github/scripts/resolve-desktop-release-config.mjs`
214+
- Desktop OTA metadata builder: `.github/scripts/build-ota-release.mjs`
215+
- Desktop build workflow: `.github/workflows/build-desktop.yml`
216+
- Tag orchestrator: `.github/workflows/tag.yml`
217+
- Desktop hot updater: `apps/desktop/layer/main/src/updater/hot-updater.ts`

0 commit comments

Comments
 (0)