Skip to content

Commit fa62f4e

Browse files
committed
docs: improve publishing workflow to follow standard practices
- Move version bump to AFTER PR merge (industry standard) - Separate feature development from release management - Add clear timing guidance for AI assistants - Fix workflow numbering and flow - Add error recovery instructions
1 parent d682597 commit fa62f4e

File tree

1 file changed

+43
-25
lines changed

1 file changed

+43
-25
lines changed

publishing.md

Lines changed: 43 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -51,31 +51,13 @@ git checkout -b feature/my-feature main
5151

5252
# Make your changes, commit them
5353
# ...
54-
55-
# Check existing versions before updating
56-
git tag -l "v*"
57-
58-
# Update version in package.json (manually edit)
59-
# Example: "1.1.0"
60-
# IMPORTANT: Choose a NEW version that doesn't have an existing git tag
61-
# This is necessary for our CDN links to work correctly
62-
63-
# Sync package-lock.json with new version
64-
npm install
65-
66-
# Build the library and app for both npm and CDN delivery
67-
npm run build:lib
68-
npm run build
69-
70-
# Commit the version change and builds
71-
git add .
72-
git commit -am "Bump version to X.Y.Z"
54+
# DO NOT update version numbers yet - this happens after merge
7355
```
7456

7557
### 2. Test the Package (Optional)
7658

7759
```bash
78-
# Test the package locally
60+
# Test the package locally (without version changes)
7961
npm pack
8062
tar -tf @snf-access-qa-bot-*.tgz
8163

@@ -88,19 +70,46 @@ rm @snf-access-qa-bot-*.tgz
8870
- Create PR from `feature/my-feature` to `main`
8971
- Include description of changes
9072
- Get code review and approval
73+
- **Note**: PR should NOT include version bumps
9174

9275
### 4. Merge to Main
9376

9477
Once PR is approved and merged to main, proceed with the release.
9578

96-
### 5. Create Release
79+
### 5. Prepare Release (Post-Merge)
9780

9881
```bash
99-
# Switch to main and pull latest
82+
# Switch to main and pull latest changes (including your merged PR)
10083
git checkout main
10184
git pull upstream main
10285

103-
# Create git tag and push it
86+
# Check existing versions before updating
87+
git tag -l "v*"
88+
89+
# Update version in package.json (manually edit)
90+
# Example: "2.6.4"
91+
# IMPORTANT: Choose a NEW version that doesn't have an existing git tag
92+
# This is necessary for our CDN links to work correctly
93+
94+
# Sync package-lock.json with new version
95+
npm install
96+
97+
# Build the library and app for both npm and CDN delivery
98+
npm run build:lib
99+
npm run build
100+
101+
# Commit the version change and builds
102+
git add .
103+
git commit -am "Bump version to X.Y.Z"
104+
105+
# Push the version bump to main
106+
git push upstream main
107+
```
108+
109+
### 6. Create Git Tag and GitHub Release
110+
111+
```bash
112+
# Create git tag and push it (version should already be committed)
104113
git tag -a vX.Y.Z -m "Release version X.Y.Z" # Match your actual version
105114
git push upstream vX.Y.Z
106115

@@ -113,7 +122,7 @@ git push upstream vX.Y.Z
113122
- Add a title and description
114123
- Click "Publish release"
115124

116-
### 6. Publish to npm
125+
### 7. Publish to npm
117126

118127
```bash
119128
# Update npm-release branch with latest main
@@ -210,8 +219,17 @@ For more detailed usage instructions and examples, refer to the README.md file.
210219

211220
This workflow is designed to be clear and actionable for AI assistants. Key points:
212221

222+
- **Version bump timing**: Always happens AFTER PR merge, on main branch
223+
- **Feature PRs**: Should NOT include version bumps - focus on feature changes only
213224
- Always check existing git tags before choosing a version number
214225
- Build commands are: `npm run build:lib && npm run build`
215226
- The process maintains both npm packages and CDN links
216227
- Debug releases use the `--tag debug` flag and don't create git tags
217-
- Clean up temporary files (like .tgz from npm pack) after testing
228+
- Clean up temporary files (like .tgz from npm pack) after testing
229+
230+
### If Version Bump Gets Missed
231+
If a PR is merged without version bump (old workflow), simply:
232+
1. Update version on main after merge
233+
2. Build and commit
234+
3. Proceed with tagging and release
235+
This is actually the preferred approach.

0 commit comments

Comments
 (0)