Skip to content

Commit

Permalink
Merge branch 'develop' into fix/141
Browse files Browse the repository at this point in the history
  • Loading branch information
roborourke authored Jul 25, 2024
2 parents b78ce27 + 1502d6e commit 716b0c1
Show file tree
Hide file tree
Showing 19 changed files with 656 additions and 509 deletions.
24 changes: 12 additions & 12 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ jobs:
runs-on: ubuntu-20.04
steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Setup Node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'

- name: Install PHP
uses: shivammathur/setup-php@2.7.0
uses: shivammathur/setup-php@v2
with:
php-version: 7.4
extensions: mysqli, xmlwriter
Expand All @@ -28,13 +28,13 @@ jobs:
- name: Get Composer Cache Directory
id: composer-cache-dir
run: |
echo "::set-output name=dir::$(composer config cache-files-dir)"
echo "DIR=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- name: Cache PHP Dependencies
id: composer-cache
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache-dir.outputs.dir }}
path: ${{ steps.composer-cache-dir.outputs.DIR }}
key: ${{ runner.os }}-composer-7.4-${{ hashFiles('composer.lock') }}

- name: Install PHP Dependencies
Expand All @@ -43,16 +43,16 @@ jobs:
- name: Get npm cache directory
id: npm-cache-dir
run: |
echo "::set-output name=dir::$(npm config get cache)"
echo "::set-output name=npm-version::$(npm -v)"
echo "::set-output name=node-version::$(node -v)"
echo "DIR=$(npm config get cache)" >> $GITHUB_OUTPUT
echo "NPM_VERSION=$(npm -v)" >> $GITHUB_OUTPUT
echo "NODE_VERSION=$(node -v)" >> $GITHUB_OUTPUT
- name: Cache JS Dependencies
id: npm-cache
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: ${{ steps.npm-cache-dir.outputs.dir }}
key: ${{ runner.os }}-npm-${{ steps.npm-cache-dir.outputs.node-version }}-${{ steps.npm-cache-dir.outputs.npm-version }}-${{ hashFiles('package-lock.json') }}
path: ${{ steps.npm-cache-dir.outputs.DIR }}
key: ${{ runner.os }}-npm-${{ steps.npm-cache-dir.outputs.NODE_VERSION }}-${{ steps.npm-cache-dir.outputs.NPM_VERSION }}-${{ hashFiles('package-lock.json') }}

- name: Install JS Dependencies
run: npm install --legacy-peer-deps
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/js-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ jobs:
runs-on: ubuntu-20.04
steps:
- name: Checkout repository
uses: actions/checkout@v1
uses: actions/checkout@v4

- name: Setup Node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'

Expand All @@ -29,16 +29,16 @@ jobs:
- name: Get npm cache directory
id: npm-cache-dir
run: |
echo "::set-output name=dir::$(npm config get cache)"
echo "::set-output name=npm-version::$(npm -v)"
echo "::set-output name=node-version::$(node-v)"
echo "DIR=$(npm config get cache)" >> $GITHUB_OUTPUT
echo "NPM_VERSION=$(npm -v)" >> $GITHUB_OUTPUT
echo "NODE_VERSION=$(node -v)" >> $GITHUB_OUTPUT
- name: Cache Dependencies
id: npm-cache
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: ${{ steps.npm-cache-dir.outputs.dir }}
key: ${{ runner.os }}-npm-${{ steps.npm-cache-dir.outputs.node-version }}-${{ steps.npm-cache-dir.outputs.npm-version }}-${{ hashFiles('package-lock.json') }}
path: ${{ steps.npm-cache-dir.outputs.DIR }}
key: ${{ runner.os }}-npm-${{ steps.npm-cache-dir.outputs.NODE_VERSION }}-${{ steps.npm-cache-dir.outputs.NPM_VERSION }}-${{ hashFiles('package-lock.json') }}

- name: Install Dependencies
run: npm install --legacy-peer-deps
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/php-standards.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ jobs:
runs-on: ubuntu-20.04
steps:
- name: Checkout repository
uses: actions/checkout@v1
uses: actions/checkout@v4

- name: Install PHP
uses: shivammathur/setup-php@2.7.0
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
coverage: none
Expand All @@ -31,24 +31,24 @@ jobs:
- name: Get Composer Cache Directory
id: composer-cache-dir
run: |
echo "::set-output name=dir::$(composer config cache-files-dir)"
echo "DIR=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- name: Cache PHP Dependencies
id: composer-cache
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache-dir.outputs.dir }}
key: ${{ runner.os }}-composer-7.2-${{ hashFiles('composer.lock') }}
path: ${{ steps.composer-cache-dir.outputs.DIR }}
key: ${{ runner.os }}-composer-7.4-${{ hashFiles('composer.lock') }}

- name: Install PHP Dependencies
run: |
composer install --prefer-dist --no-progress --no-suggest --no-interaction
- name: PHPCS cache
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: tests/cache
key: ${{ runner.os }}-phpcs-7.2-${{ hashFiles('plugin.php') }}
key: ${{ runner.os }}-phpcs-7.4-${{ hashFiles('plugin.php') }}

- name: Run the tests
run: |
Expand Down
22 changes: 12 additions & 10 deletions .github/workflows/test-nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,21 @@ jobs:
build:
strategy:
matrix:
php: ['7.4']
include:
- php: '8.0'
experimental: true
php:
- '7.4'
- '8.0'
- '8.1'
- '8.2'
- '8.3'
fail-fast: false
name: WP nightly / PHP ${{ matrix.php }}
runs-on: ubuntu-20.04
steps:
- name: Checkout repository
uses: actions/checkout@v1
uses: actions/checkout@v4

