Skip to content

Commit 0a7b942

Browse files
authored
Merge pull request #2934 from Parsely/develop
Release wp-parsely 3.17.0
2 parents 9a40103 + eec68a0 commit 0a7b942

File tree

264 files changed

+25940
-23035
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

264 files changed

+25940
-23035
lines changed

.eslintrc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,11 @@
4242
}
4343
],
4444
"@typescript-eslint/ban-ts-comment": "off",
45-
"@typescript-eslint/prefer-nullish-coalescing": ["error"],
45+
"@typescript-eslint/method-signature-style": "error", // Can be removed after we've updated to wp-scripts v28 or greater.
46+
"@typescript-eslint/prefer-nullish-coalescing": "error",
4647
// Enabling TS rule and disabling Base rule as it can report incorrect errors.
4748
"no-shadow": "off",
48-
"@typescript-eslint/no-shadow": ["error"],
49+
"@typescript-eslint/no-shadow": "error",
4950
// Allow usage of Gutenberg experimental components.
5051
"@wordpress/no-unsafe-wp-apis": "off",
5152
// Allow link tag in JSDocs.
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
---
2+
name: Release template [NEW]
3+
about: Internally used for new releases
4+
title: Release wp-parsely x.y.z
5+
labels: 'Type: Maintenance'
6+
---
7+
8+
This is an issue for tracking the next `wp-parsely` release. This ticket is to be opened the week before the actual release, so we have enough time to complete all the related tasks.
9+
10+
The actual release of the plugin should be done on Mondays so we can catch the Tuesday WordPress VIP release window.
11+
12+
## Before releasing
13+
14+
**1. Merge all outstanding work**
15+
- [ ] Merge any outstanding PRs due for this release to the target branch (usually `develop`).
16+
- [ ] Verify that all important PRs have an appropriate `Changelog` tag. PRs without a `Changelog` tag won't be added to the changelog.
17+
18+
**2. Conduct additional testing**
19+
We've got automated testing in place and also test under our local development environment during development. For impactful releases we should also:
20+
- [ ] Conduct an additional [smoke test](https://github.com/Parsely/wp-parsely/blob/develop/docs/TESTING.md#manual-smoke-test) under our local development environment.
21+
- [ ] Test under a regular non-local WordPress installation.
22+
- [ ] Test under a real WordPress VIP environment.
23+
24+
**3. Communicate**
25+
- [ ] Inform Parse.ly support of the upcoming release.
26+
27+
The following additional tasks might be needed depending on the release and its impact:
28+
- [ ] Write any needed internal documentation.
29+
- [ ] Write an internal P2 post about the release (to be posted immediately so folks are aware of the release ahead of time).
30+
- [ ] Write a WordPress VIP Lobby post about the release (to be posted immediately to preannounce next week's VIP release - don't forget to get someone to proofread!).
31+
- [ ] Prepare any public documentation (to be posted after the WordPress.org release).
32+
33+
## Release process
34+
35+
**1. Update version numbers and changelog**
36+
- [ ] [Run the Bump wp-parsely version](https://github.com/Parsely/wp-parsely/actions/workflows/bump-version.yml) GitHub Action to update the version numbers in the plugin files. Use the branch you want to release from (usually `develop`).
37+
- [ ] Verify that the generated PR looks correct. You can amend it with new commits if needed.
38+
- [ ] Merge the PR into the target branch (usually `develop`).
39+
40+
**2. Merge develop into trunk**
41+
- [ ] [Create a PR](https://github.com/Parsely/wp-parsely/compare/trunk...develop?quick_pull=1&title=Release+wp-parsely+x.y.z&body=This+PR+merges+the+`develop`+branch+into+the+`trunk`+branch+in+order+to+release+wp-parsely+x.y.z.) that merges the target branch (usually `develop`) into `trunk`, named _Release wp-parsely x.y.z_.
42+
- [ ] Merge the PR into `trunk`.
43+
44+
**3. Create Release and Deploy to WordPress.org**
45+
- [ ] Check if the `develop` and `trunk` branches built successfully. You can check it in the [GitHub Actions](https://github.com/Parsely/wp-parsely/actions/workflows/build-plugin.yml) tab.
46+
- [ ] [Run the Release wp-parsely](https://github.com/Parsely/wp-parsely/actions/workflows/release-plugin.yml) GitHub Action, on the `trunk-built` branch, inputting the new version number, and without selecting Dry run.
47+
- [ ] Check the action logs for any errors. If there are any, fix them and rerun the action.
48+
- [ ] Check the new release on the [GitHub releases page](https://github.com/Parsely/wp-parsely/releases) and verify that it is correct.
49+
- [ ] Verify that the release was successful by checking the [WordPress.org plugin page](https://wordpress.org/plugins/wp-parsely/).
50+
51+
## After releasing
52+
53+
**1. Communicate**
54+
- [ ] If needed, update the public documentation.
55+
- [ ] Inform the concerned Slack channels about the new release, also preannouncing the WordPress VIP release.
56+
57+
**2. Merge trunk back into develop**
58+
- [ ] [Create a PR](https://github.com/Parsely/wp-parsely/compare/develop...trunk?quick_pull=1&title=Merge+trunk+into+develop+after+the+wp-parsely+x.y.z+release&body=This+PR+merges+the+`trunk`+branch+into+the+`develop`+branch+after+the+release+of+wp-parsely+x.y.z.) that merges `trunk` into `develop`, named _Merge trunk into develop after the wp-parsely x.y.z release_.
59+
- [ ] Merge the PR into `develop`.
60+
61+
**3. Manage milestones**
62+
- [ ] Close the current milestone.
63+
- [ ] If needed, open a new milestone for the next release.
64+
65+
**4. Release to other platforms**
66+
- [ ] Update the `vip-go-mu-plugins` submodule to the latest version.
67+
- [ ] Release the plugin for WordPress VIP.
68+
- [ ] Release the plugin for WordPress.com.

.github/workflows/build-plugin.yml

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
name: Build wp-parsely
2+
on:
3+
push:
4+
branches:
5+
- trunk
6+
- develop
7+
- temp-testing-branch
8+
workflow_dispatch:
9+
env:
10+
SOURCE_REF: ${{ github.ref_name }}
11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.ref_name }}
13+
cancel-in-progress: true
14+
jobs:
15+
build:
16+
name: Build and Commit
17+
runs-on: ubuntu-latest
18+
steps:
19+
- name: Setup BUILT_BRANCH env
20+
run: echo "BUILT_BRANCH=${SOURCE_REF}-built" >> $GITHUB_ENV
21+
22+
- name: Configure Git
23+
run: |
24+
git config --global user.name 'github-actions[bot]'
25+
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
26+
27+
- name: Checkout the specific branch/ref
28+
uses: actions/checkout@v4
29+
with:
30+
ref: ${{ env.SOURCE_REF }}
31+
fetch-depth: 0
32+
33+
- name: Fetch and checkout built branch
34+
run: |
35+
if git ls-remote --exit-code origin "${BUILT_BRANCH}"; then
36+
git fetch origin "${BUILT_BRANCH}"
37+
git checkout "${BUILT_BRANCH}"
38+
git pull origin "${BUILT_BRANCH}"
39+
else
40+
git checkout --orphan "${BUILT_BRANCH}" "${SOURCE_REF}"
41+
git commit --allow-empty -m "Create ${BUILT_BRANCH} branch"
42+
fi
43+
44+
- name: Merge current branch into built
45+
run: |
46+
git merge "${SOURCE_REF}" --strategy-option theirs --no-edit --squash --allow-unrelated-histories
47+
48+
- name: Read .nvmrc
49+
run: echo "NODE_VERSION=$(cat .nvmrc)" >> $GITHUB_ENV
50+
51+
- name: Use Node.js ${{ env.NODE_VERSION }}
52+
uses: actions/setup-node@v4
53+
with:
54+
node-version: ${{ env.NODE_VERSION }}
55+
cache: npm
56+
57+
- name: Build
58+
run: |
59+
npm ci
60+
npm run build
61+
composer install --no-dev --optimize-autoloader --classmap-authoritative
62+
63+
- name: Get list of changed files
64+
run: git status -s
65+
66+
- name: Create Commit Message
67+
run: |
68+
# Get the short SHA of the commit
69+
COMMIT_SHA=${GITHUB_SHA::7}
70+
# Retrieve the original commit message and replace newlines with spaces
71+
ORIGINAL_COMMIT_MESSAGE=$(git log -1 --pretty=%B "${GITHUB_SHA}" | tr '\n' ' ' | awk '{$1=$1; sub(/^ +| +$/,"")}1')
72+
# Construct the commit message safely using printf
73+
printf "Build \"%s\" (%s)\n" "$ORIGINAL_COMMIT_MESSAGE" "$COMMIT_SHA" > final_commit_message.txt
74+
75+
- name: Commit built files
76+
run: |
77+
# Add the built files
78+
git add -Af vendor/ build/
79+
git status -s
80+
# Commit the changes using the commit message file
81+
git commit -F final_commit_message.txt --no-verify
82+
git push origin "${BUILT_BRANCH}"
83+
84+
- name: Clean up commit message files
85+
run: |
86+
rm final_commit_message.txt

.github/workflows/bump-version.yml

Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
name: Bump wp-parsely version
2+
run-name: Bump wp-parsely version to ${{ github.event.inputs.new_version }}
3+
4+
on:
5+
workflow_dispatch:
6+
inputs:
7+
new_version:
8+
description: 'The new plugin version'
9+
required: true
10+
type: string
11+
12+
env:
13+
NEW_VERSION: ${{ github.event.inputs.new_version }}
14+
15+
jobs:
16+
validate_version:
17+
name: Validate the new version
18+
runs-on: ubuntu-latest
19+
outputs:
20+
current_version: ${{ steps.get_current_version.outputs.current_version }}
21+
22+
steps:
23+
- name: Checks if the new version is valid
24+
run: |
25+
if [[ ! ${{ env.NEW_VERSION }} =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
26+
echo "Invalid version format. Please use the format x.y.z"
27+
exit 1
28+
fi
29+
30+
- name: Setup PHP 8.1
31+
uses: shivammathur/setup-php@v2
32+
with:
33+
php-version: '8.1'
34+
extensions: mbstring, json
35+
36+
- name: Checkout ${{ github.ref_name }} branch
37+
uses: actions/checkout@v4
38+
with:
39+
ref: ${{ github.ref_name }}
40+
fetch-depth: 0
41+
42+
- name: Get the current version
43+
id: get_current_version
44+
run: |
45+
CURRENT_VERSION=$(grep -E "^ \* Version:" wp-parsely.php | awk '{print $3}')
46+
echo "Current version is $CURRENT_VERSION"
47+
echo "New version is ${{ env.NEW_VERSION }}"
48+
49+
echo "CURRENT_VERSION=$CURRENT_VERSION" >> $GITHUB_OUTPUT
50+
echo "CURRENT_VERSION=$CURRENT_VERSION" >> $GITHUB_ENV
51+
52+
- name: Check if the new version is greater than the current version
53+
run: |
54+
php -r '
55+
$current = "${{ env.CURRENT_VERSION }}";
56+
$new = "${{ env.NEW_VERSION }}";
57+
if ( version_compare( $new, $current, "==" ) ) {
58+
echo "The new version (${new}) is the same as the current version (${current}).\n";
59+
exit( 1 );
60+
}
61+
if ( ! version_compare( $new, $current, ">" ) ) {
62+
echo "The new version (${new}) must be greater than the current version (${current}).\n";
63+
exit( 1 );
64+
}
65+
echo "The new version is greater.\n";
66+
'
67+
68+
run_release_php_script:
69+
name: Bump the version and create the PR
70+
needs: validate_version
71+
runs-on: ubuntu-latest
72+
env:
73+
CURRENT_VERSION: ${{ needs.validate_version.outputs.current_version }}
74+
GH_TOKEN: ${{ github.token }}
75+
steps:
76+
- name: Setup PHP 8.1
77+
uses: shivammathur/setup-php@v2
78+
with:
79+
php-version: '8.1'
80+
extensions: mbstring, json
81+
82+
- name: Configure Git
83+
run: |
84+
git config --global user.name 'github-actions[bot]'
85+
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
86+
87+
- name: Checkout ${{ github.ref_name }} branch
88+
uses: actions/checkout@v4
89+
with:
90+
ref: ${{ github.ref_name }}
91+
fetch-depth: 0
92+
93+
- name: Install Composer dependencies
94+
run: composer install --optimize-autoloader --classmap-authoritative
95+
96+
- name: Run bin/release.php script
97+
run: |
98+
echo "Running 'php bin/release.php ${{ env.CURRENT_VERSION }} ${{ env.NEW_VERSION }}'"
99+
echo "n" | php bin/release.php ${{ env.CURRENT_VERSION }} ${{ env.NEW_VERSION }}
100+
if [ $? -ne 0 ]; then
101+
echo "Failed to run the release script"
102+
exit 1
103+
fi
104+
git push --set-upstream origin update/wp-parsely-version-to-${{ env.NEW_VERSION }}
105+
106+
- name: Format the version changelog
107+
run: |
108+
PARSELY_RELEASE_LOG=$(printf '%s' "$PARSELY_RELEASE_LOG" | sed 's/###/##/g')
109+
echo $PARSELY_RELEASE_LOG
110+
# Write the multiline variable to $GITHUB_ENV using the correct syntax
111+
echo "PARSELY_RELEASE_LOG<<EOF" >> $GITHUB_ENV
112+
echo "$PARSELY_RELEASE_LOG" >> $GITHUB_ENV
113+
echo "EOF" >> $GITHUB_ENV
114+
- name: Create PR
115+
run: |
116+
gh pr create \
117+
--title "Update version number and changelog for ${{ env.NEW_VERSION }} release" \
118+
--body "This PR updates the plugin's version number and changelog in preparation for the ${{ env.NEW_VERSION }} release.
119+
120+
$PARSELY_RELEASE_LOG" \
121+
--base ${{ github.ref_name }} \
122+
--head update/wp-parsely-version-to-${{ env.NEW_VERSION }} \
123+
--assignee ${{ github.actor }}

.github/workflows/deploy.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ jobs:
1010
run: |
1111
npm ci
1212
npm run build
13+
composer dump-autoload --classmap-authoritative
1314
- name: WordPress Plugin Deploy
1415
uses: 10up/action-wordpress-plugin-deploy@stable
1516
env:

.github/workflows/e2e-tests.yml

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
name: End-to-end (e2e) Tests
1+
name: End-to-end Tests
22

33
on:
44
# Run on all pull requests.
55
pull_request:
66
push:
77
branches:
88
- trunk
9+
workflow_call:
910

1011
# Cancels all previous workflow runs for pull requests that have not completed.
1112
concurrency:
@@ -16,37 +17,45 @@ concurrency:
1617

1718
jobs:
1819
test:
19-
name: e2e against WordPress latest
20-
runs-on: ubuntu-20.04
20+
name: E2E against WordPress latest
21+
runs-on: ubuntu-24.04
2122

2223
steps:
2324
- name: Checkout code
2425
uses: actions/checkout@v4
2526

27+
- name: Refresh Composer autoload files
28+
run: composer dump-autoload --classmap-authoritative
29+
2630
- name: Use desired version of NodeJS
27-
uses: actions/setup-node@v4.0.2
31+
uses: actions/setup-node@v4.1.0
2832
with:
29-
node-version: 16
33+
node-version: 18
3034
cache: npm
3135

3236
- name: Npm install
3337
run: |
3438
npm ci
3539
40+
- name: Install Playwright dependencies
41+
run: |
42+
npx playwright install chromium --with-deps
43+
3644
- name: Start up WordPress environment
3745
run: |
3846
npm run dev:start
3947
40-
- name: Running the tests
48+
- name: Running E2E tests
49+
env:
50+
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
4151
run: |
42-
npm run test:e2e -- --listTests > ~/.jest-e2e-tests
4352
npm run test:e2e
4453
4554
- name: Stop WordPress environment
4655
run: |
4756
npm run dev:stop
4857
49-
- name: Archive e2e results
58+
- name: Archive E2E results
5059
uses: actions/upload-artifact@v4
5160
if: failure()
5261
with:

0 commit comments

Comments
 (0)