Code Monkey home page Code Monkey logo

wordpress-actions's Introduction

WordPress Actions!

WordPress Actions is a collection of actions - well, for now it's just one action - to easily publish / release your plugin on WordPress.org official repository. These actions assume you're using strict Semantic Versioning tagging for the full releases of your plugin.

To use it, you have just three mandatory steps to follow:

  • Secrets. In your repository settings, create the secrets SVN_USERNAME and SVN_PASSWORD to store your WordPress svn username and password.
  • Assets. By default, WordPress.org specific assets of your plugin (like icons and headers) must be in a .wordpress-org directory at the root of your GitHub repository.
  • Workflows. You have to write worflows, with yaml, in a .github/workflows directory at the root of your GitHub repository.

In addition to that, you can write to the root of your repository plugin a .gitattributes files to exclude files from your workflows like this one:

/README.md export-ignore
/.gitattributes export-ignore
/.gitignore export-ignore
/.github export-ignore
/.wordpress-org export-ignore

Environment variables

In your yaml files you MUST set this environment variable:

  • NAME - the name of the plugin.

You CAN set too these two environment variables:

  • SLUG - defaults to the respository name, customizable in case your WordPress repository has a different slug.
  • ASSETS_DIR - defaults to .wordpress-org, customizable for other locations of WordPress.org plugin repository-specific assets that belong in the top-level assets directory (the one on the same level as trunk).

Deploying a plugin to the WordPress.org repository

When you want to deploy a new version of your plugin, just make a new release in GitHub. The tag value you put will lead to different behavior:

  • If the tag is like 1.0.0, it will generate a full release on WordPress.org: trunk and assets will be updated and a new tags/1.0.0 will be created.
  • If the tag is like 1.0.0-rc1, it will generate a short release on WordPress.org: only trunk and assets will be updated. It allows, in particular, to make a "strings freeze" to let translators do their work on the "development" branch.

I suggest you to create a workflow like this to implement such behaviors:

name: New WordPress.org release

on:
  release:
    types: [published]

jobs:
  tag:
    name: New release
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@master
      - name: WordPress Plugin Deploy
        uses: Pierre-Lannoy/wordpress-actions/dotorg-plugin-deploy@master
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          SLUG: the-plugin-slug
          NAME: The Plugin Name
          SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }}
          SVN_USERNAME: ${{ secrets.SVN_USERNAME }}

wordpress-actions's People

Contributors

helen avatar pierre-lannoy avatar sebastienserre avatar tnorthcutt avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.