Skip to content

Commit c3e4253

Browse files
authored
Merge branch 'main' into dependabot/npm_and_yarn/wordpress/env-11.2.0
2 parents da3c984 + 714037a commit c3e4253

35 files changed

Lines changed: 2808 additions & 921 deletions
Lines changed: 5 additions & 0 deletions
Loading

.github/workflows/check-editor-releases.yml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ jobs:
7272
if: steps.check.outputs.found == 'true'
7373
run: |
7474
make package VERSION=${{ steps.version.outputs.version }}
75-
cp exelearning-${{ steps.version.outputs.version }}.zip exelearning.zip
7675
7776
- name: Update editor version marker
7877
if: steps.check.outputs.found == 'true'
@@ -84,6 +83,15 @@ jobs:
8483
git commit -m "Update editor version to ${{ steps.check.outputs.tag }}"
8584
git push
8685
86+
- name: Build Playground URL for this release
87+
if: steps.check.outputs.found == 'true'
88+
id: playground
89+
run: |
90+
RELEASE_URL="https://github.com/${{ github.repository }}/releases/download/${{ steps.version.outputs.tag }}/exelearning-${{ steps.version.outputs.version }}.zip"
91+
BLUEPRINT=$(jq --arg url "$RELEASE_URL" '.steps[1].pluginData.url = $url' blueprint.json)
92+
ENCODED=$(echo "$BLUEPRINT" | base64 -w 0)
93+
echo "url=https://playground.wordpress.net/#${ENCODED}" >> $GITHUB_OUTPUT
94+
8795
- name: Create GitHub Release
8896
if: steps.check.outputs.found == 'true'
8997
uses: softprops/action-gh-release@v2
@@ -95,9 +103,7 @@ jobs:
95103
96104
---
97105
98-
**[Try it now in WordPress Playground](https://playground.wordpress.net/?blueprint-url=https://raw.githubusercontent.com/${{ github.repository }}/refs/heads/main/blueprint.json)**
99-
files: |
100-
exelearning-${{ steps.version.outputs.version }}.zip
101-
exelearning.zip
106+
<a href="${{ steps.playground.outputs.url }}"><img src="https://raw.githubusercontent.com/${{ github.repository }}/refs/heads/main/.github/playground-preview-button.svg" alt="Preview in WordPress Playground" width="224"></a>
107+
files: exelearning-${{ steps.version.outputs.version }}.zip
102108
env:
103109
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/ci.yml

Lines changed: 0 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -174,67 +174,3 @@ jobs:
174174
files: artifacts/coverage/clover.xml
175175
fail_ci_if_error: false
176176

177-
playground:
178-
if: github.event_name == 'pull_request'
179-
runs-on: ubuntu-latest
180-
timeout-minutes: 2
181-
permissions:
182-
pull-requests: write
183-
steps:
184-
- name: Find existing Playground comment
185-
uses: peter-evans/find-comment@v4
186-
id: find-comment
187-
with:
188-
issue-number: ${{ github.event.pull_request.number }}
189-
comment-author: 'github-actions[bot]'
190-
body-includes: '<!-- wp-playground-link -->'
191-
192-
- name: Build Playground URL
193-
if: steps.find-comment.outputs.comment-id == ''
194-
id: playground-url
195-
run: |
196-
PLUGIN_URL="https://github.com/${{ github.repository }}/archive/refs/heads/${{ github.head_ref }}.zip"
197-
198-
BLUEPRINT=$(cat <<'BLUEPRINT_EOF'
199-
{
200-
"$schema": "https://playground.wordpress.net/blueprint-schema.json",
201-
"preferredVersions": { "php": "latest", "wp": "latest" },
202-
"siteOptions": { "blogname": "eXeLearning PR Test" },
203-
"steps": [
204-
{ "step": "setSiteLanguage", "language": "es_ES" },
205-
{
206-
"step": "installPlugin",
207-
"pluginData": { "resource": "url", "url": "PLUGIN_URL_PLACEHOLDER" },
208-
"options": { "activate": true }
209-
},
210-
{
211-
"step": "runPHP",
212-
"code": "<?php require_once '/wordpress/wp-load.php'; global $wp_rewrite; $wp_rewrite->set_permalink_structure('/%postname%/'); $wp_rewrite->flush_rules(true); ?>"
213-
}
214-
],
215-
"features": { "networking": true },
216-
"login": true,
217-
"landingPage": "/wp-admin/upload.php"
218-
}
219-
BLUEPRINT_EOF
220-
)
221-
222-
BLUEPRINT=$(echo "$BLUEPRINT" | sed "s|PLUGIN_URL_PLACEHOLDER|${PLUGIN_URL}|g")
223-
ENCODED=$(echo "$BLUEPRINT" | base64 -w 0)
224-
PLAYGROUND_URL="https://playground.wordpress.net/#${ENCODED}"
225-
echo "url=${PLAYGROUND_URL}" >> $GITHUB_OUTPUT
226-
227-
- name: Add Playground link comment
228-
if: steps.find-comment.outputs.comment-id == ''
229-
uses: peter-evans/create-or-update-comment@v5
230-
with:
231-
issue-number: ${{ github.event.pull_request.number }}
232-
body: |
233-
<!-- wp-playground-link -->
234-
## Test in WordPress Playground
235-
236-
Test the plugin **with the code from this branch**:
237-
238-
**[Open in WordPress Playground](${{ steps.playground-url.outputs.url }})**
239-
240-
> ⚠️ The embedded eXeLearning editor is not available in this preview (requires build). All other plugin features (ELP upload, shortcode, Gutenberg block, preview) work normally.

0 commit comments

Comments
 (0)