Skip to content
Open
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
2 changes: 2 additions & 0 deletions .github/workflows/check-editor-releases.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ jobs:
EXELEARNING_EDITOR_REPO_URL: https://github.com/exelearning/exelearning.git
EXELEARNING_EDITOR_REF: ${{ steps.check.outputs.tag }}
EXELEARNING_EDITOR_REF_TYPE: tag
# Embed the final release version in the editor build (not 0.0.0-alpha).
APP_VERSION: ${{ steps.check.outputs.tag }}
run: make build-editor

- name: Compute version
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,10 @@ jobs:
VERSION_TAG="${RAW_TAG#v}"
echo "RELEASE_TAG=${VERSION_TAG}" >> $GITHUB_ENV
echo "EXELEARNING_EDITOR_REPO_URL=https://github.com/exelearning/exelearning.git" >> $GITHUB_ENV
echo "EXELEARNING_EDITOR_REF=main" >> $GITHUB_ENV
echo "EXELEARNING_EDITOR_REF_TYPE=branch" >> $GITHUB_ENV
# Build the editor from the matching editor tag so the embedded
# editor reports the final release version (not a nightly/alpha build).
echo "EXELEARNING_EDITOR_REF=v${VERSION_TAG}" >> $GITHUB_ENV
echo "EXELEARNING_EDITOR_REF_TYPE=tag" >> $GITHUB_ENV
else
INPUT_RELEASE="${{ github.event.inputs.release_tag }}"
if [ -z "$INPUT_RELEASE" ]; then
Expand Down
19 changes: 18 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,24 @@ fetch-editor-source:

# Build static editor to dist/static/
build-editor: check-bun fetch-editor-source
cd $(EDITOR_SUBMODULE_PATH) && bun install && bun run build:static
@# Resolve the version to embed in the editor build. The editor's build script
@# (scripts/build-static-bundle.ts) reads APP_VERSION/VERSION; without it the
@# build falls back to package.json (0.0.0-alpha). Resolution order:
@# APP_VERSION -> VERSION -> EXELEARNING_EDITOR_REF (env or .env) ->
@# exact git tag of the checked-out editor -> empty (dev default -> alpha)
@set -e; \
get_env() { \
if [ -f .env ]; then \
grep -E "^$$1=" .env | tail -n1 | cut -d '=' -f2-; \
fi; \
}; \
APP_VER="$${APP_VERSION:-$${VERSION:-$${EXELEARNING_EDITOR_REF:-$$(get_env EXELEARNING_EDITOR_REF)}}}"; \
if [ -z "$$APP_VER" ] || [ "$$APP_VER" = "main" ] || [ "$$APP_VER" = "master" ]; then \
EXACT_TAG="$$(git -C $(EDITOR_SUBMODULE_PATH) describe --tags --exact-match 2>/dev/null || true)"; \
if [ -n "$$EXACT_TAG" ]; then APP_VER="$$EXACT_TAG"; fi; \
fi; \
echo "Editor version input: $${APP_VER:-(default -> alpha)}"; \
cd $(EDITOR_SUBMODULE_PATH) && bun install && APP_VERSION="$$APP_VER" bun run build:static
@mkdir -p $(EDITOR_DIST_PATH)
@rm -rf $(EDITOR_DIST_PATH)/*
cp -r $(EDITOR_SUBMODULE_PATH)/dist/static/* $(EDITOR_DIST_PATH)/
Expand Down
Loading