You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Refactor release workflow to verify package.json version against release tag and update documentation on version update process. Implemented a warning system for version mismatches and clarified the update-before-tagging approach in RELEASES.md. (#37)
Copy file name to clipboardExpand all lines: docs/RELEASES.md
+63-2Lines changed: 63 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -25,6 +25,24 @@ Before creating a release, update:
25
25
}
26
26
```
27
27
28
+
### Version Update Workflow (Approach 1: Update Before Tagging)
29
+
30
+
This project follows **Approach 1** (Update Before Tagging), the industry standard used by most open-source projects:
31
+
32
+
**Workflow:**
33
+
1. Update `package.json` version
34
+
2. Commit and push (via PR if branch is protected)
35
+
3. After PR is merged, create the release tag
36
+
37
+
**Why this approach:**
38
+
- ✅ Tag already includes correct version in package.json
39
+
- ✅ No post-release sync needed
40
+
- ✅ Clean git history
41
+
- ✅ Works perfectly with protected branches
42
+
- ✅ Industry standard (used by React, Next.js, etc.)
43
+
44
+
**Important:** Always update `package.json`**before** creating the release tag. The workflow will verify version sync and warn if they don't match.
45
+
28
46
2.**CHANGELOG.md**: Add release notes for the new version
29
47
```markdown
30
48
## [0.1.0] - 2026-01-05
@@ -46,16 +64,33 @@ Before creating a release, update:
46
64
}
47
65
```
48
66
49
-
### Step 2: Commit Changes
67
+
### Step 2: Commit and Push Version Update
68
+
69
+
**If your branch is protected (requires PR):**
70
+
```bash
71
+
# Create a branch for the version update
72
+
git checkout -b chore/bump-version-to-0.1.0
73
+
74
+
# Commit changes
75
+
git add package.json CHANGELOG.md
76
+
git commit -m "chore: bump version to 0.1.0"
77
+
78
+
# Push and create PR
79
+
git push origin chore/bump-version-to-0.1.0
80
+
# Then create PR on GitHub and merge it
81
+
```
50
82
83
+
**If your branch is not protected:**
51
84
```bash
52
-
git add package.json CHANGELOG.md next.config.js
85
+
git add package.json CHANGELOG.md
53
86
git commit -m "chore: bump version to 0.1.0"
54
87
git push origin main
55
88
```
56
89
57
90
### Step 3: Create and Push Version Tag
58
91
92
+
**Important:** Only create the tag **after** the version update PR is merged (or pushed if not protected).
93
+
59
94
```bash
60
95
# Create annotated tag
61
96
git tag -a v0.1.0 -m "Release version 0.1.0"
@@ -221,6 +256,32 @@ These are set automatically during the release build.
221
256
2. Check workflow permissions
222
257
3. Verify CHANGELOG.md exists and has the version section
223
258
259
+
### Version Mismatch Warning
260
+
261
+
If you see a warning that `package.json` version doesn't match the release tag:
262
+
263
+
1.**This means**: The tag was created before `package.json` was updated
264
+
2.**Solution**: Update `package.json` manually to match the tag:
265
+
```bash
266
+
# Checkout main branch
267
+
git checkout main
268
+
269
+
# Update package.json version to match tag (e.g., 0.1.0)
270
+
# Edit package.json: "version": "0.1.0"
271
+
272
+
# Commit and push (via PR if branch is protected)
273
+
git add package.json
274
+
git commit -m "chore: update version to 0.1.0"
275
+
git push origin main # or create PR
276
+
```
277
+
278
+
3.**Prevention**: Always follow the workflow:
279
+
- Update `package.json` first
280
+
- Commit and merge PR
281
+
- Then create the release tag
282
+
283
+
4.**Note**: The workflow will continue successfully even if versions don't match (warning only), since the git tag is the source of truth for versioning.
284
+
224
285
### Build Artifacts
225
286
226
287
Build artifacts are uploaded to GitHub Actions and kept for 30 days. You can download them from the workflow run.
0 commit comments