Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion .github/workflows/auto-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,16 @@ jobs:
run: |
set -euo pipefail
echo "${TAG}" > .editor-version
# Keep the playground blueprint's editor overlay URL in sync with the
# bundled editor version (blueprint.json's `unzip` step pulls the
# upstream editor release; production still bakes it from this marker).
sed -i -E \
-e "s#(release=)v[0-9][0-9A-Za-z.-]*#\1${TAG}#g" \
-e "s#(releases/download/)v[0-9][0-9A-Za-z.-]*#\1${TAG}#g" \
-e "s#(exelearning-static-)v[0-9][0-9A-Za-z.-]*(\.zip)#\1${TAG}\2#g" \
blueprint.json
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add .editor-version
git add .editor-version blueprint.json
git commit -m "chore: bump bundled eXeLearning editor to ${TAG}"
git push
32 changes: 13 additions & 19 deletions .github/workflows/playground-preview.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
name: Playground preview

# Builds the app — plus the prebuilt eXeLearning static editor, *downloaded*
# from the editor's latest release rather than compiled here — into a ZIP the
# Nextcloud Playground installs in the browser via the blueprint `installApp`
# step.
# Builds the app (WITHOUT the editor) into a ZIP the Nextcloud Playground
# installs in the browser via the blueprint `installApp` step. The eXeLearning
# static editor is NOT baked into this zip — the blueprint overlays it at boot
# with an `unzip` step that pulls the shared upstream editor release (the same
# artifact the Moodle/WP playgrounds use), keeping this preview zip lean.
# Production releases (release.yml / auto-release.yml) still bake the editor in.
#
# - push to main -> refresh the rolling `playground` prerelease asset
# (exelearning.zip) that blueprint.json points at, so the
Expand Down Expand Up @@ -65,25 +67,17 @@ jobs:
echo "version=pr-${{ github.event.pull_request.number }}" >> "$GITHUB_OUTPUT"
fi

# Resolve the latest *stable* eXeLearning editor tag once, so the
# download and the version reported in the PR comment stay in sync.
# The editor is overlaid by the blueprint at boot (not baked into this
# zip), pinned to .editor-version and kept in sync with the upstream tag by
# auto-release.yml. Read it here so the PR comment reports the version the
# preview actually loads.
- name: Resolve eXeLearning editor version
id: editor
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
set -euo pipefail
REF=$(gh api repos/exelearning/exelearning/releases/latest --jq '.tag_name')
REF=$(tr -d '[:space:]' < .editor-version)
echo "ref=$REF" >> "$GITHUB_OUTPUT"
echo "eXeLearning editor: $REF"

# Pulls the prebuilt static editor from that release (e.g.
# exelearning-static-vX.Y.Z.zip) into js/editor/ — no bun build.
# `make package-zip` then bundles it. `clean` keeps js/editor/.
- name: Download the eXeLearning static editor
env:
EXELEARNING_EDITOR_REF: ${{ steps.editor.outputs.ref }}
run: make download-editor
echo "eXeLearning editor (overlaid at boot): $REF"

- name: Build the playground ZIP
run: |
Expand Down Expand Up @@ -149,7 +143,7 @@ jobs:
'Two sample `.elpx` are seeded under `exelearning-samples/` in Files — ' +
'click one to open the viewer.',
'',
`Bundled eXeLearning editor: \`${editor}\` (latest stable release).`,
`eXeLearning editor: \`${editor}\` (overlaid at boot from the upstream release).`,
].join('\n');
const { owner, repo } = context.repo;
const issue_number = context.payload.pull_request.number;
Expand Down
6 changes: 6 additions & 0 deletions blueprint.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@
"appId": "exelearning",
"url": "https://zip-proxy.erseco.workers.dev/?repo=exelearning/nextcloud-exelearning&release=playground&asset=exelearning.zip"
},
{
"step": "unzip",
"comment": "Overlay the eXeLearning static editor from the upstream release instead of baking it into the app zip (the playground build ships without js/editor/). Same shared artifact the Moodle/WP playgrounds use, fetched through the github-proxy (CORS) and extracted into the installed app's js/editor/. The asset wraps everything in a 'static/' folder, which the unzip step strips. Pinned to .editor-version for deterministic previews; auto-release.yml keeps this URL in sync. Production (release.yml/auto-release.yml) still bakes the editor in.",
"url": "https://github-proxy.exelearning.dev/?repo=exelearning/exelearning&release=v4.0.1&asset=exelearning-static-v4.0.1.zip",
"destination": "apps/exelearning/js/editor"
},
{
"step": "writeFile",
"path": "config/mimetypemapping.json",
Expand Down