ci(publish): pin Doenet site DoenetML version on publish#1512
Open
dqnykamp wants to merge 1 commit into
Open
Conversation
After a dev or production npm publish, POST the exact published version to the Doenet site's /api/info/updateTrackedDoenetmlVersion endpoint so the site pins its tracked DoenetML version to an immutable jsDelivr URL — users get the new bundle without waiting out a browser cache. - Expose the published version as a job output (dev and production). - Add notify-site-dev / notify-site-prod as separate jobs so a failure here does NOT republish to npm: GitHub notifies and "Re-run failed jobs" retries only this step (the site endpoint is idempotent). - Shared .github/scripts/notify-site-version.sh: production (doenet.org) is required and fails the job loudly; dev3 is best-effort (it auto-scales to zero and may be asleep). Requires the repository secret DOENET_VERSION_UPDATE_SECRET (repo-level so both the dev and production jobs can read it). Pairs with Doenet/DoenetApps#3011. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014i6e7VFUmE7svTjjSyida7
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Context
When we publish a new DoenetML version, the Doenet site loads
@doenet/standalonefrom jsDelivr keyed by the version string stored in itsdoenetmlVersionstable. That string is currently a moving npm tag (latest/dev), so the CDN URL doesn't change on a new publish and browsers keep serving the cached old bundle until users clear their cache.The companion site PR (Doenet/DoenetApps#3011) makes the site store a concrete version and adds a
POST /api/info/updateTrackedDoenetmlVersionendpoint. This PR calls that endpoint from the publish workflow so the site pins to the exact version we just published — an immutable jsDelivr URL, no browser-cache wait.Changes
dev-release,production-release).notify-site-dev/notify-site-prodas separate jobs (needs the corresponding release job). Running them separately means a failure here does not republish to npm — GitHub notifies on the failed job and Re-run failed jobs retries only this step. The site endpoint is idempotent, so retries are safe. Both skip on dry-run..github/scripts/notify-site-version.sh(mirrors the existingpurge-jsdelivr.shconvention): posts to doenet.org (required — fails the job loudly) and dev3.doenet.org (best-effort warning, since dev3 auto-scales to zero).Requirements
DOENET_VERSION_UPDATE_SECRET(repo-level, likeVSCE_PAT, so both the dev and production jobs can read it). Its value must matchDOENETML_VERSION_UPDATE_SECRETon the site.Verification
bash -n+ full YAML parse (all 5 jobs recognized).::warning::+ exit 0; a down required target →::error::+ exit 1. The version is validated by the site's SemVer check.🤖 Generated with Claude Code