Skip to content

Latest commit

 

History

History
91 lines (56 loc) · 3.38 KB

CONTRIBUTING.md

File metadata and controls

91 lines (56 loc) · 3.38 KB

Contributing to Authorship

Code contributions, bug reports, and feedback are very welcome. These should be submitted through the GitHub repository. Development happens in the develop branch, and any pull requests should be made against that branch please.

Setting up Locally

You can clone this repo and activate it like a normal WordPress plugin, but you'll need to install the developer dependencies in order to build the assets and to run the tests.

Prerequisites

Setup

  1. Install the PHP dependencies:

    composer install
    
  2. Install the Node dependencies:

    npm install
    
  3. If you want to run the tests locally, check the MySQL database credentials in the tests/.env file and amend them as necessary.

Building the Assets

To compile the JS and CSS:

npm run build

To start the file watcher which will watch for changes and automatically build the JS and CSS:

npm run start

Running the Tests

To run the whole test suite which includes unit tests and linting:

composer test

To run just the PHPUnit tests:

composer test:ut

To run just the code sniffer:

composer test:phpcs

To run just the PHP Static Analysis tool:

composer test:phpstan

To lint the JS and CSS:

npm run lint

Releasing a New Version

These are the steps to take to release a new version of Authorship (for contributors who have push access to the GitHub repo).

Prior to Release

  1. Check the milestone on GitHub for open issues or PRs. Fix or reassign as necessary.
  2. If this is a non-patch release, check issues and PRs assigned to the patch or minor milestones that will get skipped. Reassign as necessary.
  3. Ensure you're on the develop branch and all the changes for this release have been merged in.
  4. Ensure README.md contains an up to date description, "Tested up to" version, FAQs, screenshots, etc.
    • Note: The double spaces at the end of the lines in the plugin header section at the top of README.md must be kept, to ensure line breaks are created.
  5. Run composer test and ensure everything passes.
  6. Prepare a changelog for the Releases page on GitHub.
    • The git changelog -x command from Git Extras is handy for this.

For Release

  1. Bump and commit the plugin version number using npm run bump:{INCEMENTOR}, eg: npm run bump:patch, npm run bump:minor, or npm run bump:major
  2. Push to a new release branch, eg: git checkout -b release-vxxx and then git push
  3. Create a new pull-request from that branch, eg: hub pull-request
  4. Wait until (and ensure that) the build passes
  5. Get the PR reviewed and merged
  6. git checkout main
  7. git merge develop
  8. git push origin main
  9. git push origin main:release
  10. Wait for the Build Release action to complete
  11. Enter the changelog into the release on GitHub and publish it.