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