- name: Install PHP
uses: shivammathur/setup-php@2.7.0
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: mysqli, xmlwriter
Expand All @@ -38,19 +40,19 @@ jobs:
- name: Get Composer Cache Directory
id: composer-cache-dir
run: |
echo "::set-output name=dir::$(composer config cache-files-dir)"
echo "DIR=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- name: Cache PHP Dependencies
id: composer-cache
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache-dir.outputs.dir }}
path: ${{ steps.composer-cache-dir.outputs.DIR }}
key: ${{ runner.os }}-composer-${{ matrix.php }}-${{ hashFiles('composer.lock') }}

- name: Install PHP Dependencies
run: |
composer install --prefer-dist --no-progress --no-suggest --no-interaction --ignore-platform-reqs
composer require --dev --update-with-dependencies --prefer-dist roots/wordpress="dev-nightly" wp-phpunit/wp-phpunit="dev-master"
composer require --dev --update-with-dependencies --prefer-dist roots/wordpress="dev-main" wp-phpunit/wp-phpunit="dev-master"
- name: Run the tests
run: |
Expand Down
22 changes: 12 additions & 10 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,21 @@ jobs:
build:
strategy:
matrix:
php: ['7.4']
include:
- php: '8.0'
experimental: true
php:
- '7.4'
- '8.0'
- '8.1'
- '8.2'
- '8.3'
fail-fast: false
name: WP 5.9 / PHP ${{ matrix.php }}
name: WP 6.6 / PHP ${{ matrix.php }}
runs-on: ubuntu-20.04
steps:
- name: Checkout repository
uses: actions/checkout@v1
uses: actions/checkout@v4

- name: Install PHP
uses: shivammathur/setup-php@2.7.0
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: mysqli, xmlwriter
Expand All @@ -41,14 +43,14 @@ jobs:
- name: Get Composer Cache Directory
id: composer-cache-dir
run: |
echo "::set-output name=dir::$(composer config cache-files-dir)"
echo "DIR=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- name: Cache PHP Dependencies
id: composer-cache
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache-dir.outputs.dir }}
key: ${{ runner.os }}-composer-${{ matrix.php }}-${{ hashFiles('composer.lock') }}-wp5.9
key: ${{ runner.os }}-composer-${{ matrix.php }}-${{ hashFiles('composer.lock') }}-wp6.6

- name: Install PHP Dependencies
run: |
Expand Down
5 changes: 3 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,9 @@ These are the steps to take to release a new version of Authorship (for contribu
1. 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.
1. Ensure you're on the `develop` branch and all the changes for this release have been merged in.
1. Ensure `README.md` contains an up to date description, "Tested up to" version, FAQs, screenshots, etc.
1. Run `composer test` and ensure everything passes.
1. Prepare a changelog for [the Releases page on GitHub](https://github.com/humanmade/authorship/releases).
* **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.
3. Run `composer test` and ensure everything passes.
4. Prepare a changelog for [the Releases page on GitHub](https://github.com/humanmade/authorship/releases).
- The `git changelog -x` command from [Git Extras](https://github.com/tj/git-extras) is handy for this.

### For Release
Expand Down
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Authorship

Stable tag: 0.2.16
Stable tag: 0.2.17
Requires at least: 5.4
Tested up to: 6.2
Requires PHP: 7.2
Expand Down Expand Up @@ -61,9 +61,10 @@ _Features without a checkmark are still work in progress._
### For development use

* Clone this repo into your plugins directory
* Install the dependencies:
* Ensure you have Composer v2 and Node v16 installed
* Install the dependencies:
`composer install && npm install`
* Start the dev server:
* Start the dev server:
`npm run start`

## Design Decisions
Expand Down Expand Up @@ -133,7 +134,7 @@ This endpoint allows:

### `authorship` field

This field is added to the endpoint for all suported post types (by default, ones which that have post type support for `author`), for example `wp/v2/posts`. This field is readable and writable and accepts and provides an array of IDs of users attributed to the post.
This field is added to the endpoint for all supported post types (by default, ones which that have post type support for `author`), for example `wp/v2/posts`. This field is readable and writable and accepts and provides an array of IDs of users attributed to the post.

In addition, user objects are embedded in the `_embedded['wp:authorship']` field in the response if `_embed` is set and the authenticated user can list users.

Expand Down
7 changes: 5 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@
"phpcompatibility/phpcompatibility-wp": "2.1.0",
"phpstan/phpstan": "0.12.57",
"phpunit/phpunit": "^9.5.20",
"roots/wordpress": "~5.9.0",
"roots/wordpress": "~6.6.0",
"squizlabs/php_codesniffer": "3.5.8",
"szepeviktor/phpstan-wordpress": "0.7.1",
"vlucas/phpdotenv": "^3",
"wp-cli/db-command": "^2",
"wp-phpunit/wp-phpunit": "~5.9.3",
"wp-phpunit/wp-phpunit": "~6.6.0",
"yoast/phpunit-polyfills": "^1.0"
},
"config": {
Expand All @@ -31,6 +31,9 @@
"ergebnis/composer-normalize": true,
"roots/wordpress-core-installer": true
},
"platform": {
"php": "7.4"
},
"preferred-install": "dist",
"sort-packages": true
},
Expand Down
Loading

0 comments on commit 716b0c1

Please sign in to comment.