Deploy your plugin to the WordPress.org repository via GitHub Actions (or locally). Uses git archive to export the
tagged commit, rsyncs it into SVN trunk, and copies .wordpress-org/ to assets/.
Based on 10up/action-wordpress-plugin-deploy, rewritten in TypeScript (originally PHP) with monorepo support and local execution.
| Feature | 10up deploy.sh |
This action wp-plugin-deploy.ts |
|---|---|---|
| Runs locally | No (Github action specific) | Yes (Requires Deno) |
| written in | bash | |
| Source of files | rsync from workspace OR git archive |
git archive, rsync only build_dirs: |
.distignore support |
Yes (rsync path only) | No (intentional, hate the idea) |
.gitattributes |
Used as fallback | Yes — git archive respects it |
| Ships untracked vendor | Only with .distignore (rsync path) |
No by default, use build_dirs: |
| Monorepo / subdirectory support | No | Yes |
--build-dirs param |
No | Yes — rsync extra dirs on top of the archive |
BUILD_DIR env (full replace) |
Yes | No |
ASSETS_DIR env override |
Yes — defaults to .wordpress-org |
No — hardcoded to .wordpress-org |
SLUG env override |
Yes — defaults to repo name | No — always derived from directory name |
--readme-and-assets-only |
No | Yes |
generate-zip default |
false |
true (via action.yml input default) |
| Dry-run mode | Yes | Yes |
SVN_USERNAME— WP.org usernameSVN_PASSWORD— WP.org password
| Input | Required | Description |
|---|---|---|
svn_user |
yes | WP.org username |
svn_pass |
yes | WP.org password |
version |
no* | Git tag to deploy (required unless readme-and-assets-only) |
workdir |
no | Relative path to plugin directory (slug detected from dir name) |
build_dirs |
no | Comma-separated dirs to rsync on top of archive (e.g. vendor) |
readme-and-assets-only |
no | Only update readme.txt and assets (boolean) |
dry-run |
no | Exit before SVN commit (boolean) |
verbose |
no | Verbose output (boolean) |
* version is required when deploying a full release, not for readme-only updates.
The plugin slug is taken from basename(getcwd()) after applying workdir. For example, with
workdir: plugins/my-slug, the slug becomes my-slug. The SVN URL is derived as
https://plugins.svn.wordpress.org/{slug}/.
- name: Deploy
uses: nextgenthemes/action-wordpress-plugin-deploy@master
with:
workdir: your-plugin-slug
version: ${{ steps.get_version.outputs.VERSION }}
svn_user: ${{ secrets.SVN_USERNAME }}
svn_pass: ${{ secrets.SVN_PASSWORD }}
build_dirs: vendor
readme-and-assets-only: false
dry-run: false
verbose: trueCheckout into a directory matching the slug, deploy from it:
deploy:
if: startsWith(github.ref, 'refs/tags') && !contains(github.ref, 'alpha')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
path: your-plugin-slug
- name: Get the version
id: get_version
run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
- name: Deploy
uses: nextgenthemes/action-wordpress-plugin-deploy@master
with:
workdir: your-plugin-slug
version: ${{ steps.get_version.outputs.VERSION }}
svn_user: ${{ secrets.SVN_USERNAME }}
svn_pass: ${{ secrets.SVN_PASSWORD }}If your plugin is at plugins/your-plugin-slug, omit path: and use workdir: plugins/your-plugin-slug.
When readme-and-assets-only: true, the action:
- Reads the stable tag from
readme.txtin the plugin directory - Updates
readme.txtin both SVN trunk and the stable tag - Syncs
.wordpress-org/toassets/ - Does not require
version
Ship directories not tracked in git (e.g. Composer vendor). Run composer install --no-dev before the deploy step, then
pass build_dirs: vendor. The directory is rsynced into trunk on top of the git archive export. Exits with error if
the directory doesn't exist.
- name: Install Composer dependencies
run: composer install --no-dev --no-interaction --optimize-autoloader
- name: Deploy
uses: nextgenthemes/action-wordpress-plugin-deploy@master
with:
build_dirs: vendor- Creates
/tmp/wp-deploy/and checks out SVN trunk + assets - Runs
git archive <tag>:<subdir>to export the tagged files - Rsyncs the archive into SVN trunk
- If
build_dirsis set, rsyncs those directories on top - Syncs
.wordpress-org/to SVNassets/ - Commits the tag via
svn cp trunk tags/<version> - Sets
svn:mime-typeon PNG, JPG, GIF, and SVG assets - Commits to SVN (or exits on dry-run)
Requires php-cli, subversion, and rsync.
sudo apt install php-cli subversion rsync
wget -O ~/bin/wp-plugin-deploy https://raw.githubusercontent.com/nextgenthemes/action-wordpress-plugin-deploy/master/wp-plugin-deploy.php
chmod +x ~/bin/wp-plugin-deployDeploy a tagged version:
cd /path/to/your-plugin-slug
wp-plugin-deploy --version=1.0.0 --verbose- Slug is taken from the directory name.
- Uses
git archivefor the tag — your working tree doesn't matter (except for--readme-and-assets-only). - Without
--svn-user/--svn-pass, you'll be prompted for credentials (OS keychain may remember them). - Use
--dry-runfirst, inspect/tmp/wp-deployto verify.