RELEASE.md
Situation: You've completed a new feature, tested it locally, and want to release it.
Current State:
$ git status
On branch main
Your branch is up to date with 'origin/main'.
Changes not staged for commit:
modified: src/js/new-feature.js
modified: src/css/styles.css
modified: README.md
Untracked files:
src/js/feature-helper.js
Steps:
# 1. Commit your feature changes
git add .
git commit -m "Add new PDF watermark feature"
# 2. Choose your release type and run
npm run release # Patch: 1.0.0 โ 1.0.1 (bug fixes, small improvements)
npm run release:minor # Minor: 1.0.0 โ 1.1.0 (new features, backward compatible)
npm run release:major # Major: 1.0.0 โ 2.0.0 (breaking changes)
What Happens:
package.json and chart/Chart.yamlv1.0.1)Situation: You have local changes but haven't committed them yet.
Current State:
$ git status
Changes not staged for commit:
modified: package.json
modified: src/js/main.js
modified: README.md
โ This Will Fail:
npm run release
# Error: Your local changes would be overwritten by merge
โ Solution Options:
Option A: Commit Everything First (Recommended)
git add .
git commit -m "Add new features and improvements"
npm run release
Option B: Stash Changes Temporarily
git stash
npm run release
git stash pop # Restore your changes after release
Option C: Commit Only What's Needed
git add package.json src/js/main.js
git commit -m "Add core improvements"
npm run release
git add README.md
git commit -m "Update documentation"
Situation: There's a critical bug in production that needs immediate fixing.
Steps:
# 1. Fix the bug
git add src/js/bug-fix.js
git commit -m "Fix critical PDF rendering issue"
# 2. Release as patch (bug fix)
npm run release
# This creates: 1.0.0 โ 1.0.1
Result:
Situation: You've added significant new features that might break existing functionality.
Steps:
# 1. Commit all your changes
git add .
git commit -m "Add major PDF editing features and API changes"
# 2. Release as major version
npm run release:major
# This creates: 1.0.0 โ 2.0.0
Result:
Situation: You've been working on multiple features and want to release them together.
Steps:
# 1. Commit all features
git add .
git commit -m "Add multiple PDF tools: watermark, encryption, and compression"
# 2. Choose appropriate release type
npm run release:minor # For new features (1.0.0 โ 1.1.0)
# OR
npm run release:major # For breaking changes (1.0.0 โ 2.0.0)
Situation: You want to test the release system without affecting production.
Steps:
# 1. Make a small test change
echo "// Test comment" >> src/js/main.js
git add src/js/main.js
git commit -m "Test release process"
# 2. Run patch release
npm run release
# This creates: 1.0.0 โ 1.0.1
# 3. Verify everything works
# Check GitHub Actions, Docker Hub, etc.
# 4. If you want to undo the test release
git tag -d v1.0.1
git push origin :refs/tags/v1.0.1
git reset --hard HEAD~1
| Scenario | Command | Version Change | When to Use |
|---|---|---|---|
| Bug Fix | npm run release | 1.0.0 โ 1.0.1 | Fixing bugs, small improvements |
| New Feature | npm run release:minor | 1.0.0 โ 1.1.0 | Adding features, backward compatible |
| Breaking Change | npm run release:major | 1.0.0 โ 2.0.0 | API changes, major rewrites |
package.json version gets bumpedv1.0.1)bentopdfteam/bentopdf:latestbentopdfteam/bentopdf:1.0.1bentopdfteam/bentopdf:v1.0.1Users can immediately pull your new version:
docker pull bentopdfteam/bentopdf:1.0.1
You need to add these secrets to your GitHub repository:
DOCKER_USERNAME: Your Docker Hub usernameDOCKER_TOKEN: Your Docker Hub access tokenProblem: You have uncommitted changes Solution:
git add .
git commit -m "Your commit message"
npm run release
Problem: Missing Docker Hub credentials
Solution: Add DOCKER_USERNAME and DOCKER_TOKEN to GitHub Secrets
Problem: You've run the same release before Solution: This is normal! The script will skip creating duplicate tags
Problem: Various build issues Solution:
# Make a small change
echo "// Test" >> src/js/main.js
git add src/js/main.js
git commit -m "Test release"
npm run release
git tag --list should show new tagcat package.json | grep version should show updated versiongit tag -d v1.0.1
git push origin :refs/tags/v1.0.1
git reset --hard HEAD~1
Your release system is now ready! Just follow the scenarios above based on your situation and run the appropriate npm run release command.