Skip to content

Commit

Permalink
Merge branch 'develop' into trunk
Browse files Browse the repository at this point in the history
  • Loading branch information
dkotter committed Sep 5, 2023
2 parents 2aca3ab + 7ca1653 commit 1742dc0
Show file tree
Hide file tree
Showing 70 changed files with 3,028 additions and 1,209 deletions.
3 changes: 2 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
"Backbone": "readonly",
"_": "readonly",
"File": "readonly",
"Headers": "readonly"
"Headers": "readonly",
"requestAnimationFrame": "readonly"
},
"extends": ["plugin:@wordpress/eslint-plugin/recommended"],
"ignorePatterns": ["*.json"]
Expand Down
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ tests export-ignore
.gitattributes export-ignore
.gitignore export-ignore
.nvmrc export-ignore
.wordpress-version-checker.json export-ignore
.wp-env.json export-ignore
CHANGELOG.md export-ignore
classifai.zip export-ignore
Expand Down
24 changes: 3 additions & 21 deletions .github/workflows/build-release-zip.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,46 +2,28 @@ name: Build release zip

on:
workflow_dispatch:
release:
types: [published]

jobs:
build_zip:
name: New release
name: Build release zip
runs-on: ubuntu-latest
steps:

- name: Checkout code
uses: actions/checkout@v3

- name: Set Node.js 16.x
uses: actions/setup-node@v3
with:
node-version: 16.x

node-version-file: .nvmrc
- name: npm install and build
run: |
npm install
npm run build
npm run makepot
composer install --no-dev
npm run archive
- name: Upload the ZIP file as an artifact
if: ${{ github.event_name == 'workflow_dispatch' }}
uses: actions/upload-artifact@v3
with:
name: ${{ github.event.repository.name }}
path: release
retention-days: 5

- name: Upload release asset
if: ${{ github.event_name == 'release' }}
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ${{github.workspace}}/${{ github.event.repository.name }}.zip
asset_name: ${{ github.event.repository.name }}.zip
asset_content_type: application/zip
retention-days: 2
3 changes: 2 additions & 1 deletion .github/workflows/cypress.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ jobs:
matrix:
core:
- {name: 'WP latest', version: 'latest'}
- {name: 'WP minimum', version: 'WordPress/WordPress#5.7'}
- {name: 'WP minimum', version: 'WordPress/WordPress#5.8'}
- {name: 'WP trunk', version: 'WordPress/WordPress#master'}
steps:
- name: Checkout
uses: actions/checkout@v3
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@ jobs:
- name: Setup node v16 and npm cache
uses: actions/setup-node@v3
with:
node-version: 16
node-version-file: .nvmrc
cache: npm

- name: Install Node dependencies
run: npm ci --no-optional

- name: Get updated JS files
id: changed-files
uses: tj-actions/changed-files@v35
uses: tj-actions/changed-files@v37
with:
files: |
**/*.js
Expand Down Expand Up @@ -78,17 +78,17 @@ jobs:

- name: Get updated PHP files
id: changed-files
uses: tj-actions/changed-files@v35
uses: tj-actions/changed-files@v37
with:
files: |
**/*.php
- name: PHPCS check
run: |
if [[ "${{ steps.changed-files.outputs.any_changed }}" == 'true' && "${{ github.event_name }}" == "pull_request" ]]; then
./vendor/bin/phpcs ${{ steps.changed-files.outputs.all_changed_files }} --runtime-set testVersion 7.4-
./vendor/bin/phpcs ${{ steps.changed-files.outputs.all_changed_files }} -s --runtime-set testVersion 7.4-
elif [[ "${{ github.event_name }}" == "push" ]]; then
./vendor/bin/phpcs . --runtime-set testVersion 7.4-
./vendor/bin/phpcs . -s --runtime-set testVersion 7.4-
fi
vipcs:
Expand All @@ -97,7 +97,7 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: VIPCS check
uses: 10up/wpcs-action@stable
Expand Down
36 changes: 17 additions & 19 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,38 +1,36 @@
name: Build Release
name: Release

on:
push:
branches:
- trunk
release:
types: [published]

jobs:
release:
name: Push (merge) to trunk
name: New release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Set Node.js 16.x
uses: actions/setup-node@v3
with:
node-version: 16.x
- name: npm install and build
node-version-file: .nvmrc

