Deploy WordPress plugins to the WordPress.org plugin repository with automated SVN management, asset handling, and optional Slack notifications.
- Automated SVN repository management
- Support for
.distignorefile exclusions - Automatic asset deployment (banners, icons, screenshots)
- Proper MIME type setting for assets
- Tag management and versioning
- Optional zip file generation
- Dry-run mode for testing
- Slack notifications for successful deployments
- Automatic version detection from tags or package.json
name: Deploy to WordPress.org
on:
push:
tags:
- "*"
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: sultann/wordpress-plugin-deploy@v1
with:
username: ${{ secrets.SVN_USERNAME }}
password: ${{ secrets.SVN_PASSWORD }}Add the following secrets to your repository's settings under Settings > Secrets and Variables > Actions:
SVN_USERNAME- Your WordPress.org usernameSVN_PASSWORD- Your WordPress.org passwordSLACK_WEBHOOK- (Optional) Slack webhook URL for deployment notifications
| Input | Description | Required | Default |
|---|---|---|---|
username |
WordPress.org SVN username | Yes | - |
password |
WordPress.org SVN password | Yes | - |
slug |
Plugin slug on WordPress.org | No | Repository name |
version |
Release version | No | Tag name or package.json |
generate_zip |
Generate zip file of plugin | No | false |
dry_run |
Preview deployment without committing | No | false |
slack_webhook |
Slack webhook URL for notifications | No | - |
slack_message |
Custom Slack message | No | Auto-generated |
| Output | Description |
|---|---|
version |
Version number used for deployment |
zip_path |
Path to generated ZIP file (if generate_zip: true) |
Deploy when a tag is pushed:
name: Deploy to WordPress.org
on:
push:
tags:
- "*"
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: sultann/wordpress-plugin-deploy@v1
with:
username: ${{ secrets.SVN_USERNAME }}
password: ${{ secrets.SVN_PASSWORD }}If your GitHub repo name differs from WordPress.org slug:
- uses: sultann/wordpress-plugin-deploy@v1
with:
username: ${{ secrets.SVN_USERNAME }}
password: ${{ secrets.SVN_PASSWORD }}
slug: 'my-custom-slug'Generate a zip file for distribution:
- name: Deploy to WordPress.org
id: deploy
uses: sultann/wordpress-plugin-deploy@v1
with:
username: ${{ secrets.SVN_USERNAME }}
password: ${{ secrets.SVN_PASSWORD }}
generate_zip: true
- name: Upload Release Artifact
uses: actions/upload-artifact@v3
with:
name: plugin-zip
path: ${{ steps.deploy.outputs.zip_path }}Get notified in Slack when deployment succeeds:
- uses: sultann/wordpress-plugin-deploy@v1
with:
username: ${{ secrets.SVN_USERNAME }}
password: ${{ secrets.SVN_PASSWORD }}
slack_webhook: ${{ secrets.SLACK_WEBHOOK }}Preview what would be deployed without committing:
- uses: sultann/wordpress-plugin-deploy@v1
with:
username: ${{ secrets.SVN_USERNAME }}
password: ${{ secrets.SVN_PASSWORD }}
dry_run: trueIf there are files or directories to be excluded from release, such as tests or editor config files, they can be specified in a .distignore file.
Sample .distignore file:
/.git
/.github
/node_modules
.distignore
.gitignore
composer.json
composer.lock
package.json
package-lock.json
Create a directory named .wordpress-org in the root of your repository. This directory will contain all the assets (banners, icons, screenshots) that you want to deploy to WordPress.org. The action will automatically copy all files from this directory to the assets directory of the WordPress.org plugin repository.
Recommended structure:
.wordpress-org/
├── banner-772x250.png
├── banner-1544x500.png
├── icon-128x128.png
├── icon-256x256.png
├── screenshot-1.png
└── screenshot-2.png
The action follows these steps:
- Checks out the WordPress.org SVN repository
- Copies files from your repository to SVN trunk
- Applies exclusions from
.distignorefile - Copies assets from
.wordpress-orgdirectory (if exists) - Sets proper MIME types for asset images
- Creates or updates the version tag
- Commits changes to WordPress.org SVN
- Optionally generates a zip file
- Sends Slack notification (if configured)
To preview what files would be deployed locally:
cd wp-content
svn checkout --depth immediates https://plugins.svn.wordpress.org/my-plugin-slug/ my-plugin-slug-svn
svn update --set-depth infinity my-plugin-slug-svn/trunk
rsync -av --exclude-from=my-plugin-slug/.distignore --delete --delete-excluded my-plugin-slug/ my-plugin-slug-svn/trunk/The scripts and documentation in this project are released under the MIT License