From 143710d49a1c3e00be728b5d7f0c935139a69d75 Mon Sep 17 00:00:00 2001 From: Carsten Bach Date: Tue, 19 Mar 2024 11:28:29 +0100 Subject: [PATCH 01/10] Introduce 'swissspidy/wp-plugin-check-action' workflow to test against the standards for the WordPress.org plugin directory --- .github/workflows/wp-plugin-check-action.yml | 47 ++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 .github/workflows/wp-plugin-check-action.yml diff --git a/.github/workflows/wp-plugin-check-action.yml b/.github/workflows/wp-plugin-check-action.yml new file mode 100644 index 000000000..10e05e8a2 --- /dev/null +++ b/.github/workflows/wp-plugin-check-action.yml @@ -0,0 +1,47 @@ +name: 'Test against standards for the WordPress.org plugin directory' +on: # rebuild any PRs and main branch changes + workflow_dispatch: + pull_request: + push: + branches: + - main + +jobs: + test: + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: latest + coverage: none + tools: wp-cli + + - name: Install latest version of dist-archive-command + run: wp package install wp-cli/dist-archive-command:dev-main + + - name: Setup Node + uses: actions/setup-node@v4 + with: + node-version-file: '.nvmrc' + cache: npm + + - name: Install dependencies + run: npm ci + + - name: Build plugin + run: | + npm run build + wp dist-archive . ./gatherpress.zip + mkdir tmp-build + unzip gatherpress.zip -d tmp-build + + - name: Run plugin check + uses: swissspidy/wp-plugin-check-action@main + with: + build-dir: './tmp-build/gatherpress' + wp-version: 'trunk' From cdbed6b40a7657987e4ba625d34bf3795919bd5c Mon Sep 17 00:00:00 2001 From: Carsten Bach Date: Tue, 19 Mar 2024 11:37:09 +0100 Subject: [PATCH 02/10] use the same NPM version like WordPress/gutenberg --- .github/workflows/wp-plugin-check-action.yml | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/.github/workflows/wp-plugin-check-action.yml b/.github/workflows/wp-plugin-check-action.yml index 10e05e8a2..c0908166a 100644 --- a/.github/workflows/wp-plugin-check-action.yml +++ b/.github/workflows/wp-plugin-check-action.yml @@ -17,9 +17,9 @@ jobs: - name: Setup PHP uses: shivammathur/setup-php@v2 with: - php-version: latest - coverage: none - tools: wp-cli + php-version: latest + coverage: none + tools: wp-cli - name: Install latest version of dist-archive-command run: wp package install wp-cli/dist-archive-command:dev-main @@ -27,8 +27,9 @@ jobs: - name: Setup Node uses: actions/setup-node@v4 with: - node-version-file: '.nvmrc' - cache: npm + # use the same version like WordPress/gutenberg + node-version-file: '20' + cache: npm - name: Install dependencies run: npm ci @@ -43,5 +44,5 @@ jobs: - name: Run plugin check uses: swissspidy/wp-plugin-check-action@main with: - build-dir: './tmp-build/gatherpress' - wp-version: 'trunk' + build-dir: './tmp-build/gatherpress' + wp-version: 'trunk' From a6a883b1e1a01d0af7e09175abbb2b2d591c3c64 Mon Sep 17 00:00:00 2001 From: Carsten Bach Date: Tue, 19 Mar 2024 11:44:37 +0100 Subject: [PATCH 03/10] Indent using 2 spaces --- .github/workflows/wp-plugin-check-action.yml | 70 ++++++++++---------- 1 file changed, 35 insertions(+), 35 deletions(-) diff --git a/.github/workflows/wp-plugin-check-action.yml b/.github/workflows/wp-plugin-check-action.yml index c0908166a..4a8c7bffb 100644 --- a/.github/workflows/wp-plugin-check-action.yml +++ b/.github/workflows/wp-plugin-check-action.yml @@ -11,38 +11,38 @@ jobs: runs-on: ubuntu-latest steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: latest - coverage: none - tools: wp-cli - - - name: Install latest version of dist-archive-command - run: wp package install wp-cli/dist-archive-command:dev-main - - - name: Setup Node - uses: actions/setup-node@v4 - with: - # use the same version like WordPress/gutenberg - node-version-file: '20' - cache: npm - - - name: Install dependencies - run: npm ci - - - name: Build plugin - run: | - npm run build - wp dist-archive . ./gatherpress.zip - mkdir tmp-build - unzip gatherpress.zip -d tmp-build - - - name: Run plugin check - uses: swissspidy/wp-plugin-check-action@main - with: - build-dir: './tmp-build/gatherpress' - wp-version: 'trunk' + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: latest + coverage: none + tools: wp-cli + + - name: Install latest version of dist-archive-command + run: wp package install wp-cli/dist-archive-command:dev-main + + - name: Setup Node + uses: actions/setup-node@v4 + with: + # use the same version like WordPress/gutenberg + node-version-file: '20' + cache: npm + + - name: Install dependencies + run: npm ci + + - name: Build plugin + run: | + npm run build + wp dist-archive . ./gatherpress.zip + mkdir tmp-build + unzip gatherpress.zip -d tmp-build + + - name: Run plugin check + uses: swissspidy/wp-plugin-check-action@main + with: + build-dir: './tmp-build/gatherpress' + wp-version: 'trunk' From 9c63e22e74d9f8a0d97d3952fa12b4e4d333a970 Mon Sep 17 00:00:00 2001 From: Carsten Bach Date: Tue, 19 Mar 2024 12:01:14 +0100 Subject: [PATCH 04/10] Fix node-version parameter in "Setup Node" step --- .github/workflows/wp-plugin-check-action.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/wp-plugin-check-action.yml b/.github/workflows/wp-plugin-check-action.yml index 4a8c7bffb..23539c227 100644 --- a/.github/workflows/wp-plugin-check-action.yml +++ b/.github/workflows/wp-plugin-check-action.yml @@ -27,8 +27,8 @@ jobs: - name: Setup Node uses: actions/setup-node@v4 with: - # use the same version like WordPress/gutenberg - node-version-file: '20' + # Make sure to use the same version like WordPress/gutenberg. + node-version-file: '.nvmrc' cache: npm - name: Install dependencies From d9a58d3b8342e3bfc5e9008fddbe1c3cbfe91073 Mon Sep 17 00:00:00 2001 From: Carsten Bach Date: Tue, 19 Mar 2024 12:10:15 +0100 Subject: [PATCH 05/10] Fix param for manual workflow call --- .github/workflows/wp-plugin-check-action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/wp-plugin-check-action.yml b/.github/workflows/wp-plugin-check-action.yml index 23539c227..29c54d29b 100644 --- a/.github/workflows/wp-plugin-check-action.yml +++ b/.github/workflows/wp-plugin-check-action.yml @@ -1,6 +1,6 @@ name: 'Test against standards for the WordPress.org plugin directory' on: # rebuild any PRs and main branch changes - workflow_dispatch: + workflow_call: pull_request: push: branches: From aa0c47aece6f436c31dc055c1e409fbb30e51e6e Mon Sep 17 00:00:00 2001 From: Carsten Bach Date: Tue, 19 Mar 2024 12:20:53 +0100 Subject: [PATCH 06/10] Remove files from final plugin.zip --- .distignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.distignore b/.distignore index 641c651df..b2ac46f10 100755 --- a/.distignore +++ b/.distignore @@ -3,11 +3,14 @@ .deployignore .distignore .editorconfig +.env.sample .eslintignore .eslintrc +.eslintrc.js .git .gitignore .gitlab-ci.yml +.nvmrc .travis.yml .DS_Store Thumbs.db From 3257003265aa845352da3d2be1e75354698cd66b Mon Sep 17 00:00:00 2001 From: Carsten Bach Date: Tue, 19 Mar 2024 12:23:44 +0100 Subject: [PATCH 07/10] Update README with SPDX-License-Identifier --- readme.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readme.txt b/readme.txt index 581fd0c6d..b0f327ad1 100644 --- a/readme.txt +++ b/readme.txt @@ -1,7 +1,7 @@ === GatherPress === Contributors: mauteri, hrmervin, jmarx, meaganhanes, pbrocks Tags: events, event, meetup, community -License: GNU General Public License v2.0 or later +License: GPLv2 or later License URI: https://www.gnu.org/licenses/gpl-2.0.html Tested up to: 6.4 Stable tag: 0.28.0 From 098f9a7db0ccbf93dd1e112f4d744b2f7b6498ae Mon Sep 17 00:00:00 2001 From: Carsten Bach Date: Tue, 19 Mar 2024 12:39:25 +0100 Subject: [PATCH 08/10] Rename test and action --- .github/workflows/wp-plugin-check-action.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/wp-plugin-check-action.yml b/.github/workflows/wp-plugin-check-action.yml index 29c54d29b..e9858588a 100644 --- a/.github/workflows/wp-plugin-check-action.yml +++ b/.github/workflows/wp-plugin-check-action.yml @@ -1,4 +1,4 @@ -name: 'Test against standards for the WordPress.org plugin directory' +name: 'WordPress.org plugin directory guidelines' on: # rebuild any PRs and main branch changes workflow_call: pull_request: @@ -7,7 +7,7 @@ on: # rebuild any PRs and main branch changes - main jobs: - test: + wp-org-plugin-guidelines: runs-on: ubuntu-latest steps: From e2717d9eb2e6ba9ff8411e5872f9cdb7dc0f5687 Mon Sep 17 00:00:00 2001 From: Carsten Bach Date: Mon, 1 Apr 2024 03:38:49 +0200 Subject: [PATCH 09/10] Add status badge to README --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 5484cfa3d..38f475707 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,8 @@ ![GPLv2 License](https://img.shields.io/github/license/GatherPress/gatherpress) [![Coding Standards](https://github.com/GatherPress/gatherpress/actions/workflows/coding-standards.yml/badge.svg)](https://github.com/GatherPress/gatherpress/actions/workflows/coding-standards.yml) [![PHPUnit Tests](https://github.com/GatherPress/gatherpress/actions/workflows/phpunit-tests.yml/badge.svg)](https://github.com/GatherPress/gatherpress/actions/workflows/phpunit-tests.yml) [![JavaScript Unit Tests](https://github.com/GatherPress/gatherpress/actions/workflows/jest-tests.yml/badge.svg)](https://github.com/GatherPress/gatherpress/actions/workflows/jest-tests.yml) [![E2E Tests](https://github.com/GatherPress/gatherpress/actions/workflows/e2e-tests.yml/badge.svg)](https://github.com/GatherPress/gatherpress/actions/workflows/e2e-tests.yml) [![SonarCloud](https://github.com/GatherPress/gatherpress/actions/workflows/sonarcloud.yml/badge.svg)](https://github.com/GatherPress/gatherpress/actions/workflows/sonarcloud.yml) [![Dependency Review](https://github.com/GatherPress/gatherpress/actions/workflows/dependency-review.yml/badge.svg)](https://github.com/GatherPress/gatherpress/actions/workflows/dependency-review.yml) +[![WordPress.org plugin directory guidelines](https://github.com/GatherPress/gatherpress/actions/workflows/wp-plugin-check-action.yml/badge.svg)](https://github.com/GatherPress/gatherpress/actions/workflows/wp-plugin-check-action.yml) + ![WordPress Plugin Required PHP Version](https://img.shields.io/wordpress/plugin/required-php/gatherpress) ![WordPress Plugin: Required WP Version](https://img.shields.io/wordpress/plugin/wp-version/gatherpress) ![WordPress Plugin: Tested WP Version](https://img.shields.io/wordpress/plugin/tested/gatherpress) ![WordPress Plugin Version](https://img.shields.io/wordpress/plugin/v/gatherpress) [![WordPress version checker](https://github.com/GatherPress/gatherpress/actions/workflows/wordpress-version-checker.yml/badge.svg)](https://github.com/GatherPress/gatherpress/actions/workflows/wordpress-version-checker.yml) ![WordPress Plugin Active Installs](https://img.shields.io/wordpress/plugin/installs/gatherpress) ![WordPress Plugin Downloads](https://img.shields.io/wordpress/plugin/dt/gatherpress) ![WordPress Plugin Rating](https://img.shields.io/wordpress/plugin/rating/gatherpress) From 9b46118cdd5421f2d411ec6be26288b275e85016 Mon Sep 17 00:00:00 2001 From: Carsten Bach Date: Mon, 8 Apr 2024 21:09:40 +0200 Subject: [PATCH 10/10] Allow workflow to be started manually (and renamed the workflow file;) --- ...gin-check-action.yml => wordpress-org-plugin-guidelines.yml} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename .github/workflows/{wp-plugin-check-action.yml => wordpress-org-plugin-guidelines.yml} (98%) diff --git a/.github/workflows/wp-plugin-check-action.yml b/.github/workflows/wordpress-org-plugin-guidelines.yml similarity index 98% rename from .github/workflows/wp-plugin-check-action.yml rename to .github/workflows/wordpress-org-plugin-guidelines.yml index e9858588a..2525f050b 100644 --- a/.github/workflows/wp-plugin-check-action.yml +++ b/.github/workflows/wordpress-org-plugin-guidelines.yml @@ -1,6 +1,6 @@ name: 'WordPress.org plugin directory guidelines' on: # rebuild any PRs and main branch changes - workflow_call: + workflow_dispatch: pull_request: push: branches: