4.7 KiB
Plugin Deployment Scripts
This project contains two deployment scripts — a Windows deploy.bat and a
cross-platform deploy.sh — that automate the build, packaging, and deployment
of a WordPress plugin.
You can deploy to:
-
📦 GitHub Releases
-
🔐 Private Server (optional)
-
🧾 Static JSON/CDN delivery for the UUPD Updater
Files Used
-
deploy.cfg– Configuration file containing plugin metadata and paths (one per plugin) -
deploy.bat– Windows batch script for running from Command Prompt or double-click -
deploy.sh– Bash script for running from Git Bash (Windows) or Linux/macOS -
plugin.php– Main plugin file (must matchPLUGIN_SLUG) -
static.txt– Static readme content (description, installation, etc.) -
changelog.txt– Changelog used inreadme.txtand release notes -
generate_index.php– Createsindex.jsonfor UUPD to read
How It Works
-
Loads config from
deploy.cfg
This contains plugin name, slug, GitHub repo, changelog path, etc. -
Updates plugin headers
Calls a PHP script to set version numbers and other metadata. -
Builds
readme.txt
Combines static content and changelog into a properly formatted readme. -
Commits and pushes to GitHub
If there are changes, they are committed and pushed to themainbranch. -
Creates
.zipfile
Uses 7-Zip (Windows) ortaras a fallback. -
Deploys
-
If
DEPLOY_TARGET=github, uploads a release and asset to GitHub. -
If
DEPLOY_TARGET=private, copies the.zipto a destination folder.
-
-
Generates
index.json
For use with UUPD, enabling auto-updates from GitHub or your own CDN.
Running the Scripts
Windows (Batch version)
Run from Command Prompt or double-click:
deploy.bat
Git Bash / Linux / macOS (Bash version)
On Windows, install Git Bash, then run:
"C:\Program Files\Git\bin\bash.exe" deploy.sh
On Linux/macOS:
bash deploy.sh
Note: The Bash script uses
set -uo pipefailfor safety, so missing variables indeploy.cfgor failed commands will stop execution.
⚙ deploy.cfg Example
PLUGIN_NAME=Automation for WPSubscriptions
PLUGIN_TAGS=Automation for WPSubscriptions, Flowmattic
PLUGIN_SLUG=automation-for-wpsubscription
GITHUB_REPO=stingray82/automation-for-wpsubscription
ZIP_NAME=automation-for-wpsubscription.zip
DEPLOY_TARGET=github
CHANGELOG_FILE=C:/Users/Nathan/Git/rup-changelogs/automation-for-wpsubscription.txt
STATIC_FILE=static.txt
DEST_DIR=D:/updater.reallyusefulplugins.com/plugin-updates/custom-packages
Tip: Use forward slashes in paths (C:/path/to/file) to avoid escaping
issues in Git Bash.
Example Output
example-plugin/
├── readme.txt
├── example-plugin.php
├── ...
└── uupd/
├── index.json
├── banner-772x250.png
├── icon-128.png
├── info.txt
Requirements
-
PHP (CLI)
-
Git
-
7-Zip (for Windows ZIP creation)
-
GitHub personal access token with
reposcope (saved to a.txtfile) -
Git Bash (Windows) for running
deploy.sh
Tips
-
Serve
index.jsonfrom GitHub Pages orraw.githubusercontent.comfor UUPD:https://raw.githubusercontent.com/yourusername/example-plugin/main/uupd/index.json -
Keep a separate
deploy.cfgper plugin so you can reuse the same scripts. -
The
.shversion works well for automating inside CI/CD pipelines.
Status
Actively used for real plugin deployments. Works with GitHub releases, private server delivery, and static/CDN-based updates via UUPD.