Skip to content

Commit 3b7c4b7

Browse files
committed
docs: add comprehensive release script documentation
Added scripts/README.md with: - Complete release process guide - Prerequisites and installation instructions - Step-by-step checklist - Troubleshooting section - Manual release fallback (not recommended) - CI/CD integration explanation - Semantic versioning guidelines This ensures anyone can perform releases correctly and consistently.
1 parent faa9380 commit 3b7c4b7

1 file changed

Lines changed: 231 additions & 0 deletions

File tree

scripts/README.md

Lines changed: 231 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,231 @@
1+
# Orchestr8 Release Scripts
2+
3+
## Overview
4+
5+
This directory contains automation scripts for managing releases of the orchestr8 plugin.
6+
7+
## Release Process
8+
9+
### Automated Release (Recommended)
10+
11+
Use the `release.sh` script to automate the entire release process:
12+
13+
```bash
14+
./scripts/release.sh <version>
15+
```
16+
17+
**Example:**
18+
```bash
19+
./scripts/release.sh 2.2.1
20+
```
21+
22+
### What the Script Does
23+
24+
The release script handles all aspects of creating a release:
25+
26+
1. **Validates version format** (X.Y.Z semantic versioning)
27+
2. **Checks git status** (ensures working directory is clean)
28+
3. **Updates all version files:**
29+
- `.claude/VERSION`
30+
- `.claude/plugin.json`
31+
- `.claude-plugin/marketplace.json` (both version fields)
32+
4. **Verifies all versions match** (prevents version mismatch errors)
33+
5. **Extracts release notes** from `CHANGELOG.md`
34+
6. **Shows preview** of release notes for review
35+
7. **Creates git commit** with standardized message
36+
8. **Creates annotated git tag**
37+
9. **Pushes to remote** (with confirmation prompt)
38+
10. **Creates GitHub release** (with confirmation prompt)
39+
40+
### Prerequisites
41+
42+
**Required:**
43+
- `bash` - Shell script interpreter
44+
- `git` - Version control
45+
- Write access to the repository
46+
47+
**Optional but recommended:**
48+
- `jq` - For JSON manipulation (version file updates)
49+
- `gh` - GitHub CLI (for creating GitHub releases)
50+
51+
Install optional tools:
52+
```bash
53+
# macOS
54+
brew install jq gh
55+
56+
# Ubuntu/Debian
57+
sudo apt-get install jq gh
58+
59+
# Other platforms
60+
# See: https://stedolan.github.io/jq/download/
61+
# See: https://cli.github.com/manual/installation
62+
```
63+
64+
### Release Checklist
65+
66+
Before running the release script:
67+
68+
1. **Update CHANGELOG.md**
69+
```markdown
70+
## [X.Y.Z] - YYYY-MM-DD
71+
72+
### 🎯 Feature Category
73+
74+
**Feature Description:**
75+
- ✅ Change 1
76+
- ✅ Change 2
77+
```
78+
79+
2. **Commit all changes**
80+
```bash
81+
git add .
82+
git commit -m "feat: description of changes"
83+
```
84+
85+
3. **Ensure you're on main branch**
86+
```bash
87+
git checkout main
88+
git pull origin main
89+
```
90+
91+
4. **Run release script**
92+
```bash
93+
./scripts/release.sh 2.2.1
94+
```
95+
96+
5. **Verify release**
97+
- Check GitHub releases page
98+
- Test plugin installation
99+
- Announce release (if applicable)
100+
101+
### Manual Release (Not Recommended)
102+
103+
If you need to create a release manually:
104+
105+
```bash
106+
# 1. Update version files
107+
echo "2.2.1" > .claude/VERSION
108+
jq '.version = "2.2.1"' .claude/plugin.json > tmp.json && mv tmp.json .claude/plugin.json
109+
jq '.metadata.version = "2.2.1" | .plugins[0].version = "2.2.1"' .claude-plugin/marketplace.json > tmp.json && mv tmp.json .claude-plugin/marketplace.json
110+
111+
# 2. Verify versions match
112+
cat .claude/VERSION
113+
jq -r '.version' .claude/plugin.json
114+
jq -r '.metadata.version' .claude-plugin/marketplace.json
115+
jq -r '.plugins[0].version' .claude-plugin/marketplace.json
116+
117+
# 3. Update CHANGELOG.md manually
118+
119+
# 4. Commit changes
120+
git add .claude/VERSION .claude/plugin.json .claude-plugin/marketplace.json .claude/CHANGELOG.md
121+
git commit -m "release: v2.2.1"
122+
123+
# 5. Create tag
124+
git tag -a v2.2.1 -m "Release v2.2.1"
125+
126+
# 6. Push
127+
git push origin main
128+
git push origin v2.2.1
129+
130+
# 7. Create GitHub release
131+
gh release create v2.2.1 --title "v2.2.1" --notes-file <(sed -n '/^## \[2\.2\.1\]/,/^## \[/p' .claude/CHANGELOG.md | sed '1d;$d')
132+
```
133+
134+
**Why not manual?** Manual releases are error-prone:
135+
- Version mismatches between files
136+
- Inconsistent commit messages
137+
- Forgetting to update marketplace.json
138+
- Release note extraction errors
139+
- Skipped validation steps
140+
141+
The automated script prevents these issues.
142+
143+
## Troubleshooting
144+
145+
### "jq not installed"
146+
147+
The script will warn but continue. Version files won't be automatically updated. Install jq:
148+
```bash
149+
brew install jq # macOS
150+
sudo apt-get install jq # Ubuntu
151+
```
152+
153+
### "gh not installed"
154+
155+
The script will skip GitHub release creation. Install gh:
156+
```bash
157+
brew install gh # macOS
158+
gh auth login # Authenticate
159+
```
160+
161+
### "Working directory not clean"
162+
163+
Commit or stash your changes:
164+
```bash
165+
git status
166+
git add .
167+
git commit -m "..."
168+
# Or
169+
git stash
170+
```
171+
172+
### "Version not found in CHANGELOG.md"
173+
174+
Update CHANGELOG.md first:
175+
```markdown
176+
## [X.Y.Z] - YYYY-MM-DD
177+
178+
### Changes
179+
...
180+
```
181+
182+
### "Not on main branch"
183+
184+
Switch to main:
185+
```bash
186+
git checkout main
187+
git pull origin main
188+
```
189+
190+
The script allows continuing anyway (with confirmation).
191+
192+
## CI/CD Integration
193+
194+
The `.github/workflows/release.yml` workflow automatically runs when a tag matching `v*.*.*` is pushed:
195+
196+
1. **Validates release:**
197+
- Tag matches VERSION file
198+
- All version files match
199+
- CHANGELOG.md has entry for this version
200+
201+
2. **Extracts release notes:**
202+
- Uses same logic as release.sh
203+
- Ensures consistent release note formatting
204+
205+
3. **Creates GitHub release:**
206+
- Publishes release
207+
- Attaches release notes
208+
209+
**The workflow is automatically triggered when you push a tag via the release script.**
210+
211+
## Version Format
212+
213+
Always use semantic versioning: `MAJOR.MINOR.PATCH`
214+
215+
- **MAJOR:** Breaking changes
216+
- **MINOR:** New features (backward-compatible)
217+
- **PATCH:** Bug fixes (backward-compatible)
218+
219+
Examples:
220+
- `2.2.1` - Patch release
221+
- `2.3.0` - Minor release (new features)
222+
- `3.0.0` - Major release (breaking changes)
223+
224+
## Support
225+
226+
For issues with the release process:
227+
228+
1. Check this README
229+
2. Review `.github/workflows/release.yml`
230+
3. Examine the release.sh script
231+
4. Open an issue: https://github.com/seth-schultz/orchestr8/issues

0 commit comments

Comments
 (0)