|
1 | | -# 🚀 OpenFields - Quick Release Guide |
| 1 | +# Release Guide |
2 | 2 |
|
3 | | -**For releasing OpenFields to users** |
| 3 | +How to release Codeideal Open Fields to users. |
4 | 4 |
|
5 | 5 | --- |
6 | 6 |
|
7 | | -## The Super Simple Release Process |
| 7 | +## Quick Release (Interactive CLI) |
8 | 8 |
|
9 | | -### Step 1: Update Version |
10 | 9 | ```bash |
11 | | -cd openfields |
12 | | -pnpm version patch # or 'minor' for new features, 'major' for big changes |
| 10 | +pnpm release |
13 | 11 | ``` |
14 | 12 |
|
15 | | -This updates `package.json` automatically. |
| 13 | +This opens an interactive prompt where you choose: |
| 14 | +- **WordPress.org** (SVN → trunk + tagged version) |
| 15 | +- **GitHub** (git tag → Actions → Release page) |
| 16 | +- **Both** |
16 | 17 |
|
17 | | -### Step 2: Push with Tag |
18 | | -```bash |
19 | | -git push origin main --tags |
20 | | -``` |
21 | | - |
22 | | -### Done! 🎉 |
23 | | - |
24 | | -**GitHub Actions automatically:** |
25 | | -- ✅ Builds the plugin |
26 | | -- ✅ Creates a ZIP file |
27 | | -- ✅ Uploads to [Releases page](https://github.com/novincode/openfields/releases) |
28 | | -- ✅ Generates release notes |
29 | | - |
30 | | ---- |
31 | | - |
32 | | -## For Users |
33 | | - |
34 | | -They download from the [Releases page](https://github.com/novincode/openfields/releases): |
35 | | - |
36 | | -1. Click the latest release |
37 | | -2. Download `openfields-X.X.X.zip` |
38 | | -3. Upload to WordPress → Plugins → Add New → Upload |
39 | | -4. Click Install & Activate |
40 | | - |
41 | | -**No coding needed!** 👍 |
| 18 | +That's it. The CLI handles building, versioning, zipping, and deploying. |
42 | 19 |
|
43 | 20 | --- |
44 | 21 |
|
45 | | -## Version Bumping Guide |
| 22 | +## CLI Flags (Non-Interactive) |
46 | 23 |
|
47 | 24 | ```bash |
48 | | -# Bug fixes & small improvements → patch |
49 | | -pnpm version patch # v0.1.0 → v0.1.1 |
50 | | - |
51 | | -# New features, backwards compatible → minor |
52 | | -pnpm version minor # v0.1.1 → v0.2.0 |
53 | | - |
54 | | -# Breaking changes → major |
55 | | -pnpm version major # v0.2.0 → v1.0.0 |
| 25 | +pnpm release:svn # WordPress.org only |
| 26 | +pnpm release:github # GitHub only |
| 27 | +pnpm release:all # Both targets |
| 28 | +pnpm release:dry # Dry-run (build + preview, no commits) |
56 | 29 | ``` |
57 | 30 |
|
58 | 31 | --- |
59 | 32 |
|
60 | | -## What GitHub Actions Does |
| 33 | +## Step-by-Step: New Version Release |
61 | 34 |
|
62 | | -### On Every Tag Push |
| 35 | +### 1. Bump the version |
63 | 36 |
|
64 | | -**File:** `.github/workflows/release.yml` |
| 37 | +```bash |
| 38 | +pnpm version patch # 0.3.0 → 0.3.1 (bug fixes) |
| 39 | +pnpm version minor # 0.3.0 → 0.4.0 (new features) |
| 40 | +pnpm version major # 0.3.0 → 1.0.0 (breaking changes) |
| 41 | +``` |
65 | 42 |
|
66 | | -1. Checks out code |
67 | | -2. Installs Node dependencies |
68 | | -3. Runs `pnpm run build:plugin:release` |
69 | | -4. Creates GitHub Release |
70 | | -5. Uploads ZIP file to release |
| 43 | +This updates `package.json` automatically and creates a git commit + tag. |
71 | 44 |
|
72 | | -**Result:** Your plugin is instantly downloadable! 🎁 |
| 45 | +### 2. Push code to GitHub |
73 | 46 |
|
74 | | -### On Every Push |
| 47 | +```bash |
| 48 | +git push origin main |
| 49 | +``` |
75 | 50 |
|
76 | | -**File:** `.github/workflows/build.yml` |
| 51 | +### 3. Release |
77 | 52 |
|
78 | | -1. Runs TypeScript type checking |
79 | | -2. Runs ESLint linting |
80 | | -3. Builds the plugin |
81 | | -4. Saves build artifacts |
| 53 | +```bash |
| 54 | +pnpm release |
| 55 | +``` |
82 | 56 |
|
83 | | -**Result:** Catches errors early! ✅ |
| 57 | +Select your targets and confirm. Done. |
84 | 58 |
|
85 | 59 | --- |
86 | 60 |
|
87 | | -## Testing Before Release |
| 61 | +## What Happens Under the Hood |
88 | 62 |
|
89 | | -```bash |
90 | | -# Build locally |
91 | | -pnpm run build:plugin:release |
| 63 | +### Build Phase (always runs first) |
| 64 | +1. Syncs version from `package.json` → `codeideal-open-fields.php` |
| 65 | +2. Builds admin React/TypeScript app via Vite |
| 66 | +3. Creates distributable ZIP in `dist/` |
92 | 67 |
|
93 | | -# Test in WordPress |
94 | | -# Upload dist/openfields-X.X.X.zip |
95 | | -# Test in admin |
| 68 | +### WordPress.org SVN Deploy |
| 69 | +1. Updates local SVN working copy (`.svn-repo/`) |
| 70 | +2. Syncs all plugin files to `trunk/` |
| 71 | +3. Creates a version tag via `svn cp trunk tags/X.Y.Z` |
| 72 | +4. Commits everything to `https://plugins.svn.wordpress.org/codeideal-open-fields/` |
| 73 | +5. Update appears on wordpress.org within ~15 minutes |
96 | 74 |
|
97 | | -# If all good, push tags: |
98 | | -git tag v0.2.0 |
99 | | -git push origin --tags |
100 | | -``` |
| 75 | +### GitHub Release |
| 76 | +1. Creates an annotated git tag `vX.Y.Z` |
| 77 | +2. Pushes tag to origin |
| 78 | +3. GitHub Actions (`.github/workflows/release.yml`) builds and creates a Release with the ZIP attached |
101 | 79 |
|
102 | 80 | --- |
103 | 81 |
|
104 | | -## Common Commands |
| 82 | +## Configuration |
105 | 83 |
|
106 | | -```bash |
107 | | -# See what changed |
108 | | -git status |
109 | | -git diff |
110 | | - |
111 | | -# Make a commit |
112 | | -git add . |
113 | | -git commit -m "feat: Add new feature" |
114 | | - |
115 | | -# Update version |
116 | | -pnpm version patch |
117 | | - |
118 | | -# Push to GitHub (triggers release) |
119 | | -git push origin main --tags |
120 | | - |
121 | | -# Check release status |
122 | | -# Visit: https://github.com/novincode/openfields/actions |
123 | | -``` |
| 84 | +| Item | Location | |
| 85 | +|---|---| |
| 86 | +| SVN credentials | `.env` (`SVN_PASSWORD=...`) | |
| 87 | +| SVN username | `shayancode` | |
| 88 | +| SVN working copy | `.svn-repo/` (git-ignored) | |
| 89 | +| SVN repository | `https://plugins.svn.wordpress.org/codeideal-open-fields/` | |
| 90 | +| Plugin version source | `package.json` → `version` | |
| 91 | +| Release script | `scripts/release.ts` | |
| 92 | +| Build script | `scripts/build.sh` | |
| 93 | +| GitHub Actions | `.github/workflows/release.yml` | |
124 | 94 |
|
125 | 95 | --- |
126 | 96 |
|
127 | 97 | ## Troubleshooting |
128 | 98 |
|
129 | | -### GitHub Actions Failed? |
130 | | -- Check https://github.com/novincode/openfields/actions |
131 | | -- Click failed workflow to see error |
132 | | -- Common issues: |
133 | | - - Build errors → `pnpm run build` locally first |
134 | | - - Type errors → `pnpm run type-check` locally |
135 | | - - Lint errors → `pnpm run lint:fix` locally |
| 99 | +### SVN commit fails with "Access forbidden" |
| 100 | +- Check your SVN password at https://profiles.wordpress.org/me/profile/edit/group/3/?screen=svn-password |
| 101 | +- Ensure `.env` has the correct `SVN_PASSWORD` |
| 102 | +- Username is `shayancode` (case-sensitive) |
136 | 103 |
|
137 | | -### Need to Redo a Release? |
138 | | -```bash |
139 | | -# Delete tag locally |
140 | | -git tag -d v0.2.0 |
| 104 | +### Plugin not showing on WordPress.org after deploy |
| 105 | +- WordPress.org rebuilds ZIPs after each SVN commit — can take up to 15 minutes |
| 106 | +- Check https://wordpress.org/plugins/codeideal-open-fields/ after waiting |
141 | 107 |
|
142 | | -# Delete on GitHub |
143 | | -git push origin --delete v0.2.0 |
144 | | - |
145 | | -# Create again |
146 | | -pnpm version patch |
147 | | -git push origin main --tags |
148 | | -``` |
| 108 | +### GitHub Actions failed |
| 109 | +- Check https://github.com/novincode/openfields/actions |
| 110 | +- Common issues: build errors, type errors, lint errors |
| 111 | +- Test locally first: `pnpm release:dry` |
149 | 112 |
|
150 | | -### Want to Test Workflow? |
| 113 | +### Need to redo a release |
151 | 114 | ```bash |
152 | | -# Build locally |
153 | | -pnpm run build:plugin:release |
| 115 | +# Delete the git tag |
| 116 | +git tag -d v0.3.1 |
| 117 | +git push origin --delete v0.3.1 |
154 | 118 |
|
155 | | -# Check files |
156 | | -ls -la dist/ |
| 119 | +# Fix the issue, then re-release |
| 120 | +pnpm release |
157 | 121 | ``` |
158 | 122 |
|
159 | 123 | --- |
160 | 124 |
|
161 | 125 | ## Release Checklist |
162 | 126 |
|
163 | | -Before pushing: |
164 | | - |
165 | | -- [ ] `git pull` - Get latest changes |
166 | | -- [ ] Code review of your changes |
167 | | -- [ ] `pnpm run build:plugin:release` - Build successfully |
168 | | -- [ ] Test in WordPress locally |
169 | | -- [ ] `pnpm version patch` - Update version |
170 | | -- [ ] `git push origin main --tags` - Push tag |
171 | | -- [ ] Wait for Actions to complete (1-2 min) |
172 | | -- [ ] Check [Releases page](https://github.com/novincode/openfields/releases) |
173 | | -- [ ] Download ZIP to verify |
174 | | - |
175 | | ---- |
176 | | - |
177 | | -## Need Help? |
178 | | - |
179 | | -- **Build errors?** → See [docs/BUILD.md](./docs/BUILD.md) |
180 | | -- **Contributing?** → See [CONTRIBUTING.md](./CONTRIBUTING.md) |
181 | | -- **Documentation?** → See [docs/INDEX.md](./docs/INDEX.md) |
182 | | -- **GitHub Actions?** → Check `.github/workflows/` |
183 | | - |
184 | | ---- |
185 | | - |
186 | | -That's it! Simple, automated, and professional. 🎉 |
187 | | - |
188 | | -Made with ❤️ by the OpenFields team |
| 127 | +- [ ] `git pull origin main` — get latest |
| 128 | +- [ ] Review your changes |
| 129 | +- [ ] `pnpm release:dry` — dry-run to verify everything builds |
| 130 | +- [ ] `pnpm version patch` (or minor/major) — bump version |
| 131 | +- [ ] `pnpm release` — deploy |
| 132 | +- [ ] Verify on [WordPress.org](https://wordpress.org/plugins/codeideal-open-fields/) |
| 133 | +- [ ] Verify on [GitHub Releases](https://github.com/novincode/openfields/releases) |
0 commit comments