Skip to content

Commit 58a36c0

Browse files
committed
Merge branch 'trunk' into jspi
2 parents f5cd23c + 45149a0 commit 58a36c0

File tree

18,494 files changed

+1606971
-4230883
lines changed

Some content is hidden

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

18,494 files changed

+1606971
-4230883
lines changed

.eslintignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ packages/php-wasm/web/public
44
packages/php-wasm/compile/php
55
packages/playground/compile-wordpress/build-assets
66
__pycache__
7-
packages/playground/wordpress/src/wordpress
8-
packages/playground/wordpress/public
7+
packages/playground/wordpress-builds/src/wordpress
8+
packages/playground/wordpress-builds/public
99
packages/playground/sync/src/test/wp-*
1010
packages/php-wasm/node/src/test/__test*
1111
*.timestamp-1678999213403.mjs

.eslintrc.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
"no-inner-declarations": 0,
2929
"no-use-before-define": "off",
3030
"react/prop-types": 0,
31-
"no-console": 0,
31+
"no-console": 1,
3232
"no-empty": 0,
3333
"no-async-promise-executor": 0,
3434
"no-constant-condition": 0,
@@ -60,6 +60,12 @@
6060
"files": "*.json",
6161
"parser": "jsonc-eslint-parser",
6262
"rules": {}
63+
},
64+
{
65+
"files": "*.spec.ts",
66+
"rules": {
67+
"no-console": 0
68+
}
6369
}
6470
]
6571
}