- name: Install dependencies, build files and archive
run: |
npm install
npm run build
npm run makepot
composer install --no-dev
npm run archive
- name: Release to Stable
uses: s0/git-publish-subdir-action@develop
- name: Upload release asset
uses: actions/upload-release-asset@v1
env:
REPO: self
BRANCH: stable
FOLDER: release
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
MESSAGE: 'Release: ({sha}) {msg}'
- name: Build docs
run: npm run build:docs
- name: Deploy docs update
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: './docs'
upload_url: ${{ github.event.release.upload_url }}
asset_path: ${{github.workspace}}/classifai.zip
asset_name: classifai.zip
asset_content_type: application/zip
38 changes: 38 additions & 0 deletions .github/workflows/stable.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Release to Stable
on:
push:
branches:
- trunk
jobs:
release:
name: Push (merge) to trunk
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set Node.js 16.x
uses: actions/setup-node@v3
with:
node-version: 16.x
- name: npm install and build
run: |
npm install
npm run build
npm run makepot
composer install --no-dev
npm run archive
- name: Release to Stable
uses: s0/git-publish-subdir-action@develop
env:
REPO: self
BRANCH: stable
FOLDER: release
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
MESSAGE: 'Release: ({sha}) {msg}'
- name: Build docs
run: npm run build:docs
- name: Deploy docs update
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: './docs'
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,14 @@ on:
schedule:
- cron: '0 0 * * 1'

permissions:
issues: write

