wp-release-automation
v1.0.8
Published
A comprehensive CLI tool for automating WordPress plugin and theme release processes with version management, ZIP creation, and Git integration.
Maintainers
Readme
WordPress Release Automation
A comprehensive CLI tool for automating WordPress plugin and theme release processes with version management, ZIP creation, and Git integration.
Features
- 🔄 Version Management: Automated version bumping across multiple files
- 📦 ZIP Creation: WordPress-ready distribution packages
- 🏷️ Git Integration: Automatic commits, tagging, and pushing
- ⚙️ Configurable: Flexible configuration for different project needs
- 🚀 Complete Workflow: From version bump to GitHub release
- 📝 WordPress Standards: Follows WordPress plugin/theme conventions
Installation
Global Installation (Recommended)
npm install -g wp-release-automationLocal Installation
npm install --save-dev wp-release-automationQuick Start
Initialize your project:
cd your-wordpress-plugin wp-release initBump version and release:
npm run version:patch npm run wp-publishYour WordPress-ready ZIP file is created and pushed to GitHub!
CLI Commands
Initialize Project
wp-release initSets up configuration and package.json scripts for your WordPress project.
Version Management
wp-release version --type patch|minor|majorBuild Process
wp-release buildUpdates version numbers across all configured files and creates build directory.
Create Distribution ZIP
wp-release zipCreates a WordPress-ready ZIP file for distribution.
Complete Release
wp-release release --type patch|minor|major [--dry-run]Full release process: version bump → build → ZIP → Git tag.
Publish to GitHub
wp-release publish --type patch|minor|major [--dry-run]Complete release with push to GitHub.
NPM Scripts
After initialization, these scripts are available in your project:
# Version management
npm run version:patch # 1.0.0 → 1.0.1
npm run version:minor # 1.0.0 → 1.1.0
npm run version:major # 1.0.0 → 2.0.0
# Build and package
npm run build # Update versions and create build directory
npm run zip # Create distribution ZIP
# Complete workflows
npm run release # Build → ZIP → Tag
npm run wp-publish # Release → Push to GitHubConfiguration
The wp-release init command creates a wp-release.config.js file:
module.exports = {
"pluginName": "my-plugin",
"mainFile": "my-plugin.php",
"buildDir": "build",
"zipName": "{{name}}-{{version}}.zip",
"excludePatterns": [
"node_modules/",
".git/",
"src/",
"*.log",
".env*",
"tests/",
"*.md"
],
"config": {
"includeGitOps": true,
"tagPrefix": "v",
"branch": "main"
}
};Workflow Examples
Simple Release
# Bump patch version and release
npm run version:patch
npm run wp-publishStep by Step
# 1. Bump version
npm run version:minor
# 2. Update files and create ZIP
npm run build
npm run zip
# 3. Git operations
npm run git:tag
npm run git:pushUsing CLI Directly
# One command release
wp-release publish --type patch
# Dry run to see what would happen
wp-release release --type minor --dry-runFile Structure
After initialization, your project will have:
your-plugin/
├── package.json # NPM scripts added
├── wp-release.config.js # Configuration
├── your-plugin.php # Version updated automatically
├── README.md # Version updated automatically
└── your-plugin-1.0.0.zip # Distribution ZIP createdVersion Updates
The tool automatically updates version numbers in:
- WordPress Plugin Headers:
* Version: 1.0.6 - Plugin Constants:
define('PLUGIN_VERSION', '1.0.0') - README.md: Version headers and stable tags
- package.json: NPM version
Git Integration
When Git operations are enabled:
- Automatic commits with descriptive messages
- Git tags with release notes
- Push to GitHub with tags
- Release-ready for GitHub Releases
Advanced Usage
Custom Scripts
Add to your package.json:
{
"scripts": {
"pre-release": "npm run test && npm run lint",
"release:beta": "npm run version:patch && npm run build && npm run zip",
"deploy": "npm run wp-publish && echo 'Released!'"
}
}Hooks
Configure hooks in wp-release.config.js:
module.exports = {
// ...other config
"hooks": {
"preRelease": ["npm run test"],
"postRelease": ["echo 'Release complete!'"],
"preBuild": ["npm run compile"],
"postBuild": ["npm run optimize"]
}
};Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
License
MIT
Support
- Issues: GitHub Issues
- Documentation: GitHub Wiki
Made for WordPress developers who want professional release automation 🚀
