Skip to content

Commit 13abcc0

Browse files
committed
Merge branch 'trunk' into trac-64389
2 parents b2be3f1 + a246a38 commit 13abcc0

706 files changed

Lines changed: 19765 additions & 5187 deletions

File tree

Some content is hidden

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

.github/setup-node/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ runs:
1010
using: 'composite'
1111
steps:
1212
- name: Use desired version of Node.js
13-
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
13+
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
1414
with:
1515
node-version-file: ${{ inputs.node-version == '' && '.nvmrc' || '' }}
1616
node-version: ${{ inputs.node-version }}

.github/workflows/build-plugin-zip.yml

Lines changed: 74 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ jobs:
179179
fi
180180
181181
build:
182-
name: Build Release Artifact
182+
name: ${{ matrix.IS_WORDPRESS_CORE && 'Build assets for wordpress-develop' || 'Build Release Artifact' }}
183183
runs-on: 'ubuntu-24.04'
184184
permissions:
185185
contents: read
@@ -190,6 +190,15 @@ jobs:
190190
github.event_name == 'workflow_dispatch' ||
191191
github.repository == 'WordPress/gutenberg'
192192
)
193+
strategy:
194+
matrix:
195+
IS_GUTENBERG_PLUGIN: [true]
196+
IS_WORDPRESS_CORE: [false]
197+
198+
include:
199+
- IS_GUTENBERG_PLUGIN: false
200+
IS_WORDPRESS_CORE: true
201+
193202
outputs:
194203
job_status: ${{ job.status }}
195204

@@ -202,24 +211,30 @@ jobs:
202211
persist-credentials: false
203212

204213
- name: Use desired version of Node.js
205-
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
214+
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
206215
with:
207216
node-version-file: '.nvmrc'
208217
check-latest: true
209218

219+
- name: Configure build for wordpress-develop
220+
if: ${{ matrix.IS_WORDPRESS_CORE }}
221+
run: jq --tab '.wpPlugin.name = "wp"' package.json > package.json.tmp && mv package.json.tmp package.json
222+
210223
- name: Build Gutenberg plugin ZIP file
211224
run: ./bin/build-plugin-zip.sh
212225
env:
213226
NO_CHECKS: 'true'
227+
IS_GUTENBERG_PLUGIN: ${{ matrix.IS_GUTENBERG_PLUGIN }}
228+
IS_WORDPRESS_CORE: ${{ matrix.IS_WORDPRESS_CORE }}
214229

215230
- name: Upload artifact
216231
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
217232
with:
218-
name: gutenberg-plugin
233+
name: gutenberg-${{ matrix.IS_WORDPRESS_CORE && 'wordpress-develop' || 'plugin' }}
219234
path: ./gutenberg.zip
220235

221236
- name: Build release notes draft
222-
if: ${{ needs.bump-version.outputs.new_version }}
237+
if: ${{ matrix.IS_GUTENBERG_PLUGIN && needs.bump-version.outputs.new_version }}
223238
env:
224239
VERSION: ${{ needs.bump-version.outputs.new_version }}
225240
run: |
@@ -235,12 +250,65 @@ jobs:
235250
fi
236251
237252
- name: Upload release notes artifact
238-
if: ${{ needs.bump-version.outputs.new_version }}
253+
if: ${{ matrix.IS_GUTENBERG_PLUGIN && needs.bump-version.outputs.new_version }}
239254
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
240255
with:
241256
name: release-notes
242257
path: ./release-notes.txt
243258

