Skip to content

Commit

Permalink
Merge pull request #865 from WordPress/trunk
Browse files Browse the repository at this point in the history
Update `feature/creating-standalone-plugins` With Latest Trunk
  • Loading branch information
10upsimon authored Oct 19, 2023
2 parents ce90a8e + c28fb0c commit c77bc57
Show file tree
Hide file tree
Showing 128 changed files with 23,357 additions and 9,156 deletions.
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
/package.json export-ignore
/package-lock.json export-ignore
/phpcs.xml.dist export-ignore
/phpstan.neon.dist export-ignore
/phpunit.xml.dist export-ignore

/CODE_OF_CONDUCT.md export-ignore
Expand All @@ -33,3 +34,4 @@
/.gitignore export-ignore

/modules/**/readme.txt export-ignore
/modules/**/.wordpress-org export-ignore
14 changes: 4 additions & 10 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,7 @@
/tests/modules/js-and-css/audit-enqueued-assets @manuelRod
/tests/testdata/modules/js-and-css/audit-enqueued-assets @manuelRod

# Module: Dominant Color
/modules/images/dominant-color @pbearne @spacedmonkey
/tests/modules/images/dominant-color @pbearne @spacedmonkey
/tests/testdata/modules/images/dominant-color @pbearne @spacedmonkey

# Module: Fetchpriority
/modules/images/fetchpriority @pbearne @adamsilverstein
/tests/modules/images/fetchpriority @pbearne @adamsilverstein
/tests/testdata/modules/images/fetchpriority @pbearne @adamsilverstein

# Module: Dominant Color Images
/modules/images/dominant-color-images @pbearne @spacedmonkey
/tests/modules/images/dominant-color-images @pbearne @spacedmonkey
/tests/testdata/modules/images/dominant-color-images @pbearne @spacedmonkey
18 changes: 18 additions & 0 deletions .github/ISSUE_TEMPLATE/trac_ticket.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
name: Trac Ticket
about: Add a Trac Ticket to follow
title: "Trac XXXXX: {Summary}"
labels: [ "Trac Ticket", "WP Core" ]

---

<!--
Trac ticket issues are for team organization purposes only. Please update the title of the issue and link to the Trac ticket below.
If a focus area is known, please add the appropriate label, e.g., "[Focus] Images".
-->

Trac ticket: <!-- insert a link to the WordPress Trac ticket here -->

---
**This issue is for project tracking purposes only. Please keep all other discussion in the Trac ticket.**
52 changes: 34 additions & 18 deletions .github/workflows/deploy-standalone-plugins.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,31 +8,52 @@ on:
slug:
type: string
description: 'The slug of the plugin to deploy'
version:
type: string
description: 'The version of the plugin to deploy'

