Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CMS-1033] Add GH action for deployments to wp.org #103

Merged
merged 12 commits into from
Nov 22, 2022
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ jobs:
- run:
name: "Install Extras"
command: |
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 4EB27DB2A3B88B8B
sudo apt-get update
sudo apt-get install subversion
sudo apt-get install -y libmagickwand-dev --no-install-recommends
Expand Down
25 changes: 25 additions & 0 deletions .distignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# A set of files you probably don't want in your WordPress.org distribution
.circleci
.distignore
.editorconfig
.git
.github
.gitignore
.DS_Store
bin
CODEOWNERS
composer.json
composer.lock
CONTRIBUTING.md
Gruntfile.js
package.json
package-lock.json
phpcs.xml.dist
phpunit.xml.dist
README.md
tests
node_modules
vendor
*.sql
*.tar.gz
*.zip
15 changes: 15 additions & 0 deletions .github/workflows/wordpress-plugin-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Release pantheon-hud plugin to wp.org
on:
release:
types: [published]

jobs:
release:
runs-on: ubuntu-latest
steps:
- name: WordPress Plugin Deploy
uses: 10up/[email protected]
env:
SVN_USERNAME: ${{ secrets.SVN_USERNAME }}
SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }}
SLUG: ${{ env.SLUG }}
4 changes: 4 additions & 0 deletions CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Code owners. See:
# https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners

* @pantheon-systems/cms-ecosystem
40 changes: 40 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Contributing

This plugin is under active development on GitHub:

[https://github.com/pantheon-systems/pantheon-hud](https://github.com/pantheon-systems/pantheon-hud)

Please feel free to file issues there. Pull requests are also welcome!

## Workflow

The `develop` branch is the development branch which means it contains the next version to be released. `master` contains the corresponding stable development version. Always work on the `develop` branch and open up PRs against `develop`.

## Testing

You may notice there are three sets of tests running:

* [PHPCS](https://github.com/squizlabs/PHP_CodeSniffer) to detect violations of `wp-coding-standards/wpcs` coding standards.
* [PHPUnit](https://phpunit.de/) test suite.
* [Behat](http://behat.org/) test suite against a Pantheon site, to ensure the plugin's compatibility with the Pantheon platform.

These test suites can be run locally, with a varying amount of setup.

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`.

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.

Note that dependencies are installed via Composer and the `vendor` directory is not committed to the repository. You will need to run `composer install` locally for the plugin to function. You can read more about Composer [here](https://getcomposer.org)

## Release Process

1. Starting from `develop`, cut a release branch named `release_X.Y.Z` containing your changes.
1. Update plugin version in `package.json`, `README.md`, `readme.txt`, and `pantheon-hud.php`.
1. Update the Changelog with the latest changes.
1. Create a PR against the `master` branch.
1. After all tests pass and you have received approval from a CODEOWNER (including resolving any merge conflicts), merge the PR into `master`.
1. Pull `master` locally, create a new tag, and push up.
1. Confirm that the necessary assets are present in the newly created tag, and test on a WP install if desired.
1. Create a [new release](https://github.com/pantheon-systems/pantheon-hud/releases/new), 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.
1. Wait for the [_Release pantheon-hud plugin to wp.org_ action](https://github.com/pantheon-systems/pantheon-hud/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.
1. Check WordPress.org: Ensure that the changes are live on https://wordpress.org/plugins/pantheon-hud/. This may take a few minutes.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# Pantheon HUD #

**Contributors:** [getpantheon](https://profiles.wordpress.org/getpantheon), [danielbachhuber](https://profiles.wordpress.org/danielbachhuber)
**Contributors:** [getpantheon](https://profiles.wordpress.org/getpantheon/), [danielbachhuber](https://profiles.wordpress.org/danielbachhuber/)
**Tags:** Pantheon, hosting
**Requires at least:** 4.9
**Tested up to:** 5.9
Expand Down Expand Up @@ -41,6 +40,9 @@ By default, the Pantheon HUD appears for logged-in users with the `manage_option

## Changelog ##

### 0.3.2 (November 17, 2022) ###
* Adds Github Action to automate deploys to wordpress.org [[#103](https://github.com/pantheon-systems/pantheon-hud/pull/103)].

### 0.3.1 (March 13, 2020) ###
* Fixes issue where indicator didn't properly load on the frontend [[#58](https://github.com/pantheon-systems/pantheon-hud/pull/58)].

Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
{
"name": "pantheon-hud",
"version": "0.0.0",
"version": "0.3.1",
"main": "Gruntfile.js",
"author": "YOUR NAME HERE",
"author": "Pantheon <[email protected]>",
"scripts": {
"readme": "grunt readme"
},
"devDependencies": {
"grunt": "^1.5.2",
"grunt-wp-readme-to-markdown": "^2"
Expand Down
3 changes: 3 additions & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ By default, the Pantheon HUD appears for logged-in users with the `manage_option

== Changelog ==

= 0.3.2 (November 17, 2022) =
* Adds Github Action to automate deploys to wordpress.org [[#103](https://github.com/pantheon-systems/pantheon-hud/pull/103)].

= 0.3.1 (March 13, 2020) =
* Fixes issue where indicator didn't properly load on the frontend [[#58](https://github.com/pantheon-systems/pantheon-hud/pull/58)].

Expand Down