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 5 |
+
### **Scenario 1: I Just Finished a Feature and Want to Release**
|
| 6 |
+
|
| 7 |
+
**Situation:** You've completed a new feature, tested it locally, and want to release it.
|
| 8 |
+
|
| 9 |
+
**Current State:**
|
| 10 |
+
|
| 11 |
+
```bash
|
| 12 |
+
$ git status
|
| 13 |
+
On branch main
|
| 14 |
+
Your branch is up to date with 'origin/main'.
|
| 15 |
+
|
| 16 |
+
Changes not staged for commit:
|
| 17 |
+
modified: src/js/new-feature.js
|
| 18 |
+
modified: src/css/styles.css
|
| 19 |
+
modified: README.md
|
| 20 |
+
|
| 21 |
+
Untracked files:
|
| 22 |
+
src/js/feature-helper.js
|
| 23 |
+
```
|
| 24 |
+
|
| 25 |
+
**Steps:**
|
| 26 |
+
|
| 27 |
+
```bash
|
| 28 |
+
# 1. Commit your feature changes
|
| 29 |
+
git add .
|
| 30 |
+
git commit -m "Add new PDF watermark feature"
|
| 31 |
+
|
| 32 |
+
# 2. Choose your release type and run
|
| 33 |
+
npm run release # Patch: 1.0.0 β 1.0.1 (bug fixes, small improvements)
|
| 34 |
+
npm run release:minor # Minor: 1.0.0 β 1.1.0 (new features, backward compatible)
|
| 35 |
+
npm run release:major # Major: 1.0.0 β 2.0.0 (breaking changes)
|
| 36 |
+
```
|
| 37 |
+
|
| 38 |
+
**What Happens:**
|
| 39 |
+
|
| 40 |
+
- β
Your feature commit stays as-is
|
| 41 |
+
- β
Version gets bumped in `package.json` and `chart/Chart.yaml`
|
| 42 |
+
- β
New release commit is created
|
| 43 |
+
- β
Git tag is created (e.g., `v1.0.1`)
|
| 44 |
+
- β
Everything gets pushed to GitHub
|
| 45 |
+
- β
Docker image gets built and published
|
| 46 |
+
|
| 47 |
+
---
|
| 48 |
+
|
| 49 |
+
### **Scenario 2: I Have Uncommitted Changes and Want to Release**
|
| 50 |
+
|
| 51 |
+
**Situation:** You have local changes but haven't committed them yet.
|
| 52 |
+
|
| 53 |
+
**Current State:**
|
| 54 |
+
|
| 55 |
+
```bash
|
| 56 |
+
$ git status
|
| 57 |
+
Changes not staged for commit:
|
| 58 |
+
modified: package.json
|
| 59 |
+
modified: src/js/main.js
|
| 60 |
+
modified: README.md
|
| 61 |
+
```
|
| 62 |
+
|
| 63 |
+
**β This Will Fail:**
|
| 64 |
+
|
| 65 |
+
```bash
|
| 66 |
+
npm run release
|
| 67 |
+
# Error: Your local changes would be overwritten by merge
|
| 68 |
+
```
|
| 69 |
+
|
| 70 |
+
**β
Solution Options:**
|
| 71 |
+
|
| 72 |
+
**Option A: Commit Everything First (Recommended)**
|
| 73 |
+
|
| 74 |
+
```bash
|
| 75 |
+
git add .
|
| 76 |
+
git commit -m "Add new features and improvements"
|
| 77 |
+
npm run release
|
| 78 |
+
```
|
| 79 |
+
|
| 80 |
+
**Option B: Stash Changes Temporarily**
|
| 81 |
+
|
| 82 |
+
```bash
|
| 83 |
+
git stash
|
| 84 |
+
npm run release
|
| 85 |
+
git stash pop # Restore your changes after release
|
| 86 |
+
```
|
| 87 |
+
|
| 88 |
+
**Option C: Commit Only What's Needed**
|
| 89 |
+
|
| 90 |
+
```bash
|
| 91 |
+
git add package.json src/js/main.js
|
| 92 |
+
git commit -m "Add core improvements"
|
| 93 |
+
npm run release
|
| 94 |
+
git add README.md
|
| 95 |
+
git commit -m "Update documentation"
|
| 96 |
+
```
|
| 97 |
+
|
| 98 |
+
---
|
| 99 |
+
|
| 100 |
+
### **Scenario 3: I Want to Release a Hotfix**
|
| 101 |
+
|
| 102 |
+
**Situation:** There's a critical bug in production that needs immediate fixing.
|
| 103 |
+
|
| 104 |
+
**Steps:**
|
| 105 |
+
|
| 106 |
+
```bash
|
| 107 |
+
# 1. Fix the bug
|
| 108 |
+
git add src/js/bug-fix.js
|
| 109 |
+
git commit -m "Fix critical PDF rendering issue"
|
| 110 |
+
|
| 111 |
+
# 2. Release as patch (bug fix)
|
| 112 |
+
npm run release
|
| 113 |
+
# This creates: 1.0.0 β 1.0.1
|
| 114 |
+
```
|
| 115 |
+
|
| 116 |
+
**Result:**
|
| 117 |
+
|
| 118 |
+
- β
Bug fix gets released immediately
|
| 119 |
+
- β
Docker image with fix is available
|
| 120 |
+
- β
Users can pull the fixed version
|
| 121 |
+
|
| 122 |
+
---
|
| 123 |
+
|
| 124 |
+
### **Scenario 4: I Want to Release a Major Update**
|
| 125 |
+
|
| 126 |
+
**Situation:** You've added significant new features that might break existing functionality.
|
| 127 |
+
|
| 128 |
+
**Steps:**
|
| 129 |
+
|
| 130 |
+
```bash
|
| 131 |
+
# 1. Commit all your changes
|
| 132 |
+
git add .
|
| 133 |
+
git commit -m "Add major PDF editing features and API changes"
|
| 134 |
+
|
| 135 |
+
# 2. Release as major version
|
| 136 |
+
npm run release:major
|
| 137 |
+
# This creates: 1.0.0 β 2.0.0
|
| 138 |
+
```
|
| 139 |
+
|
| 140 |
+
**Result:**
|
| 141 |
+
|
| 142 |
+
- β
Major version bump indicates breaking changes
|
| 143 |
+
- β
Users know to check compatibility
|
| 144 |
+
- β
Both old and new versions available
|
| 145 |
+
|
| 146 |
+
---
|
| 147 |
+
|
| 148 |
+
### **Scenario 5: I Want to Release Multiple Features at Once**
|
| 149 |
+
|
| 150 |
+
**Situation:** You've been working on multiple features and want to release them together.
|
| 151 |
+
|
| 152 |
+
**Steps:**
|
| 153 |
+
|
| 154 |
+
```bash
|
| 155 |
+
# 1. Commit all features
|
| 156 |
+
git add .
|
| 157 |
+
git commit -m "Add multiple PDF tools: watermark, encryption, and compression"
|
| 158 |
+
|
| 159 |
+
# 2. Choose appropriate release type
|
| 160 |
+
npm run release:minor # For new features (1.0.0 β 1.1.0)
|
| 161 |
+
# OR
|
| 162 |
+
npm run release:major # For breaking changes (1.0.0 β 2.0.0)
|
| 163 |
+
```
|
| 164 |
+
|
| 165 |
+
---
|
| 166 |
+
|
| 167 |
+
### **Scenario 6: I Want to Test the Release Process**
|
| 168 |
+
|
| 169 |
+
**Situation:** You want to test the release system without affecting production.
|
| 170 |
+
|
| 171 |
+
**Steps:**
|
| 172 |
+
|
| 173 |
+
```bash
|
| 174 |
+
# 1. Make a small test change
|
| 175 |
+
echo "// Test comment" >> src/js/main.js
|
| 176 |
+
git add src/js/main.js
|
| 177 |
+
git commit -m "Test release process"
|
| 178 |
+
|
| 179 |
+
# 2. Run patch release
|
| 180 |
+
npm run release
|
| 181 |
+
# This creates: 1.0.0 β 1.0.1
|
| 182 |
+
|
| 183 |
+
# 3. Verify everything works
|
| 184 |
+
# Check GitHub Actions, Docker Hub, etc.
|
| 185 |
+
|
| 186 |
+
# 4. If you want to undo the test release
|
| 187 |
+
git tag -d v1.0.1
|
| 188 |
+
git push origin :refs/tags/v1.0.1
|
| 189 |
+
git reset --hard HEAD~1
|
| 190 |
+
```
|
| 191 |
+
|
| 192 |
+
---
|
| 193 |
+
|
| 194 |
+
## π― **Release Type Guidelines**
|
| 195 |
+
|
| 196 |
+
| Scenario | Command | Version Change | When to Use |
|
| 197 |
+
| ------------------- | ----------------------- | --------------- | ------------------------------------ |
|
| 198 |
+
| **Bug Fix** | `npm run release` | `1.0.0 β 1.0.1` | Fixing bugs, small improvements |
|
| 199 |
+
| **New Feature** | `npm run release:minor` | `1.0.0 β 1.1.0` | Adding features, backward compatible |
|
| 200 |
+
| **Breaking Change** | `npm run release:major` | `1.0.0 β 2.0.0` | API changes, major rewrites |
|
| 201 |
+
|
| 202 |
+
---
|
| 203 |
+
|
| 204 |
+
## π **What Happens After You Run a Release Command**
|
| 205 |
+
|
| 206 |
+
### **Immediate Actions (Local):**
|
| 207 |
+
|
| 208 |
+
1. **Version Update**: `package.json` version gets bumped
|
| 209 |
+
2. **Git Commit**: New commit created with "Release vX.X.X"
|
| 210 |
+
3. **Git Tag**: Tag created (e.g., `v1.0.1`)
|
| 211 |
+
4. **Git Push**: Everything pushed to GitHub
|
| 212 |
+
|
| 213 |
+
### **Automatic Actions (GitHub):**
|
| 214 |
+
|
| 215 |
+
1. **GitHub Actions Triggered**: Workflow starts building Docker image
|
| 216 |
+
2. **Docker Build**: Multi-architecture image created
|
| 217 |
+
3. **Docker Push**: Images pushed to Docker Hub with tags:
|
| 218 |
+
- `bentopdfteam/bentopdf:latest`
|
| 219 |
+
- `bentopdfteam/bentopdf:1.0.1`
|
| 220 |
+
- `bentopdfteam/bentopdf:v1.0.1`
|
| 221 |
+
|
| 222 |
+
### **End Result:**
|
| 223 |
+
|
| 224 |
+
Users can immediately pull your new version:
|
| 225 |
+
|
| 226 |
+
```bash
|
| 227 |
+
docker pull bentopdfteam/bentopdf:1.0.1
|
| 228 |
+
```
|
| 229 |
+
|
| 230 |
+
---
|
| 231 |
+
|
| 232 |
+
## π¨ **Before You Release - Prerequisites**
|
| 233 |
+
|
| 234 |
+
### **1. Docker Hub Credentials Setup**
|
| 235 |
+
|
| 236 |
+
You need to add these secrets to your GitHub repository:
|
| 237 |
+
|
| 238 |
+
1. Go to **Settings** β **Secrets and variables** β **Actions**
|
| 239 |
+
2. Add these secrets:
|
| 240 |
+
- `DOCKER_USERNAME`: Your Docker Hub username
|
| 241 |
+
- `DOCKER_TOKEN`: Your Docker Hub access token
|
| 242 |
+
|
| 243 |
+
### **2. Get Docker Hub Token**
|
| 244 |
+
|
| 245 |
+
1. Go to [Docker Hub](https://hub.docker.com)
|
| 246 |
+
2. Account Settings β Security β New Access Token
|
| 247 |
+
3. Set permissions to "Read, Write, Delete"
|
| 248 |
+
4. Copy the token and add it to GitHub Secrets
|
| 249 |
+
|
| 250 |
+
---
|
| 251 |
+
|
| 252 |
+
## π§ **Troubleshooting Common Issues**
|
| 253 |
+
|
| 254 |
+
### **β "Your local changes would be overwritten by merge"**
|
| 255 |
+
|
| 256 |
+
**Problem:** You have uncommitted changes
|
| 257 |
+
**Solution:**
|
| 258 |
+
|
| 259 |
+
```bash
|
| 260 |
+
git add .
|
| 261 |
+
git commit -m "Your commit message"
|
| 262 |
+
npm run release
|
| 263 |
+
```
|
| 264 |
+
|
| 265 |
+
### **β "Permission denied" in GitHub Actions**
|
| 266 |
+
|
| 267 |
+
**Problem:** Missing Docker Hub credentials
|
| 268 |
+
**Solution:** Add `DOCKER_USERNAME` and `DOCKER_TOKEN` to GitHub Secrets
|
| 269 |
+
|
| 270 |
+
### **β "Tag already exists"**
|
| 271 |
+
|
| 272 |
+
**Problem:** You've run the same release before
|
| 273 |
+
**Solution:** This is normal! The script will skip creating duplicate tags
|
| 274 |
+
|
| 275 |
+
### **β GitHub Actions fails**
|
| 276 |
+
|
| 277 |
+
**Problem:** Various build issues
|
| 278 |
+
**Solution:**
|
| 279 |
+
|
| 280 |
+
1. Check Actions tab for detailed logs
|
| 281 |
+
2. Verify Docker Hub credentials
|
| 282 |
+
3. Check Dockerfile for syntax errors
|
| 283 |
+
|
| 284 |
+
---
|
| 285 |
+
|
| 286 |
+
## π§ͺ **Testing Your Release System**
|
| 287 |
+
|
| 288 |
+
### **Quick Test:**
|
| 289 |
+
|
| 290 |
+
```bash
|
| 291 |
+
# Make a small change
|
| 292 |
+
echo "// Test" >> src/js/main.js
|
| 293 |
+
git add src/js/main.js
|
| 294 |
+
git commit -m "Test release"
|
| 295 |
+
npm run release
|
| 296 |
+
```
|
| 297 |
+
|
| 298 |
+
### **Verify Results:**
|
| 299 |
+
|
| 300 |
+
1. **GitHub Actions**: Check Actions tab for successful build
|
| 301 |
+
2. **Docker Hub**: Verify images are published
|
| 302 |
+
3. **Git Tags**: `git tag --list` should show new tag
|
| 303 |
+
4. **Version**: `cat package.json | grep version` should show updated version
|
| 304 |
+
|
| 305 |
+
### **Undo Test Release:**
|
| 306 |
+
|
| 307 |
+
```bash
|
| 308 |
+
git tag -d v1.0.1
|
| 309 |
+
git push origin :refs/tags/v1.0.1
|
| 310 |
+
git reset --hard HEAD~1
|
| 311 |
+
```
|
| 312 |
+
|
| 313 |
+
---
|
| 314 |
+
|
| 315 |
+
## π **That's It!**
|
| 316 |
+
|
| 317 |
+
Your release system is now ready! Just follow the scenarios above based on your situation and run the appropriate `npm run release` command.
|