dry-run:
type: boolean
description: 'Debug mode (run without publishing).'
default: false
jobs:
release:
name: New Release
name: Prepare Deployment
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup Node.js (.nvmrc)
uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
cache: npm
- name: Install npm dependencies
run: npm ci
- name: Get plugin version
id: get-version
if: ${{ github.event_name == 'workflow_dispatch' }}
run: |
echo "version=$(node ./bin/plugin/cli.js get-plugin-version --slug=${{ inputs.slug }})" >> $GITHUB_OUTPUT
- name: Set matrix
id: set-matrix
run: |
if ${{ github.event_name == 'workflow_dispatch' }}; then
# Set the manual input values in JSON format for use in the matrix.
echo "matrix={\"include\":[{\"slug\":\"${{ inputs.slug }}\",\"version\":\"${{ inputs.version }}\"}]}" >> $GITHUB_OUTPUT
result=$(echo "${{ steps.get-version.outputs.version }}" | awk '/^(\*|[0-9]+(\.[0-9]+){0,2}(-[a-zA-Z0-9.]+)?)$/ {print "Matched"}')
if [[ -n "$result" ]]; then
# Set the manual input values in JSON format for use in the matrix.
echo "matrix={\"include\":[{\"slug\":\"${{ inputs.slug }}\",\"version\":\"${{ steps.get-version.outputs.version }}\",\"dry-run\":\"${{ inputs.dry-run }}\"}]}" >> $GITHUB_OUTPUT
else
echo "The ${{ inputs.slug }} module slug is missing in the file plugins.json."
exit 1
fi
else
# Load the JSON file and parse from "{name: {slug, version}, ...}" to "include: [{ name, slug, version }, ...]"
# for use in the matrix.
echo "matrix="$(jq -c '{include:[keys[] as $k | {name:$k,slug:.[$k].slug,version:.[$k].version }]}' plugins.json) >> $GITHUB_OUTPUT
# The "dry-run" parameter is included here to set the deployment mode.
# When running the manual (workflow_dispatch) workflow, this value will be set from manual input type.
echo "matrix="$(jq -c '{include:[keys[] as $k | {name:$k,slug:.[$k].slug,version:.[$k].version,"dry-run":false }]}' plugins.json) >> $GITHUB_OUTPUT
fi
deploy:
name: Deploy Plugin
needs: release
runs-on: ubuntu-latest
strategy:
Expand All @@ -50,18 +71,13 @@ jobs:
- name: Building standalone plugins
run: npm run build-plugins
- name: Deploy Standalone Plugin - ${{ matrix.slug }}
# TODO Once the workflow is tested, we will remove the comment and use the 10up action to deploy the plugin.
#uses: 10up/action-wordpress-plugin-deploy@stable
uses: 10up/action-wordpress-plugin-deploy@stable
with:
dry-run: ${{ matrix.dry-run }}
env:
# TODO Once the workflow is tested, we will remove the comment and use the secret SVN access.
#SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }}
#SVN_USERNAME: ${{ secrets.SVN_USERNAME }}
# TODO Once the workflow is tested, we will remove this test credential.
SVN_PASSWORD: SVN_PASSWORD
SVN_USERNAME: SVN_USERNAME
SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }}
SVN_USERNAME: ${{ secrets.SVN_USERNAME }}
SLUG: ${{ matrix.slug }}
VERSION: ${{ matrix.version }}
BUILD_DIR: ./build/${{ matrix.slug }}
ASSETS_DIR: ./build/${{ matrix.slug }}/.wordpress-org
# TODO The script will be removed once the workflow is tested.
run: bash ./deploy.sh
2 changes: 1 addition & 1 deletion .github/workflows/js-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: styfle/cancel-workflow-action@0.8.0
- uses: styfle/cancel-workflow-action@0.11.0
- uses: actions/checkout@v3
- name: Setup Node.js (via .nvmrc)
uses: actions/setup-node@v3
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/php-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ on:
- '.github/workflows/php-lint.yml'
- '**.php'
- 'phpcs.xml.dist'
- 'phpstan.neon.dist'
- 'composer.json'
- 'composer.lock'
pull_request:
Expand All @@ -22,6 +23,7 @@ on:
- '.github/workflows/php-lint.yml'
- '**.php'
- 'phpcs.xml.dist'
- 'phpstan.neon.dist'
- 'composer.json'
- 'composer.lock'
types:
Expand All @@ -35,11 +37,11 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: styfle/cancel-workflow-action@0.9.1
- uses: styfle/cancel-workflow-action@0.11.0
- uses: actions/checkout@v3
- uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
php-version: latest
- name: Get Composer Cache Directory
id: composer-cache
run: |
Expand All @@ -56,3 +58,5 @@ jobs:
run: composer install --no-interaction --no-progress
- name: PHP Lint
run: composer lint
- name: PHPStan
run: composer phpstan
2 changes: 1 addition & 1 deletion .github/workflows/php-test-standalone-plugins.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: styfle/cancel-workflow-action@0.9.1
- uses: styfle/cancel-workflow-action@0.11.0
- uses: actions/checkout@v3
- name: Setup Node.js (.nvmrc)
uses: actions/setup-node@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/php-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: styfle/cancel-workflow-action@0.9.1
- uses: styfle/cancel-workflow-action@0.11.0
- uses: actions/checkout@v3
- name: Setup Node.js (.nvmrc)
uses: actions/setup-node@v3
Expand Down
12 changes: 12 additions & 0 deletions .github/workflows/spell-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: Spell Check

on: [pull_request]

jobs:
spell-checker:
name: Spell Check with Typos
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Search for misspellings
uses: crate-ci/typos@master
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
14
16
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ Thank you for your interest in contributing to the Performance Lab plugin! Compl

In general, all code must follow the [WordPress Coding Standards and best practices](https://developer.wordpress.org/coding-standards/). All code in the Performance Lab plugin must follow these requirements:

- **WordPress**: As of Performance Lab v1.6.0, released October 17, 2022, the plugin's minimum WordPress version requirement is 6.0.
- **PHP**: Always match the latest WordPress version. The minimum required version right now is 5.6.
- **WordPress**: As of Performance Lab v2.7.0, released October 16, 2023, the plugin's minimum WordPress version requirement is 6.3.
- **PHP**: Always match the latest WordPress version. The minimum required version right now is 7.0.


## Guidelines
Expand Down
Loading

0 comments on commit c77bc57

Please sign in to comment.