.gitattributes

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@ packages/php-wasm/web/public/light/ linguist-generated=true -diff
1010
packages/playground/sync/src/test/wp-* linguist-generated=true
1111
packages/playground/remote/public/wp-* linguist-generated=true -diff
1212
packages/playground/remote/src/wordpress linguist-generated=true -diff
13-
packages/playground/wordpress/src/wordpress linguist-generated=true -diff
14-
packages/playground/wordpress/src/public linguist-generated=true -diff
13+
packages/playground/wordpress-builds/src/wordpress linguist-generated=true -diff
14+
packages/playground/wordpress-builds/src/public linguist-generated=true -diff
1515
packages/playground/blueprints/public/ linguist-generated=true
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
name: Finish deploying to playground.wordpress.net (don't use manually)
2+
# Sorry, the previous job just built it and uploaded it to GitHub
3+
4+
on:
5+
workflow_run:
6+
workflows: [Deploy to playground.wordpress.net]
7+
types:
8+
- completed
9+
jobs:
10+
deploy_to_wp_cloud:
11+
# Only run this workflow from the trunk branch and when it's triggered by another workflow OR certain maintainers
12+
if: >
13+
github.ref == 'refs/heads/trunk' && (
14+
github.event.workflow_run.conclusion == 'success' ||
15+
github.actor == 'adamziel' ||
16+
github.actor == 'dmsnell' ||
17+
github.actor == 'bgrgicak' ||
18+
github.actor == 'brandonpayton'
19+
)
20+
21+
# Specify runner + deployment step
22+
runs-on: ubuntu-latest
23+
environment:
24+
name: playground-wordpress-net-wp-cloud
25+
steps:
26+
# TODO: Remove this unnecessary checkout when we merge this into the website build workflow
27+
- uses: actions/checkout@v4
28+
with:
29+
sparse-checkout: |
30+
packages/playground/website-deployment
31+
- name: Wait for latest build artifact
32+
shell: bash
33+
# Sleep to give the GitHub API time to register the artifact,
34+
# otherwise the artifact will not be available when the webhook is called
35+
run: |
36+
while true; do
37+
API_HASH=$(curl 'https://api.github.com/repos/wordpress/wordpress-playground/actions/artifacts?name=playground-website&per_page=2' \
38+
| jq -r '.artifacts[0].workflow_run.head_sha')
39+
if [ "$API_HASH" = "$GITHUB_SHA" ]; then
40+
break;
41+
fi;
42+
echo "$API_HASH was not $GITHUB_SHA, waiting 10 seconds...";
43+
sleep 10;
44+
done;
45+
- name: Deploy to playground.wordpress.net
46+
shell: bash
47+
run: |
48+
ZIP_URL=$(
49+
curl -L -s -S \
50+
-H "Accept: application/vnd.github+json" \
51+
-H "X-GitHub-Api-Version: 2022-11-28" \
52+
https://api.github.com/repos/wordpress/wordpress-playground/actions/artifacts\?name\=playground-website\&per_page\=1 \
53+
| jq -r '.artifacts[0].archive_download_url'
54+
)
55+
56+
curl -L -s -S \
57+
-H "Accept: application/vnd.github+json" \
58+
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
59+
-H "X-GitHub-Api-Version: 2022-11-28" \
60+
-o playground-website.zip \
61+
"$ZIP_URL"
62+
63+
unzip playground-website.zip
64+
tar -xzf wasm-wordpress-net.tar.gz
65+
mv dist/packages/playground/wasm-wordpress-net/ playground-website/
66+
67+
mkdir -p ~/.ssh
68+
echo "${{ secrets.DEPLOY_WEBSITE_TARGET_HOST_KEY }}" >> ~/.ssh/known_hosts
69+
echo "${{ secrets.DEPLOY_WEBSITE_PRIVATE_KEY }}" > ~/.ssh/id_ed25519
70+
chmod 0600 ~/.ssh/*
71+
72+
# Website files
73+
rsync -avz -e "ssh -i ~/.ssh/id_ed25519" --delete \
74+
playground-website/ \
75+
${{ secrets.DEPLOY_WEBSITE_TARGET_USER }}@${{ secrets.DEPLOY_WEBSITE_TARGET_HOST }}:'~/updated-playground-files'
76+
77+
# Host-specific deployment scripts and server config
78+
rsync -avz -e "ssh -i ~/.ssh/id_ed25519" --delete \
79+
packages/playground/website-deployment/ \
80+
${{ secrets.DEPLOY_WEBSITE_TARGET_USER }}@${{ secrets.DEPLOY_WEBSITE_TARGET_HOST }}:'~/website-deployment'
81+
82+
# Apply update
83+
ssh -i ~/.ssh/id_ed25519 \
84+
${{ secrets.DEPLOY_WEBSITE_TARGET_USER }}@${{ secrets.DEPLOY_WEBSITE_TARGET_HOST }} \
85+
-tt -C '~/website-deployment/apply-update.sh'

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,12 @@ jobs:
3030
name: npm
3131
env:
3232
NPM_TOKEN: ${{ secrets.NPM_AUTOMATION_TOKEN }}
33+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3334
steps:
3435
- uses: actions/checkout@v3
3536
with:
3637
ref: ${{ github.event.pull_request.head.ref }}
3738
clean: true
38-
fetch-depth: 0
3939
persist-credentials: false
4040
- name: Config git user
4141
run: |
@@ -53,3 +53,8 @@ jobs:
5353
- name: Release new version of NPM packages
5454
shell: bash
5555
run: npx [email protected] publish ${{ inputs.version_bump }} --yes --no-private --loglevel=verbose --dist-tag=${{ inputs.dist_tag }}
56+
- name: Update CHANGELOG.md
57+
uses: benc-uk/workflow-dispatch@v1
58+
with:
59+
workflow: update-changelog.yml
60+
token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/refresh-wordpress-major-and-beta.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,13 @@ jobs:
3232
with:
3333
ref: ${{ github.event.pull_request.head.ref }}
3434
clean: true
35-
fetch-depth: 0
3635
persist-credentials: false
3736
- uses: ./.github/actions/prepare-playground
3837
- name: 'Recompile WordPress'
3938
shell: bash
4039
env:
4140
FORCE_REBUILD: ${{ github.event.inputs.force_rebuild }}
42-
run: npx nx bundle-wordpress:major-and-beta playground-wordpress
41+
run: npx nx bundle-wordpress:major-and-beta playground-wordpress-builds
4342
- name: Check for uncommitted changes
4443
id: changes
4544
run: |

.github/workflows/refresh-wordpress-nightly.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,11 @@ jobs:
2525
with:
2626
ref: ${{ github.event.pull_request.head.ref }}
2727
clean: true
28-
fetch-depth: 0
2928
persist-credentials: false
3029
- uses: ./.github/actions/prepare-playground
3130
- name: 'Recompile WordPress'
3231
shell: bash
33-
run: npx nx bundle-wordpress:nightly playground-wordpress
32+
run: npx nx bundle-wordpress:nightly playground-wordpress-builds
3433
- name: Config git user
3534
run: |
3635
git config --global user.name "deployment_bot"
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Update CHANGELOG.md
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
version:
7+
description: 'Version to document in the changelog (unreleased, current, 0.7.0)'
8+
required: true
9+
default: 'current'
10+
jobs:
11+
release:
12+
# Only run this workflow from the trunk branch and when it's triggered by dmsnell OR adamziel
13+
if: >
14+
github.ref == 'refs/heads/trunk' && (
15+
github.actor == 'adamziel' ||
16+
github.actor == 'dmsnell' ||
17+
github.actor == 'bgrgicak' ||
18+
github.actor == 'brandonpayton'
19+
)
20+
21+
# Specify runner + deployment step
22+
runs-on: ubuntu-latest
23+
environment:
24+
name: wordpress-assets
25+
env:
26+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
27+
steps:
28+
- uses: actions/checkout@v3
29+
with:
30+
ref: trunk
31+
clean: true
32+
persist-credentials: false
33+
- name: Fetch trunk
34+
shell: bash
35+
run: git fetch origin trunk --depth=1
36+
- name: 'Install bun (for the changelog)'
37+
run: |
38+
curl -fsSL https://bun.sh/install | bash
39+
- name: '✏️ Generate release changelog'
40+
run: |
41+
ls ./
42+
PATH="${PATH}:${HOME}/.bun/bin" npm run changelog -- --version=${{ inputs.version }}
43+
- name: '📦 Commit and push changelog'
44+
run: |
45+
git config --global user.name "deployment_bot"
46+
git config --global user.email "[email protected]"
47+
git remote set-url origin https://${{ secrets.GH_ACTOR }}:${{ secrets.GH_TOKEN }}@github.com/${{ github.repository }}
48+
if [[ -n $(git status --porcelain CHANGELOG.md) ]]; then
49+
git commit CHANGELOG.md -m "chore: update changelog"
50+
git pull origin trunk --rebase
51+
git push origin trunk
52+
else
53+
echo "No changes in CHANGELOG.md. Skipping commit and push."
54+
fi

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ packages/php-wasm/node/src/test/__test*
1212
packages/docs/site/src/model.json
1313
.docusaurus
1414
dist.zip
15+
rollup.d.ts
1516

1617
# dependencies
1718
node_modules

.nxignore

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ dist
33
packages/php-wasm/node/public
44
packages/php-wasm/web/public
55
packages/php-wasm/compile/php
6-
packages/playground/wordpress/build
6+
packages/playground/wordpress-builds/build
77
packages/playground/compile-wordpress/build-assets
88
__pycache__
9-
packages/playground/wordpress/src/wordpress
10-
packages/playground/wordpress/public
9+
packages/playground/wordpress-builds/src/wordpress
10+
packages/playground/wordpress-builds/public
1111
packages/php-wasm/node/src/test/__test*
1212
*.timestamp-1678999213403.mjs
1313
.local

.prettierignore

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
/packages/php-wasm/node/public
66
/packages/php-wasm/web/public
77
/packages/php-wasm/compile/build-assets
8-
/packages/playground/wordpress/build/build-assets
9-
/packages/playground/wordpress/src/wordpress
10-
/packages/playground/wordpress/public/
8+
/packages/playground/wordpress-builds/build/build-assets
9+
/packages/playground/wordpress-builds/src/wordpress
10+
/packages/playground/wordpress-builds/public/
1111
/packages/php-wasm/node/src/test/__test*
1212
__pycache__
1313
*.timestamp-1678999213403.mjs

0 commit comments

Comments
 (0)