259+
# Publishes the built plugin zip file to the GitHub Container registry.
260+
publish-to-container-registry:
261+
name: Publish to GitHub Container Registry
262+
runs-on: 'ubuntu-24.04'
263+
needs: ['bump-version', 'build']
264+
permissions:
265+
contents: read
266+
packages: write
267+
if: |
268+
always() &&
269+
needs.build.outputs.job_status == 'success' &&
270+
github.repository == 'WordPress/gutenberg' &&
271+
github.event_name == 'push'
272+
273+
steps:
274+
- name: Download build artifact
275+
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
276+
with:
277+
name: gutenberg-wordpress-develop
278+
279+
- name: Unzip zip artifact
280+
run: unzip gutenberg.zip && rm gutenberg.zip
281+
282+
# Noting the hash helps keep track of the commit the zip was built from.
283+
- name: Add a file for tracking the SHA value used.
284+
run: echo "${{ github.sha }}" > .gutenberg-hash
285+
286+
- name: Recompress as a .gz file
287+
run: tar -czf ${{ runner.temp }}/gutenberg.tar.gz . && mv ${{ runner.temp }}/gutenberg.tar.gz .
288+
289+
- name: Login to GitHub Container Registry
290+
uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # v3.7.0
291+
with:
292+
registry: ghcr.io
293+
username: ${{ github.actor }}
294+
password: ${{ secrets.GITHUB_TOKEN }}
295+
296+
# OCI Registry As Storage (ORAS) provides a way to push and pull non-image, generic artifacts (.gz files,
297+
# for example) to container registries such as GitHub Container Registry.
298+
- name: Setup ORAS
299+
uses: oras-project/setup-oras@22ce207df3b08e061f537244349aac6ae1d214f6 # v1.2.4
300+
301+
# The owner/repository is hard-coded because capital letters are not allowed when publishing to GitHub
302+
# Container Registry. The organization name is WordPress, so ${{ github.repository }} causes an error.
303+
# See https://github.com/orgs/community/discussions/27086 for more info.
304+
- name: Push built plugin .tar.gz file to GitHub Container Registry
305+
run: |
306+
oras push "ghcr.io/wordpress/gutenberg/gutenberg-wp-develop-build:${{ github.sha }}" \
307+
"gutenberg.tar.gz:application/gzip" \
308+
--annotation "org.opencontainers.image.description=Gutenberg plugin build for commit ${{ github.sha }}" \
309+
--annotation "org.opencontainers.image.source=https://github.com/${{ github.repository }}" \
310+
--annotation "org.opencontainers.image.revision=${{ github.sha }}"
311+
244312
revert-version-bump:
245313
name: Revert version bump if build failed
246314
needs: [bump-version, build]
@@ -379,7 +447,7 @@ jobs:
379447
git config user.email [email protected]
380448
381449
- name: Setup Node.js
382-
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
450+
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
383451
with:
384452
node-version-file: 'main/.nvmrc'
385453
registry-url: 'https://registry.npmjs.org'

.github/workflows/bundle-size.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ jobs:
5656
persist-credentials: false
5757

5858
- name: Use desired version of Node.js
59-
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
59+
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
6060
with:
6161
node-version-file: '.nvmrc'
6262
check-latest: true

.github/workflows/cherry-pick-wp-release.yml

Lines changed: 11 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
11
name: Auto Cherry-Pick
22

33
on:
4-
push:
5-
branches:
6-
- trunk
7-
# We also want to attempt cherry-picking when a PR is labeled after the PR
8-
# is merged. Using pull_request_target instead of pull_request so that
9-
# the workflow has access to repository secrets for fork PRs.
4+
# closed: cherry-pick when a labeled PR is merged.
5+
# labeled: cherry-pick when a label is added after the PR is merged.
6+
# Using pull_request_target instead of pull_request so that the workflow
7+
# has access to repository secrets for fork PRs.
108
# https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows#pull_request_target
119
pull_request_target:
12-
types: [labeled]
10+
types: [closed, labeled]
1311
branches:
1412
- trunk
1513

@@ -29,36 +27,22 @@ jobs:
2927
contents: write
3028
issues: write
3129
pull-requests: write
32-
# When in the context of a PR, ensure the PR is merged.
33-
if: github.event.pull_request == null || github.event.pull_request.merged == true
30+
if: github.event.pull_request.merged == true
3431
steps:
3532
- name: Determine if label should trigger cherry-pick
3633
id: label-check
3734
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
3835
with:
3936
script: |
40-
const commit_sha = context.payload.pull_request ? context.payload.pull_request.merge_commit_sha : context.sha;
37+
const pr = context.payload.pull_request;
38+
const commit_sha = pr.merge_commit_sha;
39+
const pr_number = pr.number;
4140
console.log(`Commit SHA: ${commit_sha}`);
42-
core.exportVariable('commit_sha', commit_sha);
43-
const prs = await github.rest.repos.listPullRequestsAssociatedWithCommit({
44-
owner: context.repo.owner,
45-
repo: context.repo.repo,
46-
commit_sha,
47-
});
48-
if (prs.data.length === 0) {
49-
console.log(`No PR found for commit ${context.sha}.`);
50-
return;
51-
}
52-
const pr_number = prs.data[0].number;
5341
console.log(`PR: ${pr_number}`);
42+
core.exportVariable('commit_sha', commit_sha);
5443
core.exportVariable('pr_number', pr_number);
5544
56-
const pr = await github.rest.pulls.get({
57-
owner: context.repo.owner,
58-
repo: context.repo.repo,
59-
pull_number: pr_number,
60-
});
61-
const labels = pr.data.labels.map(label => label.name);
45+
const labels = pr.labels.map(label => label.name);
6246
console.log(`Labels: ${labels}`);
6347
const regex = /^Backport to WP ([0-9]+\.[0-9]+) Beta\/RC$/;
6448
let matched = false;

