xref: /plugin/deletepageguard/RELEASE.md (revision 9a383d51b90310842e2a3f0f9d693178d0875b32)
1*9a383d51SJohann Duscher# Release Process for Delete Page Guard Plugin
2*9a383d51SJohann Duscher
3*9a383d51SJohann DuscherThis document describes the complete release process for the Delete Page Guard DokuWiki plugin, including development workflow, testing, versioning, and distribution.
4*9a383d51SJohann Duscher
5*9a383d51SJohann Duscher## Overview
6*9a383d51SJohann Duscher
7*9a383d51SJohann DuscherThe plugin uses a professional release workflow with:
8*9a383d51SJohann Duscher
9*9a383d51SJohann Duscher- Centralized version management
10*9a383d51SJohann Duscher- Automated testing and validation
11*9a383d51SJohann Duscher- Distribution packaging
12*9a383d51SJohann Duscher- Git integration
13*9a383d51SJohann Duscher- Semantic versioning
14*9a383d51SJohann Duscher
15*9a383d51SJohann Duscher## Prerequisites
16*9a383d51SJohann Duscher
17*9a383d51SJohann DuscherBefore starting a release, ensure you have:
18*9a383d51SJohann Duscher
19*9a383d51SJohann Duscher- PHP 7.4+ installed
20*9a383d51SJohann Duscher- Git repository properly configured
21*9a383d51SJohann Duscher- All changes committed and pushed
22*9a383d51SJohann Duscher- Tests passing
23*9a383d51SJohann Duscher
24*9a383d51SJohann Duscher## Release Workflow
25*9a383d51SJohann Duscher
26*9a383d51SJohann Duscher### 1. Prepare for Release
27*9a383d51SJohann Duscher
28*9a383d51SJohann DuscherFirst, ensure the codebase is ready for release:
29*9a383d51SJohann Duscher
30*9a383d51SJohann Duscher```bash
31*9a383d51SJohann Duscher# Check current status
32*9a383d51SJohann Duschermake status
33*9a383d51SJohann Duscher
34*9a383d51SJohann Duscher# Run all tests to ensure quality
35*9a383d51SJohann Duschermake test
36*9a383d51SJohann Duscher
37*9a383d51SJohann Duscher# Check PHP syntax of all files
38*9a383d51SJohann Duschermake check
39*9a383d51SJohann Duscher```
40*9a383d51SJohann Duscher
41*9a383d51SJohann DuscherAll tests should pass and syntax should be clean before proceeding.
42*9a383d51SJohann Duscher
43*9a383d51SJohann Duscher### 2. Update Version
44*9a383d51SJohann Duscher
45*9a383d51SJohann DuscherUse the automated version update system:
46*9a383d51SJohann Duscher
47*9a383d51SJohann Duscher```bash
48*9a383d51SJohann Duscher# Update to new version (use semantic versioning)
49*9a383d51SJohann Duschermake version VERSION=x.y.z
50*9a383d51SJohann Duscher```
51*9a383d51SJohann Duscher
52*9a383d51SJohann Duscher**Version numbering guidelines:**
53*9a383d51SJohann Duscher
54*9a383d51SJohann Duscher- **Patch version** (x.y.Z): Bug fixes, security patches, minor improvements
55*9a383d51SJohann Duscher- **Minor version** (x.Y.z): New features, backward-compatible changes
56*9a383d51SJohann Duscher- **Major version** (X.y.z): Breaking changes, major refactoring
57*9a383d51SJohann Duscher
58*9a383d51SJohann Duscher**Examples:**
59*9a383d51SJohann Duscher
60*9a383d51SJohann Duscher```bash
61*9a383d51SJohann Duschermake version VERSION=1.0.1  # Bug fix release
62*9a383d51SJohann Duschermake version VERSION=1.1.0  # Feature release
63*9a383d51SJohann Duschermake version VERSION=2.0.0  # Major release with breaking changes
64*9a383d51SJohann Duscher```
65*9a383d51SJohann Duscher
66*9a383d51SJohann Duscher**Note:** The current version is 1.0.0, which represents the initial stable release.
67*9a383d51SJohann Duscher
68*9a383d51SJohann DuscherThis command will:
69*9a383d51SJohann Duscher
70*9a383d51SJohann Duscher- Update `version.php` with new version and current date
71*9a383d51SJohann Duscher- Update `plugin.info.txt` with version information
72*9a383d51SJohann Duscher- Validate the new version format
73*9a383d51SJohann Duscher- Show what files were modified
74*9a383d51SJohann Duscher
75*9a383d51SJohann Duscher### 3. Update Documentation
76*9a383d51SJohann Duscher
77*9a383d51SJohann DuscherAfter version update, manually update release documentation:
78*9a383d51SJohann Duscher
79*9a383d51SJohann Duscher#### 3.1 Update CHANGELOG.md
80*9a383d51SJohann Duscher
81*9a383d51SJohann DuscherCreate or update `CHANGELOG.md` with release notes:
82*9a383d51SJohann Duscher
83*9a383d51SJohann Duscher```markdown
84*9a383d51SJohann Duscher# Changelog
85*9a383d51SJohann Duscher
86*9a383d51SJohann Duscher## [x.y.z] - YYYY-MM-DD
87*9a383d51SJohann Duscher
88*9a383d51SJohann Duscher### Added
89*9a383d51SJohann Duscher
90*9a383d51SJohann Duscher- New features
91*9a383d51SJohann Duscher
92*9a383d51SJohann Duscher### Changed
93*9a383d51SJohann Duscher
94*9a383d51SJohann Duscher- Modified functionality
95*9a383d51SJohann Duscher
96*9a383d51SJohann Duscher### Fixed
97*9a383d51SJohann Duscher
98*9a383d51SJohann Duscher- Bug fixes
99*9a383d51SJohann Duscher
100*9a383d51SJohann Duscher### Security
101*9a383d51SJohann Duscher
102*9a383d51SJohann Duscher- Security improvements
103*9a383d51SJohann Duscher```
104*9a383d51SJohann Duscher
105*9a383d51SJohann Duscher#### 3.2 Review README.md
106*9a383d51SJohann Duscher
107*9a383d51SJohann DuscherEnsure the README.md is up to date with:
108*9a383d51SJohann Duscher
109*9a383d51SJohann Duscher- Current feature list
110*9a383d51SJohann Duscher- Updated installation instructions
111*9a383d51SJohann Duscher- Correct version references
112*9a383d51SJohann Duscher
113*9a383d51SJohann Duscher### 4. Complete Release Workflow
114*9a383d51SJohann Duscher
115*9a383d51SJohann DuscherUse the automated release workflow:
116*9a383d51SJohann Duscher
117*9a383d51SJohann Duscher```bash
118*9a383d51SJohann Duscher# Complete release preparation
119*9a383d51SJohann Duschermake release VERSION=x.y.z
120*9a383d51SJohann Duscher```
121*9a383d51SJohann Duscher
122*9a383d51SJohann DuscherThis command will:
123*9a383d51SJohann Duscher
124*9a383d51SJohann Duscher1. Run syntax checks
125*9a383d51SJohann Duscher2. Execute all tests
126*9a383d51SJohann Duscher3. Update version information
127*9a383d51SJohann Duscher4. Provide git commands for next steps
128*9a383d51SJohann Duscher
129*9a383d51SJohann Duscher### 5. Git Operations
130*9a383d51SJohann Duscher
131*9a383d51SJohann DuscherFollow the provided git workflow:
132*9a383d51SJohann Duscher
133*9a383d51SJohann Duscher```bash
134*9a383d51SJohann Duscher# Review all changes
135*9a383d51SJohann Duschergit status
136*9a383d51SJohann Duschergit diff
137*9a383d51SJohann Duscher
138*9a383d51SJohann Duscher# Stage all changes
139*9a383d51SJohann Duschergit add -A
140*9a383d51SJohann Duscher
141*9a383d51SJohann Duscher# Commit the release
142*9a383d51SJohann Duschergit commit -m "Release version x.y.z"
143*9a383d51SJohann Duscher
144*9a383d51SJohann Duscher# Tag the release
145*9a383d51SJohann Duschergit tag vx.y.z
146*9a383d51SJohann Duscher
147*9a383d51SJohann Duscher# Create distribution package
148*9a383d51SJohann Duschermake dist
149*9a383d51SJohann Duscher
150*9a383d51SJohann Duscher# Push to repository with tags
151*9a383d51SJohann Duschergit push origin main --tags
152*9a383d51SJohann Duscher```
153*9a383d51SJohann Duscher
154*9a383d51SJohann Duscher### 6. Create Distribution Package
155*9a383d51SJohann Duscher
156*9a383d51SJohann DuscherGenerate the distribution package:
157*9a383d51SJohann Duscher
158*9a383d51SJohann Duscher```bash
159*9a383d51SJohann Duschermake dist
160*9a383d51SJohann Duscher```
161*9a383d51SJohann Duscher
162*9a383d51SJohann DuscherThis will:
163*9a383d51SJohann Duscher
164*9a383d51SJohann Duscher- Run tests and syntax checks
165*9a383d51SJohann Duscher- Create a clean distribution directory in `dist/deletepageguard-x.y.z/`
166*9a383d51SJohann Duscher- Include only necessary files for DokuWiki installation
167*9a383d51SJohann Duscher- Provide installation instructions
168*9a383d51SJohann Duscher
169*9a383d51SJohann Duscher**Distribution contents:**
170*9a383d51SJohann Duscher
171*9a383d51SJohann Duscher- `action.php` - Core plugin functionality
172*9a383d51SJohann Duscher- `admin.php` - Administrative interface
173*9a383d51SJohann Duscher- `plugin.info.txt` - Plugin metadata
174*9a383d51SJohann Duscher- `LICENSE.md` - GPL v2 license
175*9a383d51SJohann Duscher- `conf/` - Configuration files
176*9a383d51SJohann Duscher- `lang/` - Language files
177*9a383d51SJohann Duscher
178*9a383d51SJohann Duscher### 7. Verify Distribution
179*9a383d51SJohann Duscher
180*9a383d51SJohann DuscherTest the distribution package:
181*9a383d51SJohann Duscher
182*9a383d51SJohann Duscher```bash
183*9a383d51SJohann Duscher# Check distribution contents
184*9a383d51SJohann Duscherls -la dist/deletepageguard-x.y.z/
185*9a383d51SJohann Duscher
186*9a383d51SJohann Duscher# Verify all required files are present
187*9a383d51SJohann Duscher# Test installation in a DokuWiki instance (recommended)
188*9a383d51SJohann Duscher```
189*9a383d51SJohann Duscher
190*9a383d51SJohann Duscher## Makefile Commands Reference
191*9a383d51SJohann Duscher
192*9a383d51SJohann DuscherThe plugin includes a comprehensive Makefile with the following targets:
193*9a383d51SJohann Duscher
194*9a383d51SJohann Duscher### Development Commands
195*9a383d51SJohann Duscher
196*9a383d51SJohann Duscher```bash
197*9a383d51SJohann Duschermake test      # Run tests
198*9a383d51SJohann Duschermake check     # Check PHP syntax of all files
199*9a383d51SJohann Duschermake clean     # Clean temporary files and build artifacts
200*9a383d51SJohann Duscher```
201*9a383d51SJohann Duscher
202*9a383d51SJohann Duscher### Release Commands
203*9a383d51SJohann Duscher
204*9a383d51SJohann Duscher```bash
205*9a383d51SJohann Duschermake version VERSION=x.y.z  # Update version in all files
206*9a383d51SJohann Duschermake dist                   # Create distribution package
207*9a383d51SJohann Duschermake release VERSION=x.y.z  # Complete release workflow
208*9a383d51SJohann Duscher```
209*9a383d51SJohann Duscher
210*9a383d51SJohann Duscher### Utility Commands
211*9a383d51SJohann Duscher
212*9a383d51SJohann Duscher```bash
213*9a383d51SJohann Duschermake status    # Show current version and git status
214*9a383d51SJohann Duschermake help      # Show all available commands
215*9a383d51SJohann Duscher```
216*9a383d51SJohann Duscher
217*9a383d51SJohann Duscher## Version Management
218*9a383d51SJohann Duscher
219*9a383d51SJohann Duscher### Centralized Version Control
220*9a383d51SJohann Duscher
221*9a383d51SJohann DuscherThe plugin uses centralized version management through `version.php`:
222*9a383d51SJohann Duscher
223*9a383d51SJohann Duscher```php
224*9a383d51SJohann Duscherreturn [
225*9a383d51SJohann Duscher    'version' => 'x.y.z',
226*9a383d51SJohann Duscher    'date' => 'YYYY-MM-DD',
227*9a383d51SJohann Duscher    'name' => 'Delete Page Guard',
228*9a383d51SJohann Duscher    'author' => 'Johann Duscher',
229*9a383d51SJohann Duscher    'email' => 'jonny.dee@posteo.net',
230*9a383d51SJohann Duscher    'url' => 'https://github.com/jonnydee/deletepageguard'
231*9a383d51SJohann Duscher];
232*9a383d51SJohann Duscher```
233*9a383d51SJohann Duscher
234*9a383d51SJohann Duscher### Automated Updates
235*9a383d51SJohann Duscher
236*9a383d51SJohann DuscherThe `build/update-version.php` script automatically:
237*9a383d51SJohann Duscher
238*9a383d51SJohann Duscher- Updates version across all relevant files
239*9a383d51SJohann Duscher- Sets current date
240*9a383d51SJohann Duscher- Validates semantic version format
241*9a383d51SJohann Duscher- Reports all changes made
242*9a383d51SJohann Duscher
243*9a383d51SJohann Duscher## Quality Assurance
244*9a383d51SJohann Duscher
245*9a383d51SJohann Duscher### Testing
246*9a383d51SJohann Duscher
247*9a383d51SJohann DuscherThe plugin includes comprehensive testing:
248*9a383d51SJohann Duscher
249*9a383d51SJohann Duscher- Test cases covering all functionality
250*9a383d51SJohann Duscher- Pattern validation and matching
251*9a383d51SJohann Duscher- Security features and edge cases
252*9a383d51SJohann Duscher- Cross-platform compatibility
253*9a383d51SJohann Duscher- No DokuWiki installation required for testing
254*9a383d51SJohann Duscher
255*9a383d51SJohann Duscher### Validation
256*9a383d51SJohann Duscher
257*9a383d51SJohann DuscherEach release is validated through:
258*9a383d51SJohann Duscher
259*9a383d51SJohann Duscher- PHP syntax checking
260*9a383d51SJohann Duscher- Comprehensive test suite execution
261*9a383d51SJohann Duscher- Pattern validation testing
262*9a383d51SJohann Duscher- Security vulnerability checks
263*9a383d51SJohann Duscher
264*9a383d51SJohann Duscher## Distribution
265*9a383d51SJohann Duscher
266*9a383d51SJohann Duscher### Package Contents
267*9a383d51SJohann Duscher
268*9a383d51SJohann DuscherThe distribution package includes only files necessary for DokuWiki installation:
269*9a383d51SJohann Duscher
270*9a383d51SJohann Duscher- Core plugin files (`action.php`, `admin.php`)
271*9a383d51SJohann Duscher- Configuration files (`conf/`)
272*9a383d51SJohann Duscher- Language files (`lang/`)
273*9a383d51SJohann Duscher- Documentation (`LICENSE.md`)
274*9a383d51SJohann Duscher- Plugin metadata (`plugin.info.txt`)
275*9a383d51SJohann Duscher
276*9a383d51SJohann Duscher### Installation
277*9a383d51SJohann Duscher
278*9a383d51SJohann DuscherUsers install the plugin by:
279*9a383d51SJohann Duscher
280*9a383d51SJohann Duscher1. Extracting the distribution package
281*9a383d51SJohann Duscher2. Copying contents to `<dokuwiki>/lib/plugins/deletepageguard/`
282*9a383d51SJohann Duscher3. Configuring via DokuWiki Configuration Manager
283*9a383d51SJohann Duscher
284*9a383d51SJohann Duscher## Troubleshooting
285*9a383d51SJohann Duscher
286*9a383d51SJohann Duscher### Common Issues
287*9a383d51SJohann Duscher
288*9a383d51SJohann Duscher**Tests failing:**
289*9a383d51SJohann Duscher
290*9a383d51SJohann Duscher```bash
291*9a383d51SJohann Duscher# Run tests with verbose output
292*9a383d51SJohann Duscherphp tests/test_runner.php
293*9a383d51SJohann Duscher
294*9a383d51SJohann Duscher# Check specific test failures and fix code
295*9a383d51SJohann Duscher```
296*9a383d51SJohann Duscher
297*9a383d51SJohann Duscher**Syntax errors:**
298*9a383d51SJohann Duscher
299*9a383d51SJohann Duscher```bash
300*9a383d51SJohann Duscher# Find syntax errors
301*9a383d51SJohann Duschermake check
302*9a383d51SJohann Duscher
303*9a383d51SJohann Duscher# Fix reported syntax issues
304*9a383d51SJohann Duscher```
305*9a383d51SJohann Duscher
306*9a383d51SJohann Duscher**Version update issues:**
307*9a383d51SJohann Duscher
308*9a383d51SJohann Duscher```bash
309*9a383d51SJohann Duscher# Manually check version.php format
310*9a383d51SJohann Duscherphp -r "var_dump(include 'version.php');"
311*9a383d51SJohann Duscher
312*9a383d51SJohann Duscher# Ensure proper semantic versioning (x.y.z)
313*9a383d51SJohann Duscher```
314*9a383d51SJohann Duscher
315*9a383d51SJohann Duscher**Distribution problems:**
316*9a383d51SJohann Duscher
317*9a383d51SJohann Duscher```bash
318*9a383d51SJohann Duscher# Clean and rebuild
319*9a383d51SJohann Duschermake clean
320*9a383d51SJohann Duschermake dist
321*9a383d51SJohann Duscher
322*9a383d51SJohann Duscher# Check file permissions and paths
323*9a383d51SJohann Duscher```
324*9a383d51SJohann Duscher
325*9a383d51SJohann Duscher## Best Practices
326*9a383d51SJohann Duscher
327*9a383d51SJohann Duscher1. **Always test before release**: Run `make test` and `make check`
328*9a383d51SJohann Duscher2. **Use semantic versioning**: Follow x.y.z format consistently
329*9a383d51SJohann Duscher3. **Update documentation**: Keep CHANGELOG.md and README.md current
330*9a383d51SJohann Duscher4. **Tag releases**: Use `git tag vx.y.z` for version tracking
331*9a383d51SJohann Duscher5. **Verify distribution**: Test installation in actual DokuWiki instance
332*9a383d51SJohann Duscher6. **Backup before major releases**: Ensure git repository is safely backed up
333*9a383d51SJohann Duscher
334*9a383d51SJohann Duscher## Release Checklist
335*9a383d51SJohann Duscher
336*9a383d51SJohann Duscher- [ ] All tests pass (`make test`)
337*9a383d51SJohann Duscher- [ ] Syntax check clean (`make check`)
338*9a383d51SJohann Duscher- [ ] Version updated (`make version VERSION=x.y.z`)
339*9a383d51SJohann Duscher- [ ] CHANGELOG.md updated with release notes
340*9a383d51SJohann Duscher- [ ] README.md reviewed and current
341*9a383d51SJohann Duscher- [ ] Changes committed and pushed
342*9a383d51SJohann Duscher- [ ] Release tagged (`git tag vx.y.z`)
343*9a383d51SJohann Duscher- [ ] Distribution package created (`make dist`)
344*9a383d51SJohann Duscher- [ ] Distribution verified and tested
345*9a383d51SJohann Duscher- [ ] Release pushed with tags (`git push origin main --tags`)
346*9a383d51SJohann Duscher
347*9a383d51SJohann Duscher## Support
348*9a383d51SJohann Duscher
349*9a383d51SJohann DuscherFor questions about the release process:
350*9a383d51SJohann Duscher
351*9a383d51SJohann Duscher- Review this documentation
352*9a383d51SJohann Duscher- Check Makefile help (`make help`)
353*9a383d51SJohann Duscher- Examine test output for issues
354*9a383d51SJohann Duscher- Refer to git history for previous releases
355