jobs:
wordpress-version-checker:
runs-on: ubuntu-latest
steps:
- name: WordPress version checker
uses: skaut/wordpress-version-checker@v1.2.0
uses: skaut/wordpress-version-checker@v2.0.0
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
4 changes: 4 additions & 0 deletions .wordpress-version-checker.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"readme": "readme.txt",
"channel": "rc"
}
40 changes: 40 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,45 @@ All notable changes to this project will be documented in this file, per [the Ke

## [Unreleased] - TBD

## [2.3.0] - 2023-09-05
**Note that this release bumps the WordPress minimum from 5.7 to 5.8.**

### Added
- Ability to resize (expand or condense) text content using OpenAI's ChatGPT API (props [@Sidsector9](https://github.com/Sidsector9), [@dkotter](https://github.com/dkotter), [@jeffpaul](https://github.com/jeffpaul), [@jakemgold](https://github.com/jakemgold) via [#532](https://github.com/10up/classifai/pull/532)).
- Ability to generate excerpts when using the Classic Editor (props [@jamesmorrison](https://github.com/jamesmorrison), [@ravinderk](https://github.com/ravinderk), [@dkotter](https://github.com/dkotter) via [#491](https://github.com/10up/classifai/pull/491)).
- Ability to generate images directly in the Media Library, instead of at a post level, by going to `Media > Generate Images` (props [@phpbits](https://github.com/phpbits), [@dkotter](https://github.com/dkotter) via [#524](https://github.com/10up/classifai/pull/524)).
- Ability to generate images within the Inserter Media tab. As of WordPress 6.3, this requires the latest version of the Gutenberg plugin to work. Also note that image generation requests are sent as soon as you are done typing so you may end up making multiple requests as you type out your prompt (resulting in charges for each request), depending on the typing speed (props [@dkotter](https://github.com/dkotter), [@jeffpaul](https://github.com/jeffpaul), [@peterwilsoncc](https://github.com/peterwilsoncc) via [#535](https://github.com/10up/classifai/pull/535)).
- New display option to control the display of the Text-to-Speech audio controls on the front-end (props [@joshuaabenazer](https://github.com/joshuaabenazer), [@dkotter](https://github.com/dkotter) via [#549](https://github.com/10up/classifai/pull/549)).
- Initial integration with the new Command Palette API (props [@dkotter](https://github.com/dkotter), [@iamdharmesh](https://github.com/iamdharmesh), [@ravinderk](https://github.com/ravinderk) via [#536](https://github.com/10up/classifai/pull/536)).
- New `POST` endpoints for title and excerpt generation (props [@phpbits](https://github.com/phpbits), [@dkotter](https://github.com/dkotter) via [#525](https://github.com/10up/classifai/pull/525)).
- New filter, `classifai_chatgpt_allowed_roles`, to allow ChatGPT image role settings to be overridden (props [@bjorn2404](https://github.com/bjorn2404), [@phpbits](https://github.com/phpbits), [@dkotter](https://github.com/dkotter) via [#459](https://github.com/10up/classifai/pull/459)).
- New filter, `classifai_openai_dalle_allowed_image_roles`, to allow DALL·E image role settings to be overridden (props [@bjorn2404](https://github.com/bjorn2404), [@phpbits](https://github.com/phpbits), [@dkotter](https://github.com/dkotter) via [#459](https://github.com/10up/classifai/pull/459)).
- New filter, `classifai_openai_chatgpt_{$feature}`, to allow granular access control for ChatGPT title and excerpt generation (props [@bjorn2404](https://github.com/bjorn2404), [@phpbits](https://github.com/phpbits), [@dkotter](https://github.com/dkotter) via [#459](https://github.com/10up/classifai/pull/459)).
- New filter, `classifai_openai_dalle_enable_image_gen`, to allow granular access control for DALL·E image generation (props [@bjorn2404](https://github.com/bjorn2404), [@phpbits](https://github.com/phpbits), [@dkotter](https://github.com/dkotter) via [#459](https://github.com/10up/classifai/pull/459)).

### Changed
- Bump WordPress minimum from 5.7 to 5.8 (props [@Sidsector9](https://github.com/Sidsector9) via [#532](https://github.com/10up/classifai/pull/532)).
- Bump WordPress "tested up to" version to 6.3 (props [@dkotter](https://github.com/dkotter), [@ravinderk](https://github.com/ravinderk) via [#556](https://github.com/10up/classifai/pull/556)).
- Utilize the new `POST` endpoints for title and excerpt generation, ensuring most recent content is always used (props [@phpbits](https://github.com/phpbits), [@dkotter](https://github.com/dkotter) via [#525](https://github.com/10up/classifai/pull/525)).
- Update the IBM Watson NLU API to the `2022-08-10` version (props [@dkotter](https://github.com/dkotter), [@ravinderk](https://github.com/ravinderk) via [#543](https://github.com/10up/classifai/pull/543)).
- Update the prompt we send to OpenAI that is used to generate excerpts to try and ensure the excerpts generated pair well with the title of the content (props [@dkotter](https://github.com/dkotter), [@Sidsector9](https://github.com/Sidsector9) via [#544](https://github.com/10up/classifai/pull/544)).
- Update our title generation prompt to use a `system` message (props [@dkotter](https://github.com/dkotter), [@Sidsector9](https://github.com/Sidsector9) via [#545](https://github.com/10up/classifai/pull/545)).
- Better error handling for environments that don't match our minimum PHP version (props [@rahulsprajapati](https://github.com/rahulsprajapati), [@dkotter](https://github.com/dkotter) via [#546](https://github.com/10up/classifai/pull/546)).
- Modify the audio generation process for the TTS feature. Audio generation is enabled by default but will be disabled automatically once audio has been generated (props [@joshuaabenazer](https://github.com/joshuaabenazer), [@dkotter](https://github.com/dkotter) via [#549](https://github.com/10up/classifai/pull/549)).
- Upgrade the Plugin Update Checker library to from 4.13 to 5.1 (props [@dkotter](https://github.com/dkotter), [@ravinderk](https://github.com/ravinderk) via [#555](https://github.com/10up/classifai/pull/555)).
- Update the references of the renamed Computer Vision API to Azure AI Vision (props [@kmgalanakis](https://github.com/kmgalanakis), [@dkotter](https://github.com/dkotter) via [#560](https://github.com/10up/classifai/pull/560)).
- Update the Release GitHub Action workflow files to fix an issue where release archives were not being attached (props [@iamdharmesh](https://github.com/iamdharmesh), [@dkotter](https://github.com/dkotter) via [#565](https://github.com/10up/classifai/pull/565)).

### Fixed
- Ensure we define a class property before using it to avoid PHP deprecation notices (props [@dkotter](https://github.com/dkotter), [@ankitguptaindia](https://github.com/ankitguptaindia), [@Sidsector9](https://github.com/Sidsector9) via [#548](https://github.com/10up/classifai/pull/548)).
- Prevent Text-to-Speech audio markup leakage into places using excerpts (like archives) (props [@joshuaabenazer](https://github.com/joshuaabenazer), [@dkotter](https://github.com/dkotter) via [#558](https://github.com/10up/classifai/pull/558)).
- Make sure our E2E tests work properly on WordPress 6.3 (props [@dkotter](https://github.com/dkotter), [@iamdharmesh](https://github.com/iamdharmesh) via [#562](https://github.com/10up/classifai/pull/562)).
- Add a longer delay around image generation in the Media Inserter (props [@Sidsector9](https://github.com/joshuaabenazer), [@dkotter](https://github.com/dkotter) via [#569](https://github.com/10up/classifai/pull/569)).

### Security
- Bump `word-wrap` from 1.2.3 to 1.2.4 (props [@dependabot[bot]](https://github.com/apps/dependabot) via [#542](https://github.com/10up/classifai/pull/542)).
- Bump `tough-cookie` from 2.5.0 to 4.1.3 and `@cypress/request` from 2.88.11 to 2.88.12 (props [@dependabot[bot]](https://github.com/apps/dependabot) via [#563](https://github.com/10up/classifai/pull/563)).

## [2.2.3] - 2023-07-13
### Added
- Support post classification via OpenAI Embeddings in the Classic Editor (props [@phpbits](https://github.com/phpbits), [@dkotter](https://github.com/dkotter) via [#515](https://github.com/10up/classifai/pull/515)).
Expand Down Expand Up @@ -389,6 +428,7 @@ All notable changes to this project will be documented in this file, per [the Ke
- Initial closed source release

[Unreleased]: https://github.com/10up/classifai/compare/trunk...develop
[2.3.0]: https://github.com/10up/classifai/compare/2.2.3...2.3.0
[2.2.3]: https://github.com/10up/classifai/compare/2.2.2...2.2.3
[2.2.2]: https://github.com/10up/classifai/compare/2.2.1...2.2.2
[2.2.1]: https://github.com/10up/classifai/compare/2.2.0...2.2.1
Expand Down
Loading

0 comments on commit 1742dc0

Please sign in to comment.