|
| 1 | +# Contributing |
| 2 | + |
| 3 | +The best way to contribute to the development of this plugin is by participating on the GitHub project: |
| 4 | + |
| 5 | +https://github.com/pantheon-systems/wp-native-php-sessions |
| 6 | + |
| 7 | +Pull requests and issues are welcome! |
| 8 | + |
| 9 | +## Testing |
| 10 | + |
| 11 | +You may notice there are two sets of tests running, on two different services: |
| 12 | + |
| 13 | +* The [PHPUnit](https://phpunit.de/) test suite. |
| 14 | +* The [Behat](http://behat.org/) test suite runs against a Pantheon site, to ensure the plugin's compatibility with the Pantheon platform. |
| 15 | + |
| 16 | +Both of these test suites can be run locally, with a varying amount of setup. |
| 17 | + |
| 18 | +PHPUnit requires the [WordPress PHPUnit test suite](https://make.wordpress.org/core/handbook/testing/automated-testing/phpunit/), and access to a database with name `wordpress_test`. If you haven't already configured the test suite locally, you can run `bash bin/install-wp-tests.sh wordpress_test root '' localhost`. |
| 19 | + |
| 20 | +Behat requires a Pantheon site. Once you've created the site, you'll need [install Terminus](https://github.com/pantheon-systems/terminus#installation), and set the `TERMINUS_TOKEN`, `TERMINUS_SITE`, and `TERMINUS_ENV` environment variables. Then, you can run `./bin/behat-prepare.sh` to prepare the site for the test suite. |
| 21 | + |
| 22 | +## Workflow |
| 23 | + |
| 24 | +The `develop` branch is the development branch which means it contains the next version to be released. `main` contains the corresponding stable development version. Always work on the `develop` branch and open up PRs against `develop`. |
| 25 | + |
| 26 | +## Release Process |
| 27 | + |
| 28 | +1. Starting from `develop`, cut a release branch named `release_X.Y.Z` containing your changes. |
| 29 | +1. Update plugin version in `package.json`, `README.md`, `readme.txt`, and `wp-native-php-sessions.php`. |
| 30 | +1. Update the Changelog with the latest changes. |
| 31 | +1. Create a PR against the `main` branch. |
| 32 | +1. After all tests pass and you have received approval from a CODEOWNER (including resolving any merge conflicts), merge the PR into `main`. |
| 33 | +1. Pull `main` locally, create a new tag, and push up. |
| 34 | +1. Confirm that the necessary assets are present in the newly created tag, and test on a WP install if desired. |
| 35 | +1. Create a [new release](https://github.com/pantheon-systems/wp-native-php-sessions/releases/new) using the tag created in the previous steps, naming the release with the new version number, and targeting the tag created in the previous step. Paste the release changelog from `CHANGELOG.md` into the body of the release and include a link to the closed issues if applicable. |
| 36 | +1. Wait for the [_Release wp-native-php-sessions plugin to wp.org_ action](https://github.com/pantheon-systems/wp-native-php-sessions/actions/workflows/wordpress-plugin-deploy.yml) to finish deploying to the WordPress.org repository. If all goes well, users with SVN commit access for that plugin will receive an emailed diff of changes. |
| 37 | +1. Check WordPress.org: Ensure that the changes are live on https://wordpress.org/plugins/wp-native-php-sessions/. This may take a few minutes. |
0 commit comments