.github/workflows/enforce-pr-labels.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ permissions: {}
1010
jobs:
1111
type-related-labels:
1212
runs-on: 'ubuntu-24.04'
13+
if: ${{ github.event.pull_request.state == 'open' }}
1314
permissions:
1415
pull-requests: write
1516
steps:

.github/workflows/publish-npm-packages.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,15 +77,15 @@ jobs:
7777
7878
- name: Setup Node.js
7979
if: ${{ github.event.inputs.release_type != 'wp' }}
80-
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
80+
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
8181
with:
8282
node-version-file: 'cli/.nvmrc'
8383
registry-url: 'https://registry.npmjs.org'
8484
check-latest: true
8585

8686
- name: Setup Node.js (for WP major version)
8787
if: ${{ github.event.inputs.release_type == 'wp' && github.event.inputs.wp_version }}
88-
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
88+
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
8989
with:
9090
node-version-file: 'publish/.nvmrc'
9191
registry-url: 'https://registry.npmjs.org'

.github/workflows/static-checks.yml

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,12 @@ jobs:
3333
event: ['${{ github.event_name }}']
3434
node: ['20', '22', '24']
3535
os: ['macos-15', 'ubuntu-24.04', 'windows-2025']
36+
37+
include:
38+
# Only generate annotations once.
39+
- node: '24'
40+
os: 'ubuntu-24.04'
41+
annotations: true
3642
exclude:
3743
# On PRs: Only test Node 20 on Ubuntu and Windows
3844
- event: 'pull_request'
@@ -47,14 +53,15 @@ jobs:
4753
persist-credentials: false
4854

4955
- name: Use desired version of Node.js
50-
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
56+
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
5157
with:
5258
node-version: ${{ matrix.node }}
59+
cache: npm
5360

5461
- name: Pin npm version for consistency
5562
run: npm install -g npm@10
5663

57-
- name: Npm install
64+
- name: npm install
5865
# A "full" install is executed, since `npm ci` does not always exit
5966
# with an error status code if the lock file is inaccurate. This also
6067
# helps to catch dependencies not being installed with exact version.
@@ -63,8 +70,22 @@ jobs:
6370
# See: https://github.com/WordPress/gutenberg/pull/39865
6471
run: npm install
6572

66-
- name: Lint JavaScript and Styles
67-
run: npm run lint
73+
- name: Lint package.json files
74+
run: npm run lint:pkg-json
75+
76+
- name: Lint package-lock.json file
77+
run: npm run lint:lockfile
78+
79+
- name: Validate TypeScript config
80+
run: npm run lint:tsconfig
81+
82+
- name: Lint JavaScript
83+
if: ${{ matrix.annotations }}
84+
run: npm run lint:js -- --format compact
85+
86+
- name: Lint Styles
87+
if: ${{ matrix.annotations }}
88+
run: npm run lint:css -- --formatter compact
6889

6990
- name: Type checking
7091
run: npm run build

backport-changelog/7.0/10894.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,4 @@ https://github.com/WordPress/wordpress-develop/pull/10894
55
* https://github.com/WordPress/gutenberg/pull/75682
66
* https://github.com/WordPress/gutenberg/pull/75708
77
* https://github.com/WordPress/gutenberg/pull/75711
8-
* https://github.com/WordPress/gutenberg/pull/75746
98
* https://github.com/WordPress/gutenberg/pull/75869
10-
* https://github.com/WordPress/gutenberg/pull/76060

backport-changelog/7.0/10981.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
https://github.com/WordPress/wordpress-develop/pull/10981
2+
3+
* https://github.com/WordPress/gutenberg/pull/75746

backport-changelog/7.0/11098.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
https://github.com/WordPress/wordpress-develop/pull/11098
2+
3+
* https://github.com/WordPress/gutenberg/pull/75991

0 commit comments

Comments
 (0)