This GitHub action simplifies deploying your WordPress plugin directly in the WordPress plugin directory.
Leveraging PHP instead of bash scripting, this action caters to the preferences of many WordPress developers, offering a familiar and potentially more convenient workflow.
This GitHub action can be used to automatically deploy a WordPress plugin to the WordPress.org plugin directory whenever a new release is released via GitHub releases. It is important that the GitHub release contains a distribution archive asset with a filename of the {name}.{version}.zip
format. The WP-CLI command wp dist-archive
can be used to create a distribution archive with this filename format.
For the WordPress.org login details it can be useful to create a variable and secret at organization level. For example, for the organization Pronamic the following variable and secret are used:
${{ vars.WORDPRESS_ORG_PRONAMIC_USERNAME }}
${{ secrets.WORDPRESS_ORG_PRONAMIC_PASSWORD }}
This way, the WordPress login details can be managed in one place and you don't have to do this per repository or environment.
The WordPress.org plugin directory can be seen as an environment where the plugin in a GitHub repository can be deployed to. The advantage of this is that GitHub shows the deployments to the WordPress.org plugin directory. And with protection rules you can delay the deployment to WordPres.org until after approval by 1 or more GitHub users.
name: Deploy to WordPress.org
on:
workflow_dispatch:
inputs:
tag:
description: 'Tag to deploy to WordPress.org'
required: true
type: string
release:
types: [released]
jobs:
deploy:
runs-on: ubuntu-latest
environment:
name: WordPress.org plugin directory
url: https://wordpress.org/plugins/salesfeed/
steps:
- name: Deploy
uses: pronamic/action-wordpress-org-plugin-deploy@main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
username: ${{ vars.WORDPRESS_ORG_PRONAMIC_USERNAME }}
password: ${{ secrets.WORDPRESS_ORG_PRONAMIC_PASSWORD }}
tag: ${{ inputs.tag || github.event.release.tag_name }}
slug: salesfeed
- https://github.com/marketplace/actions/wordpress-plugin-svn-deploy
- https://github.com/marketplace/actions/wordpress-plugin-readme-assets-update
- https://github.com/marketplace/actions/deploy-to-wordpress-org-svn-repository
- https://github.com/actions/deploy-pages
- https://github.com/actions/upload-pages-artifact
GITHUB_REPOSITORY=pronamic/pronamic-pay-with-rabo-smart-pay-for-woocommerce php release.php