Skip to content

Workflows for plugins and themes developers provided by ClassicPress.

Notifications You must be signed in to change notification settings

ClassicPress/dev-workflows

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 

Repository files navigation

ClassicPress workflows for Plugin and Theme Developers

In this repository you'll find GitHub workflows that you can use in your projects.

For information about developing plugins and themes for ClassicPress visit the Plugin Guidelines and Theme Guidelines.

Table of Contents

Workflow permissions

Remember to check that the Action permissions in your repository under Settings -> Actions -> General screen is set to "Workflow permissions" -> "Read and write permissions".

Add ZIP to release

The following information applies to plugins and themes that are submitted to and listed in the CP Directory.

This workflow creates a properly crafted ZIP file and attaches this file to your release. You can also add a ZIP file (that contains your plugin or theme) from elsewhere, as long as it has the same name format as explained below.

The ZIP file will be called <REPOSITORY-NAME>-<REF-NAME>.zip (example: doit-v9.0.5.zip) and include a folder called <REPOSITORY-NAME> (example: doit).

Example of the full URL of this ZIP file: https://github.com/username/doit/releases/download/v9.0.5/doit-v9.0.5.zip

The CP Directory will use this asset (ZIP file) instead of the auto-generated assets from GitHub.

Setup

  • In your repo create a folder called .github/workflows and add file add-zip-to-release.yml from the workflows folder of this repository.

  • This workflow uses your repository name as folder name, so change it if you have to do something more specific.

  • Create a file called .gitattributes on top of your repo to exclude specific folders and files from your release (such as folder .github/workflows and file .gitattributes). Example:

    .github export-ignore
    .gitattributes export-ignore
    .gitignore export-ignore
    

Usage

Follow these steps to release a new version:

  • From your repository go to "Releases".
  • Draft a new release.
  • In the "Select tag" dropdown click "Create new tag".
Create new tag Add new tag
  • Enter a title and a description for your release.

  • Click on publish.

  • Leave the workflow time to run. You'll get the ZIP file attached to the release.

    Release created

Check with CPCS (ClassicPress Directory Coding Standard)

Setup

  • In your repo create a folder called .github/workflows and add file cpcs.yml from the workflows folder of this repository.

  • Edit cpcs.yml on line 21 to reflect your Text Domain.

    sed -i '/MY_DOMAIN/ s//CHANGE-THIS-TO-YOUR-TEXT-DOMAIN/' phpcs.xml
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    

Usage

The workflow is triggered on Pull request creation. You'll see if the test is passing. If it fails you'll see in your PR.

image

You can check what is failing from the annotations in the "Files changed" tab.

image

Also in the "Actions" tab you'll find cpcs output.

image

About

Workflows for plugins and themes developers provided by ClassicPress.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •