Github to WordPress.org Deployment Script
We all know releasing plugins can be quite a chore, and deep down we all loathe SVN so here is a neat little script for automating the process as much as possible.
What this script does
This script will pull down your remote GIT and SVN repositories, tag a release using the branch you specify, and commit everything to WordPress.org.
To use it you must:
- Host your code on GITHUB
- Obtain a personal access token (keep this private!)
- Already have a WordPress.org SVN repository setup for your plugin.
- Have both GIT and SVN setup on your machine and available from the command line.
- Download the script release.sh from this repository and place it in a location of your choosing.
- Edit the script and set the GITHUB_ACCESS_TOKEN
- Set the PLUGIN_SLUG to match the slug of your WordPress.org plugin
- Set the GITHUB_REPO_OWNER to the owner of the repository you wish to deploy. Usually your username.
- Set the GITHUB_REPO_NAME to the name of your GITHUB repo.
- Save the script.
The script is ready to run.
- Open up terminal and cd to the directory containing the script.
- Follow the prompts.
Here is a screencast of the process you'll typically see when running the script.
- This will checkout the remote version of your Github Repo.
- Committing to WordPress.org can take a while so be patient.
- I have tested this on Mac only.
- Use at your own risk of course :)