Deploying plugins on WP.org directly from GitHub

Using SVN and manually creating new releases for every update on WordPress.org can be a waste of time and a tedious process.

I know for a fact that some people can delay plugin updates or even don’t publish them on WordPress.org just for not having to deal with it.

In my case, I’m not an active developer, and I only have some basic/small plugins, so it becomes even more relevant as I wouldn’t say I like to put a lot of time into such basic things.

With that in mind, I have been checking a few ways to automate this process, making it easier in the long term.

GitHub action

My first try was actually successful, and I was able to do it effortlessly with the WordPress Plugin Deploy from 10up action.

It’s a GitHub action, and it allows you to do a few different workflows.

I decided to use it in a way that it would run and deploy when creating a new tag/release on GitHub.

Setting it up

1. Making sure that it’s all set on WordPress.org

If you already have it as a published plugin with the SVN access, you can go to the next step.

Still, if that’s your first plugin and you are still unsure about what you should do, I want to make sure that we are on the same page.

First, you need to have it on the WordPress.org Plugins Directory. You can send it for approval, and the Plugins Review Team will get back to you.

By the way, it worths pointing out that they are volunteers after all. Please be patient if that’s taking longer than you expected.

Currently, it seems that you have access to the SVN repository 1 hour after the confirmation email. You can see when it’s going to be available on their confirmation email, and you can move to the next step when your SVN access is ready.

2. Adding the action on the GitHub repository

Adding the action consists of creating a specific file in a particular path, so GitHub can see it as an action and deploy it as expected.

In this guide, I’ll recommend you create a file main.yml under the path .github/workflows/ as it’s the way that I have on my own plugins. You can add the following there:

name: Deploy to WordPress.org
on:
  push:
    tags:
    - "*"
jobs:
  tag:
    name: New tag
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@master
    - name: WordPress Plugin Deploy
      uses: 10up/action-wordpress-plugin-deploy@stable
      env:
        SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }}
        SVN_USERNAME: ${{ secrets.SVN_USERNAME }}
        SLUG: Add your WP.org plugin slug

Keep in mind that you need change to your plugin slug on Add your WP.org plugin slug. If your WP.org slug and GitHub repository are the same, you could remove this part as well.

3. Adding WP.org credentials

You can add the credentials that will be used by the actions with the GitHub Encrypted Secrets.

You are going to need SVN_PASSWORD for the password and SVN_USERNAME for the username from WordPress.org.

You can do that by accessing your GitHub repository, then Settings > Secrets, and pressing “New repository secret”.

There you can add the username using SVN_USERNAME as “Name” and your WP.org username as “Value”. It should be something like that:

You can do the same thing with the password adding SVN_PASSWORD as “Name” and your WP.org user’s password as “Value”.

Assets folder

If there are icons and screenshots as part of your plugin, it’s surely possible to deploy with it.

The easiest way would be to create a folder .wordpress-org under the repository root and add your files there with the formats pointed on the Plugin Handbook.

Deploying the plugin

After you have it all set, it should be really easy to deploy.

All you need to do now is create a new release, and it would automagically get released after a few minutes.

Leave